Transaction type constants
Wire-format discriminators used inTx.Type. These are the only valid values;
any other value is rejected by tx.Tx.Validate.
| Constant | Value | Purpose |
|---|---|---|
TxTypePollCreate | 1 | Create a new poll |
TxTypeBallotCast | 2 | Cast an anonymous ballot |
TxTypePollClose | 3 | Close a poll and finalize the tally |
TxTypeRegisterValidator | 4 | Add or remove a consensus validator |
TxTypeConfirmReceipt | 5 | Voter confirms receipt post-close |
Voting method constants
| Constant | Value | Description |
|---|---|---|
VotingMethodPlurality | "plurality" | Voter selects exactly one option |
VotingMethodApproval | "approval" | Voter selects any non-empty subset |
VotingMethodRanked | "ranked" | Voter ranks options in preference order |
Poll
A poll definition in canonical state.VoteRecord (List 1)
An anonymous vote direction. No identity field.ballot_id = H(BallotNonce) is random and unlinkable to the voter’s identity_hash.
VoterRecord (List 2)
A verified participation record. No choice field.identity_hash = ZK nullifier = MiMC(person_secret, poll_id).
Tally
The finalized tally for a closed poll, including the managed tally signature for independent verification.verify.VerifyECDSA.
ConfirmRecord
Records that a voter acknowledged their receipt after poll close.state.State.confirms keyed as "pollID:identityHash".
Error types
| Type | When returned |
|---|---|
ErrorInvalidPoll | Poll not found, wrong status, or malformed parameters |
ErrorDuplicateVote | identity_hash already present in voterRegistry for this poll |