Interface: JudgedTallyOptions
Defined in: vote-core/src/tally.ts:154 (opens in a new tab)
TallyOptions with a key-holder judge (3.1.0, OC Vote 0.4.0 SPEC §10 items
10–11), such as @orangecheck/keys keyHolderJudge(...).judge. The poll is
judged for creator with no evidence, which covers its reveal: refused,
tally throws E_KEY_HOLDER_REFUSED; unread, the result is
{ state: 'unread', poll: 'key_holder_unread' }. Each ballot is judged for
voter with its anchor height as anchoredAt in an anchored poll, no
evidence otherwise: a refused ballot is dropped, an unread one is pending
and never counted. A voter whose pending ballots could change its option is
left out of the count, and the result is named only if it holds whichever
of them are read (step 5a), with those voters listed under unread. A secret
poll needs unseal.
ExtendsLink to this section
Omit<TallyOptions,"keyHolder">
PropertiesLink to this section
| Property | Type | Description | Defined in |
|---|---|---|---|
anchorOf? | (anchorDigest: string) => number | Promise<number | null> | null | Anchored polls (SPEC §4.6) only, and required for them: the lowest block height at which the caller verified, against Bitcoin block headers, an OpenTimestamps anchor over a stamp whose content.hash is sha256:<anchorDigest> (OC Stamp §6.3, §7.2), or null when it has none. tally asks it only for copies whose signature verified, and a ballot takes the lowest answer over its copies. See anchorHeightFromStamps.Inherited from TallyOptions.anchorOf | vote-core/src/tally.ts:94 (opens in a new tab) |
ballots | Ballot[] | Every copy of every ballot read, not one per ballot_id. ballot_id leaves out sig.value, so copies with one id can carry different signatures; tally verifies each copy before it picks one ballot per voter. Collapse only byte-identical copies, with distinctBallotCopies.Inherited from TallyOptions.ballots | vote-core/src/tally.ts:41 (opens in a new tab) |
closeHeight? | number | null | Anchored polls (SPEC §4.6) only, and required for them: H_close, the greatest block whose median_time_past ≤ deadline, or null while no block's median_time_past has passed the deadline (the tally is then provisional). See resolveCloseBlock.Inherited from TallyOptions.closeHeight | vote-core/src/tally.ts:85 (opens in a new tab) |
keyHolder | KeyHolderJudge | Inherited from - | vote-core/src/tally.ts:155 (opens in a new tab) |
poll | Poll | Inherited from TallyOptions.poll | vote-core/src/tally.ts:34 (opens in a new tab) |
revealedOptions? | Record<string, string> | Deprecated Use unseal. A voter-keyed map cannot say WHICH of a voter's ballots it was unsealed from, so a caller that fills it from every relay ballot lets an unsigned ballot's envelope stand in for the voter's signed one. Ignored when unseal is supplied.Inherited from TallyOptions.revealedOptions | vote-core/src/tally.ts:71 (opens in a new tab) |
skipSignatures? | boolean | Skip BIP-322 checks entirely. Required to be EXPLICIT: tally throws when neither this nor a verifier is supplied, rather than quietly tallying unverified ballots. Intended for the spec-conformance harness, whose fixtures carry deliberately fake signatures.Inherited from TallyOptions.skipSignatures | vote-core/src/tally.ts:136 (opens in a new tab) |
snapshotBlock? | number | When poll.snapshot_block === 'deadline', the caller must pre-resolve the deadline to a concrete chain block height and pass it here. Important: do NOT mutate poll.snapshot_block to inject the resolved height. The poll's canonical bytes (and therefore pollId(poll)) include snapshot_block verbatim — overwriting "deadline" with a number changes the canonical form, changes the computed pollId, and causes the structural filter below (b.poll_id !== pid) to drop every ballot. Use this field instead.Inherited from TallyOptions.snapshotBlock | vote-core/src/tally.ts:54 (opens in a new tab) |
tipHeight? | number | Current chain tip height. When supplied, tally returns { state: 'deferred', code: 'E_REORG' } unless the snapshot block has at least 6 confirmations (SPEC §10.5), which also covers a snapshot that has not been mined. Required for an anchored poll.Inherited from TallyOptions.tipHeight | vote-core/src/tally.ts:78 (opens in a new tab) |
unseal? | (ballot: Ballot) => string | Promise<string | null> | null | Secret mode: recover the plaintext option id from a ballot's secret.envelope (SPEC §6.4 step 2). Called once per voter, and only on the ballot that survived signature checks and the tiebreak, so a relay cannot substitute another ballot's envelope for a voter; with keyHolder, also on each pending ballot that could stand for its voter (SPEC §8 step 2a). Return null or throw when the envelope does not open; the voter is then dropped.Inherited from TallyOptions.unseal | vote-core/src/tally.ts:64 (opens in a new tab) |
utxosAt | UtxoLookup | Inherited from TallyOptions.utxosAt | vote-core/src/tally.ts:42 (opens in a new tab) |
verify? | (args: { address: string; message: string; signature: string; }) => boolean | Promise<boolean> | Named-argument verifier. Preferred over verifyBip322 — an object literal cannot silently swap its fields the way three positional strings can. Takes precedence when both are supplied.Inherited from TallyOptions.verify | vote-core/src/tally.ts:125 (opens in a new tab) |
verifyBip322? | (address: string, message: string, signatureB64: string) => boolean | Promise<boolean> | POSITIONAL, and this package's order is (address, message, signature). BE CAREFUL. Every other package in the family — agent-core, lock-core, stamp-core, pledge-core, stamp-cli — declares this callback as (msg, signatureB64, address). vote-core is the lone outlier, and TypeScript cannot help you: both are (string, string, string) => Promise<boolean>, so passing a verifier written for a sibling package compiles cleanly and then verifies the wrong things. That is not hypothetical — it shipped in oc-vote-web, where every signature check silently passed garbage and the live tally counted forged ballots. Prefer verify below, which takes a named-argument object and therefore cannot be got wrong. This positional form is kept because changing its order would be a SILENTLY breaking change for existing callers: they would keep compiling and start verifying incorrectly, which is the worst possible way to break an API.Inherited from TallyOptions.verifyBip322 | vote-core/src/tally.ts:115 (opens in a new tab) |