Skip to content

Commit 06f11ec

Browse files
committed
wip
1 parent 9ed8ca2 commit 06f11ec

File tree

2 files changed

+47
-34
lines changed

2 files changed

+47
-34
lines changed

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

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,29 @@ Expected witness (includes signature)
128128
```
129129
<!-- markdownlint-enable max-one-sentence-per-line code-block-style -->
130130

131+
#### Transaction signing
132+
133+
[COSE] is used to define a transaction's signature structure.
134+
[COSE] is a flexible security protocol that supports various types of security messages.
135+
However, only `COSE Signed Data Object` or `COSE_Sign` type is used.
136+
137+
The following header must be included in the [COSE] signasture.
138+
139+
`protected`:
140+
* `content type`: `application/cbor`
141+
(this parameter is used to indicate the content type of the data in the payload or ciphertext fields).
142+
143+
Any other headers as `alg`, `kid` etc. could be specified of any kind and not defined by this spec.
144+
145+
##### Signature payload
146+
147+
As mentioned earlier, the content type of the [COSE] signature payload is `application/cbor`.
148+
In particular it must be a [CBOR] encoded [BLAKE2b-256] hash bytes:
149+
150+
```CDDL
151+
payload = #6.32782(bytes .size 32)
152+
```
153+
131154
## Rationale
132155

133156
## Path to Active
@@ -140,6 +163,8 @@ Expected witness (includes signature)
140163

141164
<!-- OPTIONAL SECTIONS: see CIP-0001 > Document > Structure table -->
142165

143-
[BLAKE2b-256]: https://www.blake2.net/blake2.pdf\
144-
[BLAKE2b-512]: https://www.blake2.net/blake2.pdf\
166+
[BLAKE2b-256]: https://www.blake2.net/blake2.pdf
167+
[BLAKE2b-512]: https://www.blake2.net/blake2.pdf
145168
[ristretto255]: https://ristretto.group
169+
[COSE]: https://datatracker.ietf.org/doc/rfc9052/
170+
[CBOR]: https://datatracker.ietf.org/doc/rfc8949/
Lines changed: 20 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,28 @@
11
vote_tx = [
2-
brand_id: UUID, ; e.g. Midnight, Catalyst etc.
3-
campaign_id: UUID, ; e.g. Fund 1, Fund 2 etc.
4-
event_id: UUID, ;
5-
category_id: UUID,
6-
vote_type: UUID,
7-
challenge_info,
2+
vote_tx_body,
3+
signature
4+
]
5+
6+
vote_tx_body = [
7+
vote_info,
88
votes,
99
voters_data: encoded_cbor
1010
]
1111

12-
votes = [+ vote]
13-
vote = (public_vote / private_vote)
14-
;---
15-
vote = [ choices, ? proof, ? prop_id ]
16-
choices = [ + choice ]
17-
choice = encoded-cbor
18-
;---
19-
20-
public_vote = [2* bool]
21-
; public_vote = [2* scalar]
22-
; public_vote = [2* bytes]
23-
private_vote = [2* (encrypted_vote, vote_proof)]
24-
25-
encrypted_vote = ciphertext
26-
vote_proof = ( [2* (announcement, ciphertext, r_response)], scalar)
27-
28-
ciphertext = (group_element, group_element)
29-
announcement = (group_element, group_element, group_element)
30-
r_response = (scalar, scalar, scalar)
31-
32-
; encrypted_vote = bytes
33-
; vote_proof = bytes
12+
vote_info = {
13+
brand_id: UUID, ; e.g. Midnight, Catalyst etc.
14+
campaign_id: UUID, ; e.g. treasury campaign
15+
event_id: UUID, ; e.g. Fund 1, Fund 2 etc.
16+
category_id: UUID,
17+
vote_type: UUID, ; e.g. Public or Private vote
18+
}
3419

35-
scalar = (bytes .size 32)
36-
group_element = (bytes .size 32)
20+
votes = [+ vote]
21+
vote = [
22+
choice: encoded-cbor,
23+
proof: encoded-cbor / null,
24+
prop_id: UUID / null,
25+
]
3726

3827
UUID = #6.37(bytes) ; UUID type
39-
40-
#6.24( bstr( biguint ) )
28+
signature = #6.98(COSE_Sign) ; COSE signature

0 commit comments

Comments
 (0)