Skip to content

Commit 08da59c

Browse files
committed
Add namespaces
1 parent d896877 commit 08da59c

File tree

11 files changed

+997
-129
lines changed

11 files changed

+997
-129
lines changed

CIP-0165/namespaces/README.md

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,16 @@ This is directory of the supported namespaces.
44

55
Each namespace defines a non-intersecting slices of the data.
66

7-
| Shortname | Content | Key size |
8-
| --------- | ------------------------------- | -------- |
9-
| utxo | UTXOs | TxIn(transaction + offset) |
10-
| stake | Stake delegation | TBD |
11-
| rewards | Reward accounts | TBD |
12-
| params | Protocol parameters | TBD |
13-
| pots | Accounting pots (reserves etc.) | TBD |
14-
| stake_pools | Stake Pools State | TBD |
15-
| drep | DRep state | TBD |
16-
| gov | Governance action state | 0 |
17-
| hdr | Header state (e.g. nonces) | TBD |
7+
| Shortname | Content | Key size |
8+
| -------------------- | ------------------------------- | -------- |
9+
| blocks/v0 | Blocks created | 36 |
10+
| gov/committee/v0 | Governance action state | 8 |
11+
| gov/constitution/v0 | Constitution | 8 |
12+
| gov/pparams/v0 | Protocol parameters | 4 |
13+
| gov/proposals/v0 | Update proposals | 34 |
14+
| pool_stake/v0 | Stake delegation | 28 |
15+
| pots/v0 | Accounting pots (reserves etc.) | 8 |
16+
| snapshots/v0 | snapshots | 32 |
17+
| utxo/v0 | UTXOs | 34 |
18+
19+
Key specifications are describe in cddl specification comments.

CIP-0165/namespaces/blocks_v0.cddl

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
; This file was auto-generated from huddle. Please do not modify it directly!
2+
3+
; Values for the blocks.
4+
;
5+
; Key definition:
6+
;
7+
; ```
8+
; meta:
9+
; endian: be
10+
;
11+
; seq:
12+
; - id: key
13+
; type: blocks
14+
;
15+
; types:
16+
; block:
17+
; seq:
18+
; - id: keyhash_stakepool
19+
; doc: keyhash of the stake pool
20+
; size: 28
21+
; - id: epoch
22+
; doc: epoch
23+
; type: u8
24+
; ```
25+
record_entry = int
26+
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
; This file was auto-generated from huddle. Please do not modify it directly!
2+
3+
; The key for the namespace
4+
;
5+
; ```
6+
; meta:
7+
; endian: be
8+
;
9+
; seq:
10+
; - id: key
11+
; type: gov_committee
12+
;
13+
; types:
14+
; gov_committee:
15+
; seq:
16+
; - id: epoch
17+
; doc: epoch
18+
; type: u8
19+
; ```
20+
record_entry = committee
21+
22+
; Storage of the committee members
23+
committee = {* credential => committee_authorization}
24+
25+
credential = [0, addr_keyhash// 1, script_hash]
26+
27+
addr_keyhash = hash28
28+
29+
hash28 = bytes .size 28
30+
31+
; To compute a script hash, note that you must prepend
32+
; a tag to the bytes of the script before hashing.
33+
; The tag is determined by the language.
34+
; The tags in the Conway era are:
35+
; - "\x00" for multisig scripts
36+
; - "\x01" for Plutus V1 scripts
37+
; - "\x02" for Plutus V2 scripts
38+
; - "\x03" for Plutus V3 scripts
39+
script_hash = hash28
40+
41+
; 0 - hot committee member
42+
; 1 - resignation
43+
committee_authorization = [0, credential// 1, anchor/ nil]
44+
45+
;
46+
; Signed url
47+
anchor = [anchor_url : url, anchor_data_hash : bytes]
48+
49+
url = text .size (0 .. 128)
50+
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
; This file was auto-generated from huddle. Please do not modify it directly!
2+
3+
; Constinution record entry
4+
;
5+
; ```
6+
; meta:
7+
; endian: be
8+
;
9+
; seq:
10+
; - id: key
11+
; type: gov_constitution
12+
;
13+
; gov_constitution:
14+
; seq:
15+
; - id: epoch
16+
; doc: Current epoch.
17+
; type: u8
18+
; ```
19+
record_entry = constitution
20+
21+
; address of the constition
22+
constitution = [anchor, script_hash/ nil]
23+
24+
;
25+
; Signed url
26+
anchor = [anchor_url : url, anchor_data_hash : bytes]
27+
28+
url = text .size (0 .. 128)
29+
30+
; To compute a script hash, note that you must prepend
31+
; a tag to the bytes of the script before hashing.
32+
; The tag is determined by the language.
33+
; The tags in the Conway era are:
34+
; - "\x00" for multisig scripts
35+
; - "\x01" for Plutus V1 scripts
36+
; - "\x02" for Plutus V2 scripts
37+
; - "\x03" for Plutus V3 scripts
38+
script_hash = hash28
39+
40+
hash28 = bytes .size 28
41+
Lines changed: 172 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,172 @@
1+
; This file was auto-generated from huddle. Please do not modify it directly!
2+
3+
; Specification for parameters
4+
;
5+
; ```
6+
; meta:
7+
; endian: be
8+
;
9+
; seq:
10+
; - id: key
11+
; type: gov_pparams
12+
;
13+
; types:
14+
; gov_pparams:
15+
; seq:
16+
; - id: value
17+
; type: strz
18+
; size: 4
19+
; encoding: ASCII
20+
; - id: valiant
21+
; size: 0
22+
; type:
23+
; switch-on: value
24+
; cases:
25+
; '"prev"': kprev
26+
; '"curr"': kcurr
27+
; '"fut0"': kfut0
28+
; '"fut1"': kfut1
29+
; kprev:
30+
; doc: previous values
31+
; kcurr:
32+
; doc: current values
33+
; kfut0:
34+
; doc: possible future
35+
; kfut1:
36+
; doc: definitive future
37+
; ```
38+
;
39+
; fut0 with missig parameters should be omitted.
40+
record_entry = gov_pparams_out
41+
42+
; Governance protocol parameters
43+
; - min_fee_a: the linear factor for the minimum fee calculation
44+
; - min_fee_b: the constant factor for the minimum fee calculation
45+
; - max_block_size: maximal block body size in bytes
46+
; - max_block_header_size: maximal block header size in bytes
47+
; - max_tx_size: maximal transaction size in bytes
48+
; - key_deposit: The amount of a key registration deposit
49+
; - pool_deposit: The amount of a pool registration deposit
50+
; - epoch_max: epoch bound on pool retirement
51+
; - n_opt: desired number of pools
52+
; - a0: pool influence factor
53+
; - rho: monetary expansion
54+
; - tau: treasury expansion
55+
; - d: decentralisation parameter
56+
; - min_pool_cost: minimum pool cost
57+
; - min_utxo_value: Minimum Lovelace in a UTxO deprecated by AdaPerUTxOWord
58+
; - ada_per_utxo_byte: Cost in ada per 1 byte of UTxO storage instead of _coinsPerUTxOWord
59+
; - cost_models: Cost models for non-native script languages
60+
; - prices: Prices of execution units for non-native script languages
61+
; - max_tx_ex_units: Max total script execution resources units allowed per tx
62+
; - max_block_ex_units: Max total script execution resources units allowed per block
63+
; - max_value_size: Max size of a Value in an output
64+
; - collateral_percentage: The scaling percentage of the collateral relative to the fee
65+
; - max_collateral_inputs: Maximum number of collateral inputs allowed in a transaction
66+
gov_pparams_out =
67+
{ a0 : nonnegative_interval
68+
, rho : unit_interval
69+
, tau : unit_interval
70+
, n_opt : uint .size 2
71+
, prices : ex_unit_prices
72+
, epoch_max : epoch_interval
73+
, min_fee_a : coin
74+
, min_fee_b : coin
75+
, cost_models : cost_models
76+
, key_deposit : coin
77+
, max_tx_size : uint .size 4
78+
, drep_deposit : coin
79+
, pool_deposit : coin
80+
, min_pool_cost : coin
81+
, max_block_size : uint .size 4
82+
, max_val_size : uint .size 4
83+
, max_tx_ex_units : ex_units
84+
, protocol_version : protocol_version
85+
, coin_per_utxo_byte : coin
86+
, gov_action_deposit : coin
87+
, max_block_ex_units : ex_units
88+
, min_committee_size : uint .size 2
89+
, committee_term_limit : epoch_interval
90+
, collateral_percentage : uint .size 2
91+
, drep_voting_thresholds : drep_voting_thresholds
92+
, gov_action_lifetime : epoch_interval
93+
, max_block_header_size : uint .size 2
94+
, max_collateral_inputs : uint .size 2
95+
, pool_voting_thresholds : pool_voting_thresholds
96+
, drep_activity : epoch_interval
97+
}
98+
99+
100+
nonnegative_interval = #6.30([uint, positive_int])
101+
102+
positive_int = 1 .. 18446744073709551615
103+
104+
; NOTE: The real unit_interval is: #6.30([uint, uint])
105+
;
106+
; A unit interval is a number in the range between 0 and 1, which
107+
; means there are two extra constraints:
108+
; 1. numerator <= denominator
109+
; 2. denominator > 0
110+
unit_interval =
111+
#6.30([uint .le 18446744073709551615, uint .le 18446744073709551615])
112+
113+
ex_unit_prices =
114+
[mem_price : nonnegative_interval, step_price : nonnegative_interval]
115+
116+
epoch_interval = uint .size 4
117+
118+
coin = uint
119+
120+
; The format for cost_models is flexible enough to allow adding
121+
; Plutus built-ins and language versions in the future.
122+
;
123+
; Plutus v1: only 166 integers are used, but more are accepted (and ignored)
124+
; Plutus v2: only 175 integers are used, but more are accepted (and ignored)
125+
; Plutus v3: only 223 integers are used, but more are accepted (and ignored)
126+
;
127+
; Any 8-bit unsigned number can be used as a key.
128+
cost_models =
129+
{? 0 : [* int64], ? 1 : [* int64], ? 2 : [* int64], * 3 .. 255 => [* int64]}
130+
131+
int64 = -9223372036854775808 .. 9223372036854775807
132+
133+
ex_units = [mem : uint, steps : uint]
134+
135+
protocol_version = [major_protocol_version, uint]
136+
137+
major_protocol_version = uint
138+
139+
;
140+
; 0 - motion no confidence
141+
; 1 - committee normal
142+
; 2 - committee no confidence
143+
; 3 - update constitution
144+
; 4 - hard fork initiation
145+
; 5 - PP network group
146+
; 6 - PP economic group
147+
; 7 - PP technical group
148+
; 8 - PP governance group
149+
; 9 - treasury withdrawal
150+
drep_voting_thresholds =
151+
[ unit_interval
152+
, unit_interval
153+
, unit_interval
154+
, unit_interval
155+
, unit_interval
156+
, unit_interval
157+
, unit_interval
158+
, unit_interval
159+
, unit_interval
160+
, unit_interval
161+
]
162+
163+
164+
;
165+
; 0 - motion no confidence
166+
; 1 - committee normal
167+
; 2 - committee no confidence
168+
; 3 - hard fork initiation
169+
; 4 - security relevant parameter voting threshold
170+
pool_voting_thresholds =
171+
[unit_interval, unit_interval, unit_interval, unit_interval, unit_interval]
172+

0 commit comments

Comments
 (0)