@@ -28,6 +28,10 @@ a letter with a number (`A0 --- A1`) when there are multiple ones.
28
28
``` mermaid
29
29
flowchart LR
30
30
Root[Cert] --- R1[Cert] --- R2[Cert] --- R3[...]
31
+ style Root fill: green
32
+ style R1 fill: green
33
+ style R2 fill: green
34
+ style R3 fill: green
31
35
```
32
36
33
37
It is allowed to update the role 0 with the exact same certificate.
@@ -39,9 +43,12 @@ to prevent it.
39
43
``` mermaid
40
44
flowchart LR
41
45
Root[Valid Root] --- R1[Valid update 1] --- R2[Invalid update 2] --- R3[Invalid update 3]
42
- R1 --- R4[Valid update 4]
46
+ R1 ----- R4[Valid update 4]
47
+ style Root fill: green
48
+ style R1 fill: green
43
49
style R2 fill: red
44
- style R3 fill: red
50
+ style R3 fill: yellow
51
+ style R4 fill: green
45
52
```
46
53
47
54
All following registrations (either a role update or an additional role) must reference the previous valid registration.
@@ -61,6 +68,7 @@ flowchart LR
61
68
Root[Root] --- A[A]
62
69
Root --- B[B]
63
70
Root --- C[C]
71
+ style Root fill: green
64
72
style A fill: yellow
65
73
style B fill: yellow
66
74
style C fill: yellow
@@ -71,31 +79,40 @@ no way to specify the ordering.
71
79
Therefore, one should normally wait for the previous transaction to be processed before submitting the next one.
72
80
73
81
In the example above there are three transactions: ` A ` , ` B ` and ` C ` .
74
- If all of them reference the root registration and are included into the same block then only one of them will be
75
- applied to the registration chain and the other two will be considered invalid.
76
- If these transactions reference each other (` A - B - C ` ) then only the first one will be applied regardless of the
77
- processing order.
82
+ If all of them reference the root registration and are included into the same block then only one of them that has the
83
+ lowest transaction index will be applied to the registration chain and the other two will be considered invalid.
84
+ If these transactions reference each other (` A - B - C ` ) then the order entirely depends on Cardano blockchain and
85
+ cannot be predicted.
86
+ It is possible that transactions ` B ` and ` C ` would be executed first and rejected as invalid and only ` A ` will be
87
+ applied.
88
+ It is better to avoid such situations and submit the next transaction after the previous one was included into a block.
78
89
79
90
### Branching registrations
80
91
81
92
``` mermaid
82
93
flowchart LR
83
- Root[Slot 100] --- R1[Slot 110] --- R2[Slot 121]
84
- Root ---- R3[Slot 120] --- R4[Slot 130]
94
+ Root[Slot 100] --- R1[Slot 110] --- R2[Slot 120]
95
+ Root ----- R3[Slot 130] --- R4[Slot 140]
96
+ style Root fill: green
97
+ style R1 fill: green
98
+ style R2 fill: green
85
99
style R3 fill: red
86
- style R4 fill: red
100
+ style R4 fill: yellow
87
101
```
88
102
89
- It isn't allowed to reference not the latest registration in the chain.
90
- In the example the registration in the slot number 120 would be ignored because it references the root registration, but
91
- the latest transaction is the one in the slot number 110 .
92
- The registration in the slot number 130 is ignored because it references an invalid transaction.
103
+ Only the latest valid registration in the chain can be referenced .
104
+ In the example the registration at slot 130 is ignored because it references the root registration, while the most
105
+ recent valid transaction is the one at slot 120 .
106
+ The registration at slot 140 is also ignored because it references an invalid transaction.
93
107
94
108
### Updating a stake address
95
109
96
110
``` mermaid
97
111
flowchart LR
98
112
Root[Stake1] --- R1[Stake2] --- R2[Stake3]
113
+ style Root fill: green
114
+ style R1 fill: green
115
+ style R2 fill: green
99
116
```
100
117
101
118
It is allowed to change a stake address by updating the role 0.
@@ -105,6 +122,9 @@ It is allowed to change a stake address by updating the role 0.
105
122
``` mermaid
106
123
flowchart LR
107
124
Root[PubKey1] --- R1[PubKey2] --- R2[PubKey3]
125
+ style Root fill: green
126
+ style R1 fill: green
127
+ style R2 fill: green
108
128
```
109
129
110
130
It is allowed to change a subject public key by updating the role 0.
@@ -115,78 +135,116 @@ In the example above the Catalyst ID is based on the `PubKey1`.
115
135
### Reusing a public key
116
136
117
137
``` mermaid
118
- flowchart LR
119
- subgraph Chain4
120
- direction LR
121
- E0[Stake4 PubKey3]
122
- end
123
- subgraph Chain3
124
- direction LR
125
- D0[Stake3 PubKey2]
126
- end
127
- subgraph Chain2
128
- direction LR
129
- B0[Stake2 PubKey1]
130
- end
131
- subgraph Chain1
132
- direction LR
133
- A0[Stake1 PubKey1] --- A1[Stake1 PubKey2] --- A2[Stake1 PubKey3]
134
- end
138
+ block-beta
139
+ columns 5
140
+ space s1["slot 1"] s2["slot 2"] s3["slot 3"] s4["slot 4"]
141
+ c1["chain 1"] A0["Stake1\nPubKey1"] A1["Stake1\nPubKey2"] A2["Stake1\nPubKey3"] space
142
+ c2["chain 2"] space space space B0["Stake2\nPubKey1"]
143
+ c3["chain 3"] space space space C0["Stake3\nPubKey2"]
144
+ c4["chain 4"] space space space D0["Stake4\nPubKey3"]
145
+ style A0 fill: green
146
+ style A1 fill: green
147
+ style A2 fill: red
148
+ style B0 fill: red
149
+ style C0 fill: red
150
+ style D0 fill: green
135
151
```
136
152
137
- It isn't allowed to use the key that was already used to start any of existing chains because it would result in the
138
- same Catalyst ID.
139
- In the example above the ` Chain1 ` chain consists of the initial registration with the ` PubKey1 ` key (therefore the
140
- Catalyst ID is based on it) with two subject public key updates (` PubKey2 ` and ` PubKey3 ` ).
141
- The ` Chain2 ` chain is invalid because it uses the same ` PubKey1 ` and would have the same Catalyst ID.
142
- Both ` Chain3 ` and ` Chain4 ` chains are valid even though they use the ` PubKey2 ` and ` PubKey3 ` keys that are already used
143
- in the ` Chain1 ` chain.
153
+ It isn't allowed to use a role 0 public key that was used in any of the other registration chains.
144
154
145
- It is worth noting that while it is allowed to reuse a public key there is no practical reason to do so.
146
- The existing chain can be updated instead.
155
+ In the example above the third registration in the first chain is invalid, so ` PubKey3 ` that is used in that transaction
156
+ can be used in the fourth chain.
157
+ Both second and third chain are invalid because they use ` PubKey1 ` and ` PubKey2 ` keys that are already used in the first
158
+ chain.
147
159
148
160
### Restarting a chain
149
161
150
162
``` mermaid
151
- flowchart LR
152
- subgraph Chain4
153
- direction LR
154
- E0[Stake2 PubKey3]
155
- end
156
- subgraph Chain3
157
- direction LR
158
- D0[Stake1 PubKey2]
159
- end
160
- subgraph Chain2
161
- direction LR
162
- B0[Stake2 PubKey2]
163
- end
164
- subgraph Chain1
165
- direction LR
166
- A0[Stake1 PubKey1] --- A1[Stake2 PubKey2]
167
- end
163
+ block-beta
164
+ columns 7
165
+ space s1["slot 1"] s2["slot 2"] s3["slot 3"] s4["slot 4"] space res["result"]
166
+ c1["chain 1"] A0["Stake1\nPubKey1"] A1["Stake2\nPubKey2"] space space space AF["\nPubKey2"]
167
+ c2["chain 2"] space space B0["Stake2\nPubKey2"] space space space
168
+ c3["chain 4"] space space space C0["Stake1\nPubKey3"] space CF["Stake1\nPubKey3"]
169
+ c4["chain 5"] space space space D0["Stake2\nPubKey4"] space DF["Stake2\nPubKey4"]
170
+ style A0 fill: green
171
+ style A1 fill: green
172
+ style AF fill: gray
173
+ style B0 fill: red
174
+ style C0 fill: green
175
+ style CF fill: green
176
+ style D0 fill: green
177
+ style DF fill: green
168
178
```
169
179
170
180
In the example above there is the ` Chain1 ` registration chain that was created with some ` Stake1 ` stake address and
171
181
` PubKey1 ` key then both address and key were updated to ` Stake2 ` and ` PubKey2 ` .
182
+
172
183
The ` Chain2 ` registration is invalid because it uses the same stake address and key.
173
184
There are no reason to start a new registration chain with the same data already registered and not to update the
174
185
existing one, so this isn't allowed.
175
186
176
- The ` Chain3 ` registration is valid because the ` PubKey2 ` key wasn't used before to start a chain and the ` Stake1 ` stake
177
- address isn't currently used by ` Chain1 ` .
178
- Warning: this scenario is currently problematic because we never remove entries from the ` catalyst_id_for_stake_address `
179
- table.
180
- Therefore, when registration information is requested using the ` Stake1 ` address we need to build both chains to
181
- determine that only ` Chain3 ` is relevant.
187
+ The ` Chain3 ` is valid because it uses a new public key and the ` Stake1 ` stake address isn't currently used by ` Chain1 ` .
182
188
183
- The ` Chain4 ` registration is valid, but it "overrides" ` Chain1 ` essentially discarding it and starting a new chain
184
- because it has the same stake address ( ` Stake2 ` ) .
189
+ The ` Chain4 ` registration is valid, but it takes ownership over the ` Stake2 ` stake address of the first chain.
190
+ It is allowed because the new chain uses a new public key .
185
191
This can be useful if a user lost his private key while maintaining access to his Cardano wallet (and the stake address
186
192
used in that registration chain).
187
- After that ` Chain1 ` is considered no longer valid and must not be used.
193
+ This can also be referred to as "restarting" or "overriding" a chain.
194
+ After that ` Chain1 ` is still valid and can be potentially continued, but as for now it has zero voting power because it
195
+ has no active stake address.
196
+ It is allowed to use an RBAC token based on that chain and perform actions such as submitting a proposal.
197
+
198
+ ### Restarting multiple chains
199
+
200
+ ``` mermaid
201
+ block-beta
202
+ columns 6
203
+ space s1["slot 1"] s2["slot 2"] s3["slot 3"] space res["result"]
204
+ c1["chain 1"] A0["..."] A1["Stake1\nPubKey1"] space space AF["\nPubKey1"]
205
+ c2["chain 2"] B0["..."] B1["Stake2\nPubKey2"] space space BF["\nPubKey2"]
206
+ c3["chain 3"] space space C0["Stake1, Stake2\nPubKey3"] space CF["Stake1, Stake2\nPubKey3"]
207
+ style A0 fill: green
208
+ style A1 fill: green
209
+ style AF fill: gray
210
+ style B0 fill: green
211
+ style B1 fill: green
212
+ style BF fill: gray
213
+ style C0 fill: green
214
+ style CF fill: green
215
+ ```
216
+
217
+ It is possible to restart/override multiple chains with one new registration.
218
+ In the example above there are two chains with stake addresses ` Stake1 ` and ` Stake2 ` correspondingly.
219
+ The new root registration contains both of these addresses, so assuming it is valid, it "restarts" both previous
220
+ registrations.
221
+
222
+ As explained in the [ restarting a chain] ( #restarting-a-chain ) example, a new registration must use a different public
223
+ key, so using both ` PubKey1 ` and ` PubKey2 ` isn't allowed.
224
+
225
+ Both first and second chains are still valid and can be continued, but have zero voting power unless a new stake address
226
+ is associated with them by a registration update.
188
227
189
- ### Multiple stake addresses
228
+ ### Restarting chain(s) with multiple stake addresses
229
+
230
+ ``` mermaid
231
+ block-beta
232
+ columns 6
233
+ space s1["slot 1"] s2["slot 2"] s3["slot 3"] space res["result"]
234
+ c1["chain 1"] A0["..."] A1["Stake1, Stake2\nPubKey1"] space space AF["\nPubKey1"]
235
+ c2["chain 2"] B0["..."] B1["Stake3, Stake4\nPubKey2"] space space BF["Stake4\nPubKey2"]
236
+ c3["chain 3"] space space C0["Stake1, Stake2, Stake3\nPubKey3"] space CF["Stake1, Stake2, Stake3\nPubKey2"]
237
+ style A0 fill: green
238
+ style A1 fill: green
239
+ style AF fill: gray
240
+ style B0 fill: green
241
+ style B1 fill: green
242
+ style BF fill: green
243
+ style C0 fill: green
244
+ style CF fill: green
245
+ ```
190
246
191
- Multiple stake addresses support will be addressed in a future revision.
192
- Currently we only support a single stake address per registration chain.
247
+ It isn't required for a new chain to use all stake addresses of a previous one.
248
+ In the example above the new registration uses only three addresses of four used in two previous chains.
249
+ As a result, the first chain has no active stake addresses, but the second one still has the ` Stake4 ` stake address
250
+ associated with it.
0 commit comments