@@ -26,38 +26,38 @@ $vrf_vkey = bytes .size 32
26
26
addr_keyhash = $hash28
27
27
28
28
; address = bytes
29
- ; reward_account = bytes
30
29
;
31
- ; address format:
32
- ; [ 8 bit header | payload ];
30
+ ; address format:
31
+ ; [ 8 bit header | payload ];
33
32
;
34
- ; shelley payment addresses:
35
- ; bit 7: 0
36
- ; bit 6: base/other
37
- ; bit 5: pointer/enterprise [for base: stake cred is keyhash/scripthash]
38
- ; bit 4: payment cred is keyhash/scripthash
39
- ; bits 3-0: network id
33
+ ; shelley payment addresses:
34
+ ; bit 7: 0
35
+ ; bit 6: base/other
36
+ ; bit 5: pointer/enterprise [for base: stake cred is keyhash/scripthash]
37
+ ; bit 4: payment cred is keyhash/scripthash
38
+ ; bits 3-0: network id
40
39
;
41
- ; reward addresses:
42
- ; bits 7-5: 111
43
- ; bit 4: credential is keyhash/scripthash
44
- ; bits 3-0: network id
40
+ ; reward addresses:
41
+ ; bits 7-5: 111
42
+ ; bit 4: credential is keyhash/scripthash
43
+ ; bits 3-0: network id
45
44
;
46
- ; byron addresses:
47
- ; bits 7-4: 1000
45
+ ; byron addresses:
46
+ ; bits 7-4: 1000
47
+ ;
48
+ ; 0000: base address: keyhash28,keyhash28
49
+ ; 0001: base address: scripthash28,keyhash28
50
+ ; 0010: base address: keyhash28,scripthash28
51
+ ; 0011: base address: scripthash28,scripthash28
52
+ ; 0100: pointer address: keyhash28, 3 variable length uint
53
+ ; 0101: pointer address: scripthash28, 3 variable length uint
54
+ ; 0110: enterprise address: keyhash28
55
+ ; 0111: enterprise address: scripthash28
56
+ ; 1000: byron address
57
+ ; 1110: reward account: keyhash28
58
+ ; 1111: reward account: scripthash28
59
+ ; 1001-1101: future formats
48
60
;
49
- ; 0000: base address: keyhash28,keyhash28
50
- ; 0001: base address: scripthash28,keyhash28
51
- ; 0010: base address: keyhash28,scripthash28
52
- ; 0011: base address: scripthash28,scripthash28
53
- ; 0100: pointer address: keyhash28, 3 variable length uint
54
- ; 0101: pointer address: scripthash28, 3 variable length uint
55
- ; 0110: enterprise address: keyhash28
56
- ; 0111: enterprise address: scripthash28
57
- ; 1000: byron address
58
- ; 1110: reward account: keyhash28
59
- ; 1111: reward account: scripthash28
60
- ; 1001 - 1101: future formats
61
61
address = h'001000000000000000000000000000000000000000000000000000000011000000000000000000000000000000000000000000000000000000'
62
62
/ h'102000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000'
63
63
/ h'203000000000000000000000000000000000000000000000000000000033000000000000000000000000000000000000000000000000000000'
@@ -106,6 +106,17 @@ bootstrap_witness = [public_key : $vkey
106
106
, chain_code : bytes .size 32
107
107
, attributes : bytes]
108
108
109
+ ; The real bounded_bytes does not have this limit. it instead has
110
+ ; a different limit which cannot be expressed in CDDL.
111
+ ;
112
+ ; The limit is as follows:
113
+ ; - bytes with a definite-length encoding are limited to size 0..64
114
+ ; - for bytes with an indefinite-length CBOR encoding, each chunk is
115
+ ; limited to size 0..64
116
+ ; ( reminder: in CBOR, the indefinite-length encoding of
117
+ ; bytestrings consists of a token #2.31 followed by a sequence
118
+ ; of definite-length encoded bytestrings and a stop code )
119
+ ;
109
120
bounded_bytes = bytes .size (0 .. 64)
110
121
111
122
certificate = [stake_registration
@@ -151,6 +162,9 @@ datum_hash = $hash32
151
162
152
163
datum_option = [0, $hash32 // 1, data]
153
164
165
+ ; A type for distinct values.
166
+ ; The type parameter must support .size, for example: bytes or uint
167
+ ;
154
168
distinct_VBytes = bytes .size 8
155
169
/ bytes .size 16
156
170
/ bytes .size 20
@@ -348,6 +362,8 @@ relay = [single_host_addr // single_host_name // multi_host_name]
348
362
349
363
required_signers = nonempty_set<addr_keyhash>
350
364
365
+ ; reward_account = bytes
366
+ ;
351
367
reward_account = h'E090000000000000000000000000000000000000000000000000000000'
352
368
/ h'F0A0000000000000000000000000000000000000000000000000000000'
353
369
@@ -495,6 +511,21 @@ transaction_witness_set = {? 0 : nonempty_set<vkeywitness>
495
511
, ? 6 : nonempty_set<plutus_v2_script>
496
512
, ? 7 : nonempty_set<plutus_v3_script>}
497
513
514
+ ; The real unit_interval is: #6.30([uint, uint])
515
+ ;
516
+ ; A unit interval is a number in the range between 0 and 1, which
517
+ ; means there are two extra constraints:
518
+ ; 1. numerator <= denominator
519
+ ; 2. denominator > 0
520
+ ;
521
+ ; The relation between numerator and denominator can be
522
+ ; expressed in CDDL, but we have a limitation currently
523
+ ; (see: https://github.com/input-output-hk/cuddle/issues/30)
524
+ ; which poses a problem for testing. We need to be able to
525
+ ; generate random valid data for testing implementation of
526
+ ; our encoders/decoders. Which means we cannot use the actual
527
+ ; definition here and we hard code the value to 1/2
528
+ ;
498
529
unit_interval = #6.30([1, 2])
499
530
500
531
url = text .size (0 .. 128)
0 commit comments