Skip to content

Commit b989ea4

Browse files
committed
update v2 tx spec
1 parent 9defe3c commit b989ea4

File tree

3 files changed

+57
-43
lines changed

3 files changed

+57
-43
lines changed

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

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -15,30 +15,14 @@ Created: 2024-09-04
1515

1616
## Abstract
1717

18-
This document defines a generalized view of the "Catalyst" voting transaction.
18+
This document defines a generalized voting transaction [CDDL] structure.
1919

2020
## Motivation
2121

2222
Project "Catalyst" requires a structure to keep people vote's data in the secure and verifiable way.
2323

2424
## Specification
2525

26-
Generalized vote transaction is a [Catalyst Signed Document],
27-
so its fully follows the structure of the [Catalyst Signed Document] specification.
28-
29-
* [`content type`](./../signed_doc/spec.md#content-type): `application/cbor`.
30-
[Catalyst Signed Document content](./../signed_doc/spec.md#signed-object-content) must be a [CBOR] encoded.
31-
32-
```CDDL
33-
3 => 50
34-
```
35-
36-
* [`content encoding`](./../signed_doc/spec.md#content-encoding-optional): is missing
37-
38-
### Content format
39-
40-
The generalized vote transaction [content format](./../signed_doc/spec.md#signed-object-content)
41-
4226
<!-- markdownlint-disable max-one-sentence-per-line code-block-style -->
4327
??? note "vote transaction definition: `gen_vote_tx.cddl`"
4428

@@ -70,5 +54,4 @@ Vote:
7054

7155
<!-- OPTIONAL SECTIONS: see CIP-0001 > Document > Structure table -->
7256

73-
[Catalyst Signed Document]: ./../signed_doc/spec.md
74-
[CBOR]: https://datatracker.ietf.org/doc/rfc8949/
57+
[CDDL]: https://datatracker.ietf.org/doc/html/rfc8610

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

Lines changed: 53 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,9 @@
1-
# V2
2-
31
---
4-
52
Title: Catalyst V2 Voting Transaction
6-
73
Status: Proposed
8-
94
Authors:
105
- Alex Pozhylenkov <[email protected]>
11-
126
Created: 2024-10-24
13-
147
---
158

169
## Abstract
@@ -21,12 +14,12 @@ This document describes a Catalyst V2 vote transaction structure.
2114

2215
## Specification
2316

24-
It is a Catalyst v2 voting transaction
25-
defined on top the ["Generalized Vote Transaction"](./gen_vote_tx.md#specification) structure.
17+
Catalyst v2 voting transaction is a [Catalyst Signed Document],
18+
so its fully follows the structure of the [Catalyst Signed Document] specification.
2619

27-
Following that spec need to define a `choice`, `proof` and `prop-id`.
20+
#### Metadata Fields
2821

29-
Also additional [Catalyst Signed Document protected header fields](./../signed_doc/spec.md#catalyst-signed-document-fields) are defined,
22+
A list of used [Catalyst Signed Document protected header fields](./../signed_doc/spec.md#signed-object-fields).
3023

3124
```CDDL
3225
"brand_id" => UUID, ; UUID v4
@@ -44,7 +37,35 @@ Also additional [Catalyst Signed Document protected header fields](./../signed_d
4437
* `category_id` - a unique identifier which defines a voting category as a collection of proposals,
4538
e.g. "Development & Infrastructure", "Products & Integrations".
4639

47-
### Public vote
40+
* [`content type`](./../signed_doc/spec.md#content-type): `application/cbor`.
41+
[Catalyst Signed Document content] must be a [CBOR] encoded.
42+
43+
```CDDL
44+
3 => 50
45+
```
46+
47+
* [`content encoding`](./../signed_doc/spec.md#content-encoding-optional): [Catalyst Signed Document content] must be [Brotli] compressed.
48+
49+
```CDDL
50+
"content-type" => "br"
51+
```
52+
53+
54+
##### Public vote
55+
56+
For the public vote [`type`](./../signed_doc/spec.md#type) value defined as follows:
57+
58+
* [`type`](./../signed_doc/spec.md#type): `8de5586c-e998-4b95-8742-7be3c8592803` [UUID] value.
59+
60+
```CDDL
61+
"type" => 37(h'8DE5586CE9984B9587427BE3C8592803')
62+
```
63+
64+
###### Content format
65+
66+
The public vote transaction [Catalyst Signed Document content] format is based on the [Generalized Vote Transaction Structure].
67+
68+
Following that spec need to define a `choice`, `proof` and `prop-id`.
4869

4970
<!-- markdownlint-disable max-one-sentence-per-line code-block-style -->
5071
??? note "Public vote transaction v2 definition: `vote_tx_v2_public.cddl`"
@@ -54,13 +75,21 @@ Also additional [Catalyst Signed Document protected header fields](./../signed_d
5475
```
5576
<!-- markdownlint-enable max-one-sentence-per-line code-block-style -->
5677

57-
For the public vote [`type`](./../signed_doc/spec.md#type) value defined as follows:
78+
##### Private vote
5879

59-
```CDDL
60-
vote-type = #6.37(h'8DE5586CE9984B9587427BE3C8592803') ; 8de5586c-e998-4b95-8742-7be3c8592803
61-
```
80+
For the private vote [`type`](./../signed_doc/spec.md#type) value defined as follows:
81+
82+
* [`type`](./../signed_doc/spec.md#type): `e78ee18d-f380-44c1-a852-80aa6ecb07fe` [UUID] value.
83+
84+
```CDDL
85+
"type" => 37(h'E78EE18DF38044C1A85280AA6ECB07FE')
86+
```
6287

63-
### Private vote
88+
###### Content format
89+
90+
The private vote transaction [Catalyst Signed Document content] format is based on the [Generalized Vote Transaction Structure].
91+
92+
Following that spec need to define a `choice`, `proof` and `prop-id`.
6493

6594
<!-- markdownlint-disable max-one-sentence-per-line code-block-style -->
6695
??? note "Private vote transaction v2 definition: `vote_tx_v2_private.cddl`"
@@ -70,13 +99,7 @@ vote-type = #6.37(h'8DE5586CE9984B9587427BE3C8592803') ; 8de5586c-e998-4b95-8742
7099
```
71100
<!-- markdownlint-enable max-one-sentence-per-line code-block-style -->
72101

73-
For the private vote [`type`](./../signed_doc/spec.md#type) value defined as follows:
74-
75-
```CDDL
76-
vote-type = #6.37(h'E78EE18DF38044C1A85280AA6ECB07FE') ; e78ee18d-f380-44c1-a852-80aa6ecb07fe
77-
```
78-
79-
#### Vote and Proof generation
102+
###### Vote and Proof generation
80103

81104
To generate a cryptographically secured `choice-data` and `zk_proof` parts you can follow this [spec](./crypto.md#vote).
82105
Important to note,
@@ -99,5 +122,11 @@ the following properties are used:
99122

100123
<!-- OPTIONAL SECTIONS: see CIP-0001 > Document > Structure table -->
101124

125+
[Catalyst Signed Document]: ./../signed_doc/spec.md
126+
[Catalyst Signed Document content]: ./../signed_doc/spec.md#signed-object-content
127+
[Generalized Vote Transaction Structure]: ./gen_vote_tx.md
102128
[BLAKE2b-512]: https://www.blake2.net/blake2.pdf
103129
[ristretto255]: https://ristretto.group
130+
[Brotli]: https://datatracker.ietf.org/doc/html/rfc7932
131+
[UUID]: https://www.rfc-editor.org/rfc/rfc9562.html
132+
[CBOR]: https://datatracker.ietf.org/doc/rfc8949/

docs/src/architecture/08_concepts/signed_doc/types.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
| 3e4808cc-c86e-467b-9702-d60baa9d1fca | `37(h'3e4808ccc86e467b9702d60baa9d1fca')` | Brand Parameters Document | [Brotli] Compressed [JSON] | *TBD* |
1515
| fd3c1735-80b1-4eea-8d63-5f436d97ea31 | `37(h'fd3c173580b14eea8d635f436d97ea31')` | Brand Parameters Template | [Brotli] Compressed [JSON Schema] | *TBD* |
1616
| 5e60e623-ad02-4a1b-a1ac-406db978ee48 | `37(h'5e60e623ad024a1ba1ac406db978ee48')` | Proposal Action Document | *TBD* | *TBD* |
17+
| 8de5586c-e998-4b95-8742-7be3c8592803 | `37(h'8DE5586CE9984B9587427BE3C8592803')` | Public Vote Tx V2 | [Brotli] Compressed [CBOR] | [Public Vote Tx V2 Spec](./../catalyst_voting/v2.md#public-vote) |
18+
| e78ee18d-f380-44c1-a852-80aa6ecb07fe | `37(h'E78EE18DF38044C1A85280AA6ECB07FE')` | Private Vote Tx V2 | [Brotli] Compressed [CBOR] | [Private Vote Tx V2 Spec](./../catalyst_voting/v2.md#private-vote) |
1719

1820

1921
[JSON Schema]: https://json-schema.org/draft-07

0 commit comments

Comments
 (0)