diff --git a/docs/src/architecture/08_concepts/catalyst_voting/transaction.md b/docs/src/architecture/08_concepts/catalyst_voting/transaction.md index 3136742d09..c8626c3b26 100644 --- a/docs/src/architecture/08_concepts/catalyst_voting/transaction.md +++ b/docs/src/architecture/08_concepts/catalyst_voting/transaction.md @@ -121,25 +121,14 @@ Expected witness (includes signature) ### v2 -??? 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) }} ``` -`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: @@ -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 diff --git a/docs/src/architecture/08_concepts/catalyst_voting/tx_v2.cddl b/docs/src/architecture/08_concepts/catalyst_voting/tx_v2.cddl index 65c459ab89..2e472a7254 100644 --- a/docs/src/architecture/08_concepts/catalyst_voting/tx_v2.cddl +++ b/docs/src/architecture/08_concepts/catalyst_voting/tx_v2.cddl @@ -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 diff --git a/docs/src/architecture/08_concepts/catalyst_voting/tx_v2_cose_payload.cddl b/docs/src/architecture/08_concepts/catalyst_voting/tx_v2_cose_payload.cddl new file mode 100644 index 0000000000..01491ef25d --- /dev/null +++ b/docs/src/architecture/08_concepts/catalyst_voting/tx_v2_cose_payload.cddl @@ -0,0 +1,2 @@ +cose_payload = Blake2b-256 +Blake2b-256 = #6.32782(bytes .size 32) ; Blake2b-256 hash bytes \ No newline at end of file