Skip to content

Commit 17ab8ab

Browse files
committed
docs(docs): WIP
1 parent cdd85b8 commit 17ab8ab

27 files changed

+874
-137
lines changed

docs/src/architecture/08_concepts/signed_doc/cddl/chain.cddl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ height = int
2626

2727
; Reference to a single Signed Document
2828
document_ref = [
29-
document_id,
30-
document_ver,
29+
document_id
30+
document_ver
3131
document_locator
3232
]
3333

docs/src/architecture/08_concepts/signed_doc/cddl/choices.cddl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ clear-choice = int
1313

1414
; elgamal/ristretto255 Encrypted Choices
1515
elgamal-ristretto255-encrypted-choices = [
16-
[+ elgamal-ristretto255-encrypted-choice],
16+
[+ elgamal-ristretto255-encrypted-choice]
1717
? row-proof
1818
]
1919

2020
; The elgamal encrypted ciphertext `(c1, c2)`.
2121
elgamal-ristretto255-encrypted-choice = [
22-
c1: elgamal-ristretto255-group-element,
23-
c2: elgamal-ristretto255-group-element,
22+
c1: elgamal-ristretto255-group-element
23+
c2: elgamal-ristretto255-group-element
2424
]
2525

2626
; An individual Elgamal group element that composes the elgamal cipher text.

docs/src/architecture/08_concepts/signed_doc/cddl/contest_ballot_checkpoint.cddl

Lines changed: 86 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
; Catalyst Ballot Checkpoint data object.
22
;
33
; This serves as a checkpoint that collects new `contest-ballot-payload` documents
4-
; that have been observed by a bulleting board.
4+
; that have been observed by a bulletin board.
55
;
66
; It will be created periodically during the voting period to allow proofs of inclusion
77
; to be firmly anchored and repeatably verifiable, and to allow voters or auditors to confirm
@@ -14,10 +14,22 @@
1414

1515
; Catalyst Ballot Checkpoint Payload data object.
1616
contest-ballot-checkpoint = {
17-
"smt-root" : smt-root,
18-
"smt-entries" : smt-entries,
17+
"stage" : stage
18+
"smt-root" : smt-root
19+
"smt-entries" : smt-entries
20+
? "rejections" : rejections
21+
? "encrypted-tally" : encrypted-tally
22+
? "tally" : tally
23+
? "drep-encryption-key" : drep-encryption-key
1924
}
2025

26+
; What stage in the ballot processing does this checkpoint represent.
27+
stage = (
28+
"bulletin-board" /
29+
"tally" /
30+
"audit"
31+
)
32+
2133
; The SMT Root hash is a Blake 3 256bit digest Hash.
2234
smt-root = blake3
2335

@@ -26,3 +38,74 @@ blake3 = #6.32781(bytes)
2638

2739
; The Count of all Documents held by the SMT.
2840
smt-entries = uint
41+
42+
; List of documents rejected at this checkpoint, grouped by reason.
43+
rejections = {
44+
+ rejection-reason => [ + document_ref ]
45+
}
46+
47+
; The reason a document was rejected at this checkpoint.
48+
rejection-reason = (
49+
"already-voted" / ; Used to indicate a voter already voted in another system (ie, Jormungandr)
50+
"obsolete-vote" ; Used to indicate a vote that was cast was replaced with a newer vote.
51+
)
52+
53+
; Reference to a single Signed Document
54+
document_ref = [
55+
document_id
56+
document_ver
57+
document_locator
58+
]
59+
60+
; Document ID
61+
document_id = uuid_v7
62+
63+
; UUIDv7
64+
uuid_v7 = #6.37(bytes .size 16)
65+
66+
; Document Version
67+
document_ver = uuid_v7
68+
69+
; Where a document can be located, must be a unique identifier.
70+
document_locator = {
71+
"cid" : cid
72+
}
73+
74+
; IPLD content identifier.
75+
; Currently limited to SHA2-256 based CIDs.
76+
cid = #6.42(bytes .abnfb ("cid" .det cbor-cid ))
77+
78+
; CIDv1 ABNF Constrained for SHA2-256
79+
cbor-cid = '
80+
cid = cidv1 codec-cbor sha2-256 digest-32 digest
81+
cidv1 = %x00 %x01
82+
codec-cbor = %x51
83+
sha2-256 = %x12
84+
digest-32 = %x20
85+
digest = 32(%x00-FF)
86+
'
87+
88+
; Placeholder of encrypted tally result.
89+
encrypted-tally = {
90+
+ document_ref => encrypted-tally-proposal-result
91+
}
92+
93+
; Placeholder of encrypted tally result.
94+
encrypted-tally-proposal-result = [ 1, undefined ]
95+
96+
; Placeholder of encrypted tally result.
97+
tally = {
98+
+ document_ref => tally-proposal-result
99+
}
100+
101+
; Placeholder of encrypted tally result.
102+
tally-proposal-result = [ 0, { + clear-choice : voting-power } ]
103+
104+
; Universal Unencrypted Choice
105+
clear-choice = int
106+
107+
; Voting Power.
108+
voting-power = int
109+
110+
; Placeholder of drep encryption key.
111+
drep-encryption-key = undefined

docs/src/architecture/08_concepts/signed_doc/cddl/contest_ballot_payload.cddl

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@
55

66
; Catalyst Vote Payload data object.
77
contest-ballot-payload = {
8-
+ document_ref => choices,
9-
? "column-proof" : column-proof,
10-
? "matrix-proof" : matrix-proof,
11-
? "voter-choice" : voter-choice,
8+
+ document_ref => choices
9+
? "column-proof" : column-proof
10+
? "matrix-proof" : matrix-proof
11+
? "voter-choice" : voter-choice
1212
}
1313

1414
; Reference to a single Signed Document
1515
document_ref = [
16-
document_id,
17-
document_ver,
16+
document_id
17+
document_ver
1818
document_locator
1919
]
2020

@@ -58,14 +58,14 @@ clear-choice = int
5858

5959
; elgamal/ristretto255 Encrypted Choices
6060
elgamal-ristretto255-encrypted-choices = [
61-
[+ elgamal-ristretto255-encrypted-choice],
61+
[+ elgamal-ristretto255-encrypted-choice]
6262
? row-proof
6363
]
6464

6565
; The elgamal encrypted ciphertext `(c1, c2)`.
6666
elgamal-ristretto255-encrypted-choice = [
67-
c1: elgamal-ristretto255-group-element,
68-
c2: elgamal-ristretto255-group-element,
67+
c1: elgamal-ristretto255-group-element
68+
c2: elgamal-ristretto255-group-element
6969
]
7070

7171
; An individual Elgamal group element that composes the elgamal cipher text.

docs/src/architecture/08_concepts/signed_doc/cddl/document_ref.cddl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
; Reference to a single Signed Document
55
document_ref = [
6-
document_id,
7-
document_ver,
6+
document_id
7+
document_ver
88
document_locator
99
]
1010

docs/src/architecture/08_concepts/signed_doc/cddl/document_refs.cddl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ document_refs = [ 1* document_ref ]
66

77
; Reference to a single Signed Document
88
document_ref = [
9-
document_id,
10-
document_ver,
9+
document_id
10+
document_ver
1111
document_locator
1212
]
1313

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
; Placeholder to store the drep encryption key so drep votes can be decrypted if required.
2+
; Placeholder until formally defined.
3+
4+
5+
; Placeholder of drep encryption key.
6+
drep-encryption-key = undefined

docs/src/architecture/08_concepts/signed_doc/cddl/elgamal_ristretto255_encrypted_choice.cddl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
; The elgamal encrypted ciphertext `(c1, c2)`.
55
elgamal-ristretto255-encrypted-choice = [
6-
c1: elgamal-ristretto255-group-element,
7-
c2: elgamal-ristretto255-group-element,
6+
c1: elgamal-ristretto255-group-element
7+
c2: elgamal-ristretto255-group-element
88
]
99

1010
; An individual Elgamal group element that composes the elgamal cipher text.

docs/src/architecture/08_concepts/signed_doc/cddl/elgamal_ristretto255_encrypted_choices.cddl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@
1414

1515
; elgamal/ristretto255 Encrypted Choices
1616
elgamal-ristretto255-encrypted-choices = [
17-
[+ elgamal-ristretto255-encrypted-choice],
17+
[+ elgamal-ristretto255-encrypted-choice]
1818
? row-proof
1919
]
2020

2121
; The elgamal encrypted ciphertext `(c1, c2)`.
2222
elgamal-ristretto255-encrypted-choice = [
23-
c1: elgamal-ristretto255-group-element,
24-
c2: elgamal-ristretto255-group-element,
23+
c1: elgamal-ristretto255-group-element
24+
c2: elgamal-ristretto255-group-element
2525
]
2626

2727
; An individual Elgamal group element that composes the elgamal cipher text.
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
; The Result of an encrypted tally.
2+
; Placeholder until formally defined.
3+
4+
5+
; Placeholder of encrypted tally result.
6+
encrypted-tally = {
7+
+ document_ref => encrypted-tally-proposal-result
8+
}
9+
10+
; Reference to a single Signed Document
11+
document_ref = [
12+
document_id
13+
document_ver
14+
document_locator
15+
]
16+
17+
; Document ID
18+
document_id = uuid_v7
19+
20+
; UUIDv7
21+
uuid_v7 = #6.37(bytes .size 16)
22+
23+
; Document Version
24+
document_ver = uuid_v7
25+
26+
; Where a document can be located, must be a unique identifier.
27+
document_locator = {
28+
"cid" : cid
29+
}
30+
31+
; IPLD content identifier.
32+
; Currently limited to SHA2-256 based CIDs.
33+
cid = #6.42(bytes .abnfb ("cid" .det cbor-cid ))
34+
35+
; CIDv1 ABNF Constrained for SHA2-256
36+
cbor-cid = '
37+
cid = cidv1 codec-cbor sha2-256 digest-32 digest
38+
cidv1 = %x00 %x01
39+
codec-cbor = %x51
40+
sha2-256 = %x12
41+
digest-32 = %x20
42+
digest = 32(%x00-FF)
43+
'
44+
45+
; Placeholder of encrypted tally result.
46+
encrypted-tally-proposal-result = [ 1, undefined ]

0 commit comments

Comments
 (0)