Skip to content

Commit 98b274d

Browse files
committed
wip
1 parent 9e2d86e commit 98b274d

File tree

8 files changed

+47
-53
lines changed

8 files changed

+47
-53
lines changed

docs/src/architecture/08_concepts/catalyst_voting/cddl/tx.cddl renamed to docs/src/architecture/08_concepts/catalyst_voting/cddl/gen_vote_tx.cddl

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,28 @@ vote_tx = [
44
]
55

66
vote_tx_body = [
7-
vote_type: UUID ; e.g. Public or Private vote
7+
vote_type
88
event,
99
votes,
10-
voters_data: encoded_cbor
10+
voters_data,
1111
]
1212

13+
vote_type = UUID ; e.g. Public or Private vote
1314
event = { * event_key => any }
1415
event_key = int / text
1516

1617
votes = [+ vote]
1718
vote = [
18-
choices: encoded-cbor,
19-
proof: encoded-cbor,
20-
prop_id: encoded-cbor,
19+
choices,
20+
proof,
21+
prop_id,
2122
]
2223
choices = [+ choice]
2324
choice = encoded-cbor
25+
proof = encoded-cbor \ null
26+
prop_id = encoded-cbor \ null
27+
28+
voters_data = encoded-cbor
2429

2530
UUID = #6.37(bytes) ; UUID type
2631
signature = #6.98(COSE_Sign) ; COSE signature

docs/src/architecture/08_concepts/catalyst_voting/cddl/jorm_v2/choice.cddl

Lines changed: 0 additions & 7 deletions
This file was deleted.

docs/src/architecture/08_concepts/catalyst_voting/cddl/jorm_v2/proof.cddl

Lines changed: 0 additions & 10 deletions
This file was deleted.

docs/src/architecture/08_concepts/catalyst_voting/cddl/jorm_v2/prop_id.cddl

Lines changed: 0 additions & 4 deletions
This file was deleted.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
choice = #6.24(bstr(choice_data))
2+
proof = #6.24(bstr(proof_data)) \ null
3+
prop_id = #6.24(bstr(proposal)) \ null
4+
5+
6+
choice_data = public_choice / private_choice
7+
8+
public_choice = uint
9+
private_choice = ciphertext
10+
11+
ciphertext = [group_element, group_element]
12+
group_element = bytes .size 32
13+
14+
proposal = UUID
15+
16+
proof_data = zk_proof
17+
18+
zk_proof = [[+ (announcement, ciphertext, r-response)], scalar]
19+
20+
announcement = (group_element, group_element, group_element)
21+
ciphertext = (group_element, group_element)
22+
r-response = (scalar, scalar, scalar)
23+
24+
scalar = bytes .size 32
25+
group_element = bytes .size 32
26+

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ Project "Catalyst" requires a structure to keep people vote's data in the secure
2424
## Specification
2525

2626
<!-- markdownlint-disable max-one-sentence-per-line code-block-style -->
27-
??? note "vote transaction definition: `tx.cddl`"
27+
??? note "vote transaction definition: `gen_vote_tx.cddl`"
2828

2929
```CDDL
30-
{{ include_file('src/architecture/08_concepts/catalyst_voting/cddl/tx.cddl', indent=4) }}
30+
{{ include_file('src/architecture/08_concepts/catalyst_voting/cddl/gen_vote_tx.cddl', indent=4) }}
3131
```
3232
<!-- markdownlint-enable max-one-sentence-per-line code-block-style -->
3333

@@ -66,7 +66,7 @@ In particular it must be a [CBOR] encoded [BLAKE2b-256] hash bytes:
6666

6767
<!-- markdownlint-disable code-block-style -->
6868
```CDDL
69-
{{ include_file('src/architecture/08_concepts/catalyst_voting/cddl/tx_cose_payload.cddl') }}
69+
{{ include_file('src/architecture/08_concepts/catalyst_voting/cddl/get_vote_tx_cose_payload.cddl') }}
7070
```
7171
<!-- markdownlint-enable code-block-style -->
7272

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

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -124,34 +124,18 @@ defined on top the ["Generalized Vote Transaction"](./gen_vote_tx.md#specificati
124124

125125
Following that spec we need define a format of `choice`, `proof` and `prop_id`.
126126

127-
`jorm_v2/choice.cddl`:
128-
129-
<!-- markdownlint-disable code-block-style -->
130-
```cddl
131-
{{ include_file('src/architecture/08_concepts/catalyst_voting/cddl/jorm_v2/choice.cddl') }}
132-
```
133-
<!-- markdownlint-enable code-block-style -->
134-
135-
`jorm_v2/proof.cddl`:
136-
137-
<!-- markdownlint-disable code-block-style -->
138-
```cddl
139-
{{ include_file('src/architecture/08_concepts/catalyst_voting/cddl/jorm_v2/proof.cddl') }}
140-
```
141-
<!-- markdownlint-enable code-block-style -->
142-
143-
`jorm_v2/prop_id.cddl`:
144-
145-
<!-- markdownlint-disable code-block-style -->
146-
```cddl
147-
{{ include_file('src/architecture/08_concepts/catalyst_voting/cddl/jorm_v2/prop_id.cddl') }}
148-
```
149-
<!-- markdownlint-enable code-block-style -->
150-
151127
!!! note
152128

153129
If `choice` is a public one, `proof` **must** be `null`.
154130

131+
<!-- markdownlint-disable max-one-sentence-per-line code-block-style -->
132+
??? note "vote transaction v2 definition: `vote_tx_v2.cddl`"
133+
134+
```CDDL
135+
{{ include_file('src/architecture/08_concepts/catalyst_voting/cddl/vote_tx_v2.cddl', indent=4) }}
136+
```
137+
<!-- markdownlint-enable max-one-sentence-per-line code-block-style -->
138+
155139
#### Vote generation
156140

157141
To generate a cryptographically secured `private_choice` and `zk_proof` parts you can follow this [spec](./crypto.md#vote).

0 commit comments

Comments
 (0)