specs/voting/shared/v0_1/voting library

Classes

Answer
The answer to one question. Exactly one member besides question is present, matching the question's type, or abstain for an optional question left unanswered.
Ballot
An open ballot: one answer per question of the manifest, in any order. The bytes a cast's proof binds are the RFC 8785 (JCS) canonicalization of this object as received.
BoardHead
A board's tree head (RFC 9162 §2.1). A head is signed by being carried in a document the ballot box signs; whoever keeps a head keeps that whole document.
Cast
A ballot and the PCS attestation that admits it (VTI-VOT-030). attestation is the suite's canonical encoding of the attestation made for the election point with the ballot context bound in (CONVENTIONS §3); tag repeats its tag so a ballot box can refuse a duplicate before the pairing check.
Disclosure
The statement a community publishes, and shows a member before they request a ticket, about how one election is run (VTI-VOT-090). Generated from the election's manifest and the community's configuration, never written by hand.
ElectionResult
An election's result, computable by anyone who can read its board from the board and the registration alone (VTI-VOT-070).
ElectionSummary
A ballot box's view of one election.
Manifest
What an election asks and how it is decided (VTI-VOT-010). Its digest (manifestDigest) is the SHA-256 multihash of its RFC 8785 (JCS) canonicalization, and every cast is bound to it (VTI-VOT-011).
ManifestBoard
ManifestBoard, generated from its schema.
QuestionOption
QuestionOption
QuestionResult
One question's totals. choice: selections per option. ranking: per option, how many ballots placed it at each position (index 0 = first). score: per option, the sum and the number of ballots that scored it. text: the answers, in board order, withheld (withheld: true) below the manifest's textReleaseThreshold. abstained counts ballots that left the question unanswered.
QuestionResultScoreValue
QuestionResultScoreValue, generated from its schema.
RollRule
Who may be issued a ticket (VTI-VOT-021): the community's active members, its active members and the parties listed names, or only the parties listed names.
Trustees
The trustees of a sealed or tallied-encrypted election and the number of them decryption needs (VTI-VOT-062). Neither the community nor the ballot box may be one.
VotingParameters
The community's published voting parameters: the PCS suite and the voting verification key tickets are issued under (VTI-VOT-020). Distinct from its hidden-vetting helper key.

Extension Types

BoardVisibility
public: anyone reads the board. private: the community, the auditors the manifest names and, for one cast's inclusion, the holder of its receipt (VTI-VOT-052).
ElectionState
ElectionState is a closed set of string values defined by this specification's schema.
Revote
What a later, different ballot under one ticket does: replace the earlier one, or be refused (refuse) (VTI-VOT-041).
RollRuleRule
RollRuleRule is a closed set of string values defined by this specification's schema.
SecrecyLevel
open: ballots are recorded on the board as cast. sealed: ballots are encrypted to a jointly generated election key and decrypted after voting closes. talliedEncrypted: ballots are encrypted and only the totals are ever decrypted (VTI-VOT-060). Version 0.1 of the voting tasks carries open ballots only; a ballot box refuses to register any other level with voting/election/register:unsupportedSecrecy until the trustee tasks are specified.

Typedefs

BoardEntry = Object?
One leaf of a board. A leaf's hash is the RFC 9162 leaf hash of the JCS canonicalization of this object. Entries carry no time of arrival: the order is the board's, and a timestamp would hand anyone who reads the board the timing the registrar's log would need to pair a ticket with its cast.
DigestMultibase = String
A cryptographic digest as a multibase-encoded multihash — the encoding the W3C Verifiable Credentials Data Model 2.0 defines for digestMultibase, and the one did:webvh uses for its SCID and entry hashes. Multihash carries the hash algorithm in-band, so the value is self-describing and the wire format survives an algorithm change without a schema revision; multibase does the same for the base encoding, so a verifier never infers base58 from base64url by context. A bare hex string or a sha-256:-style prefix hard-codes one algorithm into the wire contract and is non-conforming here. This definition constrains the encoding only. What the digest is computed over is stated by each referencing field, because it differs legitimately: a digest over a JSON document is taken over its RFC 8785 (JCS) canonicalization, while a digest over an opaque artifact is taken over its bytes. A field whose input is a JSON document and which does not name a canonicalization is not reproducible. Restricted to the two multibase headers W3C Controlled Identifiers 1.0 §2.4 normatively requires — z (base58btc) and u (base64url-no-pad). CID permits others but states that "interoperability is not guaranteed between implementations using such values", and a registry whose purpose is interoperability should not mint digests a conforming verifier may be unable to read. The alphabets are enforced rather than assumed: base58btc excludes 0, O, I and l, and an earlier permissive pattern let three published examples carry digests that were not valid base58 at all. base58btc is RECOMMENDED, for consistency with did:key and did:webvh.
ElectionId = String
An election's identifier, unique within its community. A closed alphabet: it appears in the ticket class label voter/<electionId> and is framed into every hash a cast is bound to.
Key = String
A question or option key, unique within its manifest or question.
MerklePath = List<DigestMultibase>
An RFC 9162 audit or consistency path: the node hashes, in the order §2.1.3 / §2.1.4 define.
Multibase = String
A binary value, multibase base58btc over the suite's canonical (compressed) encoding.
Question = Object?
One question. Tagged union over type.