forked from cardano-foundation/CIPs
-
Notifications
You must be signed in to change notification settings - Fork 3
/
schema.cddl
54 lines (44 loc) · 1.28 KB
/
schema.cddl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
registration_cbor = {
61284: key_registration,
61285: registration_witness
}
$cip36_vote_pub_key /= bytes .size 32
$payment_address /= bytes
$nonce /= uint
$weight /= uint .size 4
$voting_purpose /= uint
legacy_key_registration = $cip36_vote_pub_key
delegation = [$cip36_vote_pub_key, $weight]
; May support other stake credentials in the future.
; Such additional credentials should be tagged at the CDDL/CBOR level
; so that parsing is not ambiguous and future proof.
; However, to avoid breaking changes, the simple key credential is
; left untagged.
$stake_credential /= $staking_pub_key
$stake_witness /= $ed25519_signature
; A stake key credential, not tagged for backward compatibility
$staking_pub_key /= bytes .size 32
; Witness for a stake key credential, not tagged for backward compatibility
$ed25519_signature /= bytes .size 64
key_registration = {
1 : [+delegation] / legacy_key_registration,
2 : $stake_credential,
3 : $payment_address,
4 : $nonce,
? 5 : $voting_purpose .default 0
}
registration_witness = {
1 : $stake_witness
}
deregistration_cbor = {
61286: key_deregistration,
61285: deregistration_witness
}
key_deregistration = {
1 : $stake_credential,
2 : $nonce,
? 3 : $voting_purpose .default 0
}
deregistration_witness = {
1 : $stake_witness
}