Tx
The canonical transaction envelope. All protocol transactions share this envelope; theType field determines which Data payload struct to use.
DecodeTx
Tx envelope schema.
EncodeTx
Tx.Validate
Typemust be one of the fiveTxType*constantsSignaturemust be non-emptyDatamust be non-empty and valid JSON for the given type- Type-specific required fields are checked (e.g.,
poll_id, ZK fields for ballots)
state.ValidateTx.
Tx.UnmarshalData
tx.Data into the provided struct pointer. Use with the appropriate data type:
Data types
BallotCastData
The most complex payload. It supports both the preferred non-ZK tier and the high-assurance ZK tier.identity_hash from
SHA-256(voter_pub_key ‖ poll_id) after validating voter_sig and
didit_device_sig. In the ZK tier, the runtime uses zk_nullifier and
zk_nullifier_proof. Which fields are required depends on whether a ZK
verifier is loaded at startup.