General Voting Transaction¶
Title: General Voting Transaction Structure
Status: Proposed
Authors: - Alex Pozhylenkov alex.pozhylenkov@iohk.io
Created: 2024-09-04
Abstract¶
This document defines a generalized view of the "Catalyst" voting transaction.
Motivation¶
Project "Catalyst" requires a structure to keep people vote's data in the secure way, anonymous and verifiable way.
Specification¶
vote transaction definition: gen_vote_tx.cddl
gen-vote-tx<choice-t, proof-t, prop-id-t> = [
tx-body<choice-t, proof-t, prop-id-t>,
signature
]
tx-body<choice-t, proof-t, prop-id-t> = [
vote-type
event,
votes<choice-t, proof-t, prop-id-t>,
voter-data,
]
vote-type = UUID ; e.g. Public or Private vote
event = { * event-key => any }
event-key = int / text
votes<choice-t, proof-t, prop-id-t> = [+ vote<choice-t, proof-t, prop-id-t>]
vote<choice-t, proof-t, prop-id-t> = [
choices<choice-t>,
proof<proof-t>,
prop-id<prop-id-t>,
]
choices<choice-t> = [+ choice<choice-t>]
choice<choice-t> = #6.24(bytes .cbor choice-t) ; encoded-cbor
proof<proof-t> = #6.24(bytes .cbor proof-t) ; encoded-cbor
prop-id<prop-id-t> = #6.24(bytes .cbor prop-id-t) ; encoded-cbor
voter-data = encoded-cbor
UUID = #6.37(bytes) ; UUID type
signature = #6.98(cose.COSE_Sign) ; COSE signature
;# import rfc9052 as cose
event
- a set of different identifiers which is uniquely define a particular voting event.
Vote:
choices
- a collection of voter choices for the proposal.proof
- a voter proof, could benull
.prop-id
- a proposal id for whichchoice
is made, could benull
. For that case where for theevent
defined only one proposal, so it's redundant to provide an additional identifier for the proposal, so it could be placednull
.
voter-data
- an any additional voter's specific data.
Transaction signing¶
COSE is used to define a transaction's signature structure.
COSE is a flexible security protocol that supports various types of security messages.
However, only COSE Signed Data Object
or COSE_Sign
type is used.
The following header must be included in the COSE signature.
protected
:
content type
:application/cbor
(this parameter is used to indicate the content type of the data in the payload or ciphertext fields).
Any other headers as alg
, kid
etc. could be specified of any kind and not defined by this spec.
Signature payload¶
As mentioned earlier, the content type of the COSE signature payload is application/cbor
.
In particular it must be a CBOR encoded BLAKE2b-256 hash bytes: