Skip to content

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 be null.
  • prop-id - a proposal id for which choice is made, could be null. For that case where for the event defined only one proposal, so it's redundant to provide an additional identifier for the proposal, so it could be placed null.

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:

cose-payload = blake2b-256
blake2b-256 = #6.32782(bytes .size 32) ; Blake2b-256 hash bytes

Rationale

Path to Active

Acceptance Criteria

Implementation Plan