Skip to content

Commit 7f0639e

Browse files
committed
wip
1 parent e0b7815 commit 7f0639e

File tree

4 files changed

+24
-35
lines changed

4 files changed

+24
-35
lines changed

docs/src/architecture/08_concepts/catalyst_voting/cddl/Earthfile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,13 @@ check-cddl:
77

88
WORKDIR /cddl
99

10-
COPY ./gen_vote_tx.cddl ./vote_tx_v2.cddl ./gen_vote_tx_cose_payload.cddl .
10+
COPY ./gen_vote_tx.cddl \
11+
./vote_tx_v2_public.cddl \
12+
./vote_tx_v2_private.cddl \
13+
./gen_vote_tx_cose_payload.cddl \
14+
.
1115

1216
RUN cddlc -2 gen_vote_tx_cose_payload.cddl
1317
RUN cddlc -2 gen_vote_tx.cddl
14-
RUN cddlc -2 vote_tx_v2.cddl
18+
RUN cddlc -2 vote_tx_v2_public.cddl
19+
RUN cddlc -2 vote_tx_v2_private.cddl

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

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11
vote-tx-v2 = gen-vote-tx<choice-data, proof-data, proposal>
22

3-
choice-data = public-choice / private-choice
4-
5-
public-choice = uint
6-
private-choice = ciphertext
7-
3+
choice-data = ciphertext
84
ciphertext = [group-element, group-element]
9-
group-element = bytes .size 32
105

116
proposal = UUID
127

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,8 @@
1-
vote-tx-v2 = gen-vote-tx<choice-data, proof-data, proposal>
2-
3-
choice-data = public-choice / private-choice
4-
5-
public-choice = uint
6-
private-choice = ciphertext
7-
8-
ciphertext = [group-element, group-element]
9-
group-element = bytes .size 32
1+
vote-tx-v2-public = gen-vote-tx<choice-data, proof-data, proposal>
102

3+
choice-data = uint
4+
proof-data = undefined
115
proposal = UUID
126

13-
proof-data = zk-proof
14-
15-
zk-proof = [[+ (announcement, ~ciphertext, r-response)], scalar]
16-
17-
announcement = (group-element, group-element, group-element)
18-
r-response = (scalar, scalar, scalar)
19-
20-
scalar = bytes .size 32
21-
group-element = bytes .size 32
22-
237
;# include gen_vote_tx
248

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

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,22 +26,27 @@ defined on top the ["Generalized Vote Transaction"](./gen_vote_tx.md#specificati
2626

2727
Following that spec need to define a format of `choice`, `proof` and `prop_id`.
2828

29-
<!-- markdownlint-disable max-one-sentence-per-line -->
30-
!!! note
31-
32-
- If `choice` is *public* one, `proof` **must** be `null`.
33-
- If `choice` is *private* one, `proof` **must** be **not** `null`.
34-
<!-- markdownlint-disable max-one-sentence-per-line -->
29+
### Public vote
3530

3631
<!-- markdownlint-disable max-one-sentence-per-line code-block-style -->
37-
??? note "vote transaction v2 definition: `vote_tx_v2_public.cddl`"
32+
??? note "Public vote transaction v2 definition: `vote_tx_v2_public.cddl`"
3833

3934
```CDDL
4035
{{ include_file('src/architecture/08_concepts/catalyst_voting/cddl/vote_tx_v2_public.cddl', indent=4) }}
4136
```
4237
<!-- markdownlint-enable max-one-sentence-per-line code-block-style -->
4338

44-
### Vote generation
39+
### Private vote
40+
41+
<!-- markdownlint-disable max-one-sentence-per-line code-block-style -->
42+
??? note "Private vote transaction v2 definition: `vote_tx_v2_private.cddl`"
43+
44+
```CDDL
45+
{{ include_file('src/architecture/08_concepts/catalyst_voting/cddl/vote_tx_v2_private.cddl', indent=4) }}
46+
```
47+
<!-- markdownlint-enable max-one-sentence-per-line code-block-style -->
48+
49+
#### Vote generation
4550

4651
To generate a cryptographically secured `private_choice` and `zk_proof` parts you can follow this [spec](./crypto.md#vote).
4752
Important to note,

0 commit comments

Comments
 (0)