Skip to content

Commit 68633d9

Browse files
committed
wip
1 parent 8a2d6b2 commit 68633d9

File tree

3 files changed

+13
-25
lines changed

3 files changed

+13
-25
lines changed

docs/src/architecture/08_concepts/catalyst_voting/transaction.md

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -121,25 +121,14 @@ Expected witness (includes signature)
121121
### v2
122122

123123
<!-- markdownlint-disable max-one-sentence-per-line code-block-style -->
124-
??? note "V2 vote transaction definition: `tx_v1.abnf`"
124+
??? note "V2 vote transaction definition: `tx_v2.cddl`"
125125

126126
```CDDL
127127
{{ include_file('src/architecture/08_concepts/catalyst_voting/tx_v2.cddl', indent=4) }}
128128
```
129129
<!-- markdownlint-enable max-one-sentence-per-line code-block-style -->
130130

131-
`event_info` - a set of different identifiers which is uniquely define a particular voting event.
132-
133-
Vote info:
134-
135-
* `brand_id` - a unique identifier which represents a "brand" who is running the voting,
136-
e.g. Catalyst, Midnight.
137-
* `campaign_id` - a unique identifier which defines a "campaign" of voting,
138-
e.g. "treasury campaign".
139-
* `event_id` - a unique identifier which defines an event of voting,
140-
e.g. "Catalyst Fund 1", "Catalyst Fund 2".
141-
* `category_id` - a unique identifier which defines a voting category as a collection of proposals,
142-
e.g. "Development & Infrastructure", "Products & Integrations".
131+
`event` - a set of different identifiers which is uniquely define a particular voting event.
143132

144133
Vote:
145134

@@ -172,7 +161,7 @@ As mentioned earlier, the content type of the [COSE] signature payload is `appli
172161
In particular it must be a [CBOR] encoded [BLAKE2b-256] hash bytes:
173162

174163
```CDDL
175-
payload = #6.32782(bytes .size 32)
164+
{{ include_file('src/architecture/08_concepts/catalyst_voting/tx_v2_cose_payload.cddl') }}
176165
```
177166

178167
## Rationale

docs/src/architecture/08_concepts/catalyst_voting/tx_v2.cddl

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,23 @@ vote_tx = [
44
]
55

66
vote_tx_body = [
7-
event_info,
7+
vote_type: UUID ; e.g. Public or Private vote
8+
event,
89
votes,
910
voters_data: encoded_cbor
1011
]
1112

12-
event_info = [+ UUID]
13-
vote_info = {
14-
brand_id: UUID, ; e.g. Midnight, Catalyst etc.
15-
campaign_id: UUID, ; e.g. treasury campaign
16-
event_id: UUID, ; e.g. Fund 1, Fund 2 etc.
17-
category_id: UUID,
18-
; vote_type: UUID, ; e.g. Public or Private vote
19-
}
13+
event = { * event_key => any }
14+
event_key = int / tstr
2015

2116
votes = [+ vote]
2217
vote = [
23-
choice: encoded-cbor,
18+
choices: encoded-cbor,
2419
proof: encoded-cbor / null,
25-
prop_id: UUID / null,
20+
prop_id: encoded-cbor / null,
2621
]
22+
choices = [+ choice]
23+
choice = encoded-cbor
2724

2825
UUID = #6.37(bytes) ; UUID type
2926
signature = #6.98(COSE_Sign) ; COSE signature
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
cose_payload = Blake2b-256
2+
Blake2b-256 = #6.32782(bytes .size 32) ; Blake2b-256 hash bytes

0 commit comments

Comments
 (0)