Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Mr-Leshiy committed Oct 22, 2024
1 parent 8a2d6b2 commit 68633d9
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 25 deletions.
17 changes: 3 additions & 14 deletions docs/src/architecture/08_concepts/catalyst_voting/transaction.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,25 +121,14 @@ Expected witness (includes signature)
### v2

<!-- markdownlint-disable max-one-sentence-per-line code-block-style -->
??? note "V2 vote transaction definition: `tx_v1.abnf`"
??? note "V2 vote transaction definition: `tx_v2.cddl`"

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

`event_info` - a set of different identifiers which is uniquely define a particular voting event.

Vote info:

* `brand_id` - a unique identifier which represents a "brand" who is running the voting,
e.g. Catalyst, Midnight.
* `campaign_id` - a unique identifier which defines a "campaign" of voting,
e.g. "treasury campaign".
* `event_id` - a unique identifier which defines an event of voting,
e.g. "Catalyst Fund 1", "Catalyst Fund 2".
* `category_id` - a unique identifier which defines a voting category as a collection of proposals,
e.g. "Development & Infrastructure", "Products & Integrations".
`event` - a set of different identifiers which is uniquely define a particular voting event.

Vote:

Expand Down Expand Up @@ -172,7 +161,7 @@ As mentioned earlier, the content type of the [COSE] signature payload is `appli
In particular it must be a [CBOR] encoded [BLAKE2b-256] hash bytes:

```CDDL
payload = #6.32782(bytes .size 32)
{{ include_file('src/architecture/08_concepts/catalyst_voting/tx_v2_cose_payload.cddl') }}
```

## Rationale
Expand Down
19 changes: 8 additions & 11 deletions docs/src/architecture/08_concepts/catalyst_voting/tx_v2.cddl
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,23 @@ vote_tx = [
]

vote_tx_body = [
event_info,
vote_type: UUID ; e.g. Public or Private vote
event,
votes,
voters_data: encoded_cbor
]

event_info = [+ UUID]
vote_info = {
brand_id: UUID, ; e.g. Midnight, Catalyst etc.
campaign_id: UUID, ; e.g. treasury campaign
event_id: UUID, ; e.g. Fund 1, Fund 2 etc.
category_id: UUID,
; vote_type: UUID, ; e.g. Public or Private vote
}
event = { * event_key => any }
event_key = int / tstr

votes = [+ vote]
vote = [
choice: encoded-cbor,
choices: encoded-cbor,
proof: encoded-cbor / null,
prop_id: UUID / null,
prop_id: encoded-cbor / null,
]
choices = [+ choice]
choice = encoded-cbor

UUID = #6.37(bytes) ; UUID type
signature = #6.98(COSE_Sign) ; COSE signature
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
cose_payload = Blake2b-256
Blake2b-256 = #6.32782(bytes .size 32) ; Blake2b-256 hash bytes

0 comments on commit 68633d9

Please sign in to comment.