V2
Abstract¶
This document describes a Catalyst V2 vote transaction structure.
Motivation¶
Specification¶
Catalyst v2 voting transaction is a Catalyst Signed Document, so its fully follows the structure of the Catalyst Signed Document specification.
Metadata Fields¶
A list of used Catalyst Signed Document protected header fields.
content type
:application/cbor
. Catalyst Signed Document content must be a CBOR encoded.
content encoding
: Catalyst Signed Document content must be Brotli compressed.
Public vote¶
For the public vote type
value defined as follows:
Content format¶
The public vote transaction Catalyst Signed Document content format is based on the Generalized Vote Transaction Structure.
Following that spec need to define a choice
, proof
and prop-id
.
Public vote transaction v2 definition: vote_tx_v2_public.cddl
; All encoders/decoders of this specification must follow deterministic cbor encoding rules
; https://datatracker.ietf.org/doc/html/draft-ietf-cbor-cde-06
vote-tx-v2-public<voter-data-t> = gen-vote-tx<choice-data, proof-data, proposal, voter-data-t>
choice-data = uint
proof-data = undefined
proposal = UUID ; UUID v7
UUID = #6.37(bytes) ; UUID type
;# include gen_vote_tx
Private vote¶
For the private vote type
value defined as follows:
Content format¶
The private vote transaction Catalyst Signed Document content format is based on the Generalized Vote Transaction Structure.
Following that spec need to define a choice
, proof
and prop-id
.
Private vote transaction v2 definition: vote_tx_v2_private.cddl
; All encoders/decoders of this specification must follow deterministic cbor encoding rules
; https://datatracker.ietf.org/doc/html/draft-ietf-cbor-cde-06
vote-tx-v2<voter-data-t> = gen-vote-tx<choice-data, proof-data, proposal, voter-data-t>
choice-data = ciphertext
ciphertext = [group-element, group-element]
proposal = UUID ; UUID v7
proof-data = zk-proof
zk-proof = [[+ (announcement, ~ciphertext, r-response)], scalar]
announcement = (group-element, group-element, group-element)
r-response = (scalar, scalar, scalar)
scalar = bytes .size 32
group-element = bytes .size 32
UUID = #6.37(bytes) ; UUID type
;# include gen_vote_tx
Vote and Proof generation¶
To generate a cryptographically secured choice-data
and zk_proof
parts you can follow this spec.
Important to note,
that as part of initial setup of the voting procedure,
the following properties are used:
- Each proposal, defined by the
proposal
field, defines a number of possible options. - ristretto255 as a backend cryptographic group.
- A commitment key \(ck\) defined as a BLAKE2b-512 hash of the
proposal
bytes.