@@ -16,24 +16,20 @@ License: CC-BY-4.0 / Apache 2.0
16
16
# Role Based Access Control Registration
17
17
18
18
## Abstract
19
- <!-- A short (\~200 word) description of the proposed solution and the technical issue being addressed. -->
19
+
20
20
dApps such as Project Catalyst need robust, secure and extensible means for users to register under various roles
21
21
and for the dApp to be able to validate actions against those roles.
22
22
While these Role based registrations are required for future functionality of Project Catalyst, they are also
23
23
intended to be generally useful to any dApp with User roles.
24
24
25
25
## Motivation: why is this CIP necessary?
26
- <!-- A clear explanation that introduces the reason for a proposal, its use cases and stakeholders.
27
- If the CIP changes an established design then it must outline design issues that motivate a rework.
28
- For complex proposals, authors must write a Cardano Problem Statement (CPS) as defined in CIP-9999
29
- and link to it as the `Motivation`. -->
30
26
31
27
CIP-36 contains a limited form of role registration limited to voters and dreps.
32
28
33
29
However, Project Catalyst has a large (and growing) number of roles identified in the system, all of
34
30
which can benefit from on-chain registration.
35
31
36
- A non-exhaustive list of the roles Project Catalyst needs to identify on-chain are:
32
+ A non-exhaustive example list of the roles Project Catalyst needs to identify securely are:
37
33
38
34
1 . Proposers.
39
35
2 . Co-Proposers.
@@ -46,7 +42,7 @@ A non-exhaustive list of the roles Project Catalyst needs to identify on-chain a
46
42
47
43
Individual dApps may have their own unique list of roles they wish users to register for.
48
44
Roles are such that an individual user may hold multiple roles, one of the purposes of this
49
- CIP is to allow the user to unambiguously assert they are acting in the capacity of a selected role.
45
+ CIP is to allow the user to unambiguously assert they are acting in the capacity of a selected role.
50
46
51
47
CIP-36 offers a "purpose" field, but offers no way to manage it, and offers no way to allow it to be used unambiguously.
52
48
The "purpose" field therefore is insufficient for the needs of identifying roles.
@@ -63,12 +59,6 @@ Registering for various roles and having role specific keys is generally useful
63
59
motivated to solve problems with Project Catalyst, it is also intended to be generally applicable to other dApps.
64
60
65
61
## Specification
66
- <!-- The technical specification should describe the proposed improvement in sufficient technical detail.
67
- In particular, it should provide enough information that an implementation can be performed solely on the basis
68
- of the design in the CIP.
69
- This is necessary to facilitate multiple, interoperable implementations.
70
- This must include how the CIP should be versioned.
71
- If a proposal defines structure of on-chain data it must include a CDDL schema in it's specification.-->
72
62
73
63
Role registration is achieved by using two metadata records attached to the same transaction.
74
64
@@ -136,7 +126,8 @@ Informally, all Registrations follow the same generalized Format (Non-Normative)
136
126
// Role
137
127
5: 0,
138
128
// dApp ID (UUID or ULID)
139
- 6: h'',
129
+ 6: #6.37 h'a3c12b1c98af4ee8b54278e77906c0fc'; or // UUID
130
+ #6.32770 h'018d1d2acaf04486be189dbc5ae35e51', // ULID
140
131
// Expires - Optional
141
132
7: 0,
142
133
// dApp Defined Metadata - Optional
@@ -157,7 +148,7 @@ the requirements of the identified dApp.
157
148
Subkey 1 is either:
158
149
159
150
* A Single [ Role Specific Public Key] ( #subkey-1---role-key---single-role-specific-public-key ) ; OR
160
- * A [ Optionally Weighted List of Role Specific Public Keys] ( #grouped- role-registration-format ) .
151
+ * A [ Optionally Weighted List of Role Specific Public Keys] ( #subkey-1--- role-key---list-of-role-keys ) .
161
152
162
153
#### SubKey 1 - Role Key - Single Role Specific Public Key
163
154
@@ -210,39 +201,43 @@ It also provides a mechanism to unambiguously identify the role being asserted w
210
201
The Role Specific key derivation path must start with a specific segment:
211
202
212
203
Path based key derivation is limited to 31 bits, per path component.
213
- The [ dApp ID] ( ) is 128 bits.
204
+ The [ dApp ID] is 128 bits.
214
205
It is required that the Role key be, as far as practically possible, unique amongst dApps.
215
206
This is to prevent a Role from one dApp being misused by another, either intentionally or inadvertently.
216
207
217
- The [ dApp ID] ( ) will be reduced to 31 bits by using Blake2B with a 31 bit digest over the [ dApp ID] ( ) .
218
- While 31 bits is small, and could be subject to a collision attack, the intention here is not to prevent
219
- deliberately contrived collisions but to disambiguate dApps under normal circumstances.
220
- As the [ dApp ID] ( ) is not controllable, a malicious dApp could simply use the same dApp ID as another.
221
- Therefore it is not possible to protect against a collision and the [ dApp ID] ( ) is not a security mechanism
222
- in any event.
223
-
224
- However key derivation is limited to 31 bits, accordingly, the [ dApp ID] [ ] will be hashed with Blake2B and a
208
+ However key derivation is limited to 31 bits, accordingly, the [ dApp ID] will be hashed with Blake2B and a
225
209
31 bit digest will be produced.
226
210
The aim is to as far as practical cause dApps to have distinct Role keys under normal circumstances.
227
211
228
- ` m / 7222' / 1815' / account' / chain' / blake2b_31 (dApp ID) / role `
212
+ ` m / 7222' / 1815' / account' / chain' / hash (dApp ID) / role `
229
213
230
214
* ` 7222' ` : The registration metadata field key from this CIP.
231
215
* ` 1815' ` : The year Ada Lovelace was born - Identifies this key as being for Cardano.
232
216
* ` account' ` : The voters account
233
217
* ` chain' ` : The chain on which the voter is registering.
234
- * ` blake2b_31(uuid )` : The [ dApp ID] ( )
218
+ * ` hash(dapp ID )` : The [ hashed ] ( #hashdapp-id ) [ dApp ID]
235
219
* ` role ` : The role being registered for.
236
220
237
- Note: It is specifically required that the Role Key NOT CHANGE for registrations made from the same wallet for the same dApp UUID/Purpose.
238
- This is because its possible to make both single and array role registrations, and its critical the key be the same regardless of which is used.
221
+ Note: It is specifically required that the Role Key NOT CHANGE for the same dApp UUID/Purpose for any compliant Wallet.
222
+ This is because its possible to make both single and array role registrations, and its critical the key be the same in these.
223
+ It also critical that the Role keys be freely transferable and recoverable across wallets.
239
224
The necessity of this will be expanded on when the witness is discussed below.
240
225
241
- If the wallet does not use path based key derivation it is Essential that:
226
+ ##### hash(dapp ID)
227
+
228
+ The [ dApp ID] will be reduced to 31 bits by using Blake2B with a 32 bit digest over the [ dApp ID] .
242
229
243
- * Role Specific Public Keys do not change from registration to registration for the same [ dApp UUID] [ dApp-UUID ] /Purpose.
244
- * Role Specific Public Keys are not the same for different Purposes for a UUID.
245
- * It is acceptable, though undesirable, for different [ dApp UUID's] [ dApp-UUID ] to use the same Role Specific Public Keys.
230
+ To ensure the hardening bit is not set, the high bit of the resultant hash will be forced to 0.
231
+
232
+ ``` text
233
+ hash(dapp ID) == blake2b_32(dapp ID) & 0x7FFFFFFF
234
+ ```
235
+
236
+ While 31 bits is small, and could be subject to a collision attack, the intention here is not to prevent
237
+ deliberately contrived collisions but to disambiguate dApps under normal circumstances.
238
+ As the [ dApp ID] is not controllable, a malicious dApp could simply use the same dApp ID as another.
239
+ Therefore it is not possible to protect against a collision and the [ dApp ID] is not a security mechanism
240
+ in any event.
246
241
247
242
#### SubKey 1 - Role Key - List of Role Keys
248
243
@@ -540,3 +535,4 @@ Code samples and reference material are licensed under [Apache 2.0]
540
535
[ Apache 2.0 ] : https://www.apache.org/licenses/LICENSE-2.0.html
541
536
[ CBOR ] : https://www.rfc-editor.org/rfc/rfc8949.html
542
537
[ CBOR - Core Deterministic Encoding Requirements ] : https://www.rfc-editor.org/rfc/rfc8949.html#section-4.2.1
538
+ [ CIP0003 ] : https://cips.cardano.org/cip/CIP-0003
0 commit comments