walkthrough
Narrative companion to the spec. Five flows, concrete scenarios, realistic addresses and block heights.
mental modelLink to this section
Every actor has one job. The creator publishes a poll. The voter publishes a ballot. The observer runs a function. Nobody trusts anybody; the math holds.
flow 1 — public sats-days weighted pollLink to this section
Alice coordinates Bitcoin grant recipients. They want to allocate $5k among three candidate projects. Non-binding signal, weighted by sats × days.
Alice: visits vote.ochk.io/create, enters question + 3 options, deadline
2026-05-08, weight_mode sats_days (cap 180 d), min_sats 100,000, min_days 30.
Signs once. URL at vote.ochk.io/p/<poll_id>.
Bob: opens the URL. Picks split_b. Signs once. His ballot lands on Nostr
kind 30081 under d = oc-vote:ballot:<poll_id>:<bob_addr>.
Bob changes his mind: picks split_c two days later. Same d-tag, higher
created_at. Relays keep both ballots, because each is signed with its own
Nostr key; the tally counts the later one because the poll's tiebreak is
latest.
After the deadline: the client resolves the snapshot block (H_close, the
greatest block with median_time_past ≤ deadline, once it has ≥ 6
confirmations). Any observer re-runs the tally function against the published
ballots + their own UTXO-source. Everyone gets the same numbers. The result says
basis: "voter_clocks": this poll's deadline is before 2026-11-15, so each
ballot was dated by its voter's own clock.
The same poll with a later deadline: a poll whose deadline is on or after
2026-11-15T00:00:00Z is anchored
(anchoring). Bob's client also stamps
his ballot with OC Stamp and sends the stamp id to OpenTimestamps calendars;
vote.ochk.io's anchorer stamps the ballots it sees, within its limits, as a
fallback. The tally checks each ballot's anchor against Bitcoin block headers
and counts only ballots anchored at or below H_close + G (G = 36 blocks).
Until the tallier's chain tip reaches H_close + G + 6 the result says
"state": "provisional" and how many counted ballots are not yet anchored;
after that it is "tallied" with "basis": "anchored".
flow 2 — one-per-address with high thresholdLink to this section
A Nostr community votes on a relay policy change. They want one-voter-one-vote
and to price out address splitting. They set weight_mode: one_per_address,
min_sats: 1_000_000, min_days: 90.
Attacker trying to manufacture 100 extra votes needs 100 × 1M sats × 90 days of opportunity cost — prohibitive for a relay-policy argument. Honest voters pay nothing.
flow 3 — secret ballotLink to this section
A DAO votes on a contentious treasury disbursement. Ballots hidden until close so whales can't influence smaller voters by casting early.
Alice (creator) generates an X25519 reveal keypair. reveal_pk goes in the
poll; reveal_sk stays local.
Bob encrypts "yes" into an OC Lock envelope addressed to reveal_pk,
commits to sha256("oc-vote/v0/commit\npoll_id:…\nvoter:…\noption:yes\n"), and
signs the ballot. Observers see Bob voted — but not what.
After the deadline Alice publishes reveal_sk as a kind-30082 event. In an
anchored poll talliers accept the reveal only once their chain tip reaches
H_close + G + 6, roughly eight hours after the deadline, so her client waits
until then. The tallier unseals every ballot, verifies each commit, and computes
the tally.
If Alice refuses to reveal, the poll is permanently abandoned. Participation is still provable; the tally is not. This is an honest trade-off — see secret ballot.
flow 4 — multi-address voterLink to this section
Charlie controls two addresses: bc1qcharlie1 (100k sat, 45 d old) and
bc1qcharlie2 (500k sat, 400 d old). He signs two ballots, one per address,
both yes. The tally treats them independently:
bc1qcharlie1: 100k × min(45, 180) = 4,500,000 sat-daysbc1qcharlie2: 500k × min(400, 180) = 90,000,000 sat-days
Total contribution to yes: 94,500,000 sat-days. Under the spec, splitting or
consolidating UTXOs after the snapshot doesn't change this. vote.ochk.io and the
CLI read UTXOs from mempool.space, which lists only coins unspent now, so there
a coin spent after the snapshot stops counting; /api/tally says so in its
utxo_source field.
flow 5 — disputeLink to this section
Dave thinks the poll page is lying. He runs:
npx -y @orangecheck/vote-cli tally <poll_id> --relay wss://my.relay --mempool-base https://my.esplora/api
The CLI pulls the poll + ballots from his own relay set, verifies every
signature, fetches UTXO state from his own Esplora instance (--mempool-base),
and prints the tally. If his numbers match the web page: Dave was wrong. If they
don't: the web page has a bug — file an issue with the diff. Correctness is
defined by the spec's pure tally function, not by any server.
anti-patterns we rejectedLink to this section
- Tokenized voting weight. Avoided — minting creates a walled garden.
- KYC / unique-humanity. Avoided — injects a gatekeeper.
- On-chain ballot posting. Avoided — would cost every voter a TX per ballot.
- Authority-signed voter roll. Avoided — centralizes trust.
- Tallier-as-a-service. Avoided — reintroduces the Snapshot trust problem.
how this composes with the familyLink to this section
- OC Attest — voters may reference an existing attestation in
ballot.attestation_idas a client hint. Authoritative check is always the UTXO snapshot. - OC Lock — every secret-mode ballot is an OC Lock envelope addressed to the
poll's
reveal_pk. The envelope format is unchanged. - OC Stamp — in an anchored poll, an OC Stamp over each ballot's
ballot_iddecides whether the ballot is in time. Separately, avote_resolvesenvelope can be stamped + OTS-anchored to give the resolved tally durable Bitcoin-block priority for archival. - OC Agent —
vote:cast(poll_id=…)is a registered agent scope, but a ballot counts only when itsvotersigned it: OC Vote v0 has no delegated ballots (spec §13, future work). An agent votes with its own address. - OC Pledge — a pledge can defer its dispute resolution to an OC Vote with a
pre-specified voter set + threshold via the
vote_resolvesmechanism. The vote becomes the authoritative resolver.
Six verbs of sovereign sociality — Vote is decide. Compose freely; no protocol depends on another at the wire level.