Skip to content
On this page

quickstart

Create a poll, cast a ballot, run a tally. No account. No chain transaction.

1. create a pollLink to this section

Visit /create (opens in a new tab). Enter:

  • your Bitcoin address (the creator)
  • the question and at least two options
  • a deadline (UTC)
  • a weight mode (sats, sats_days, or one_per_address)
  • thresholds: min_sats and min_days that a voter must clear for their ballot to count

In Sign it, your wallet prompts once for a BIP-322 signature over the poll's content-addressed id (or paste one from any wallet). Then Publish to the relays: the client publishes to Nostr kind 30080 across five default relays, and you land on the poll page at /p/<poll_id>.

2. cast a ballotLink to this section

Anyone with a Bitcoin address can vote. Open the poll URL. Pick an option, sign it (your wallet prompts once), and Publish the ballot. The client publishes to Nostr kind 30081 and says the ballot is in the count only once two relays, each asked on its own, serve it back; below that, Publish it again sends the same signed ballot. You can vote again until the deadline; relays keep every ballot, and the poll's tiebreak (latest or first) decides which counts.

3. verify the tallyLink to this section

The poll page recomputes the tally live against the current UTXO snapshot from mempool.space. To verify independently:

Shell
curl 'https://vote.ochk.io/api/tally?poll=<poll_id>'

You get a JSON object — the same shape any conforming implementation produces. The web UI is convenience. /api/tally, the CLI and your own tally() run the same pure function, so disputes are resolvable: see independent verification.

the libraryLink to this section

npm install @orangecheck/vote-core @orangecheck/bip322
TypeScript
import type { Ballot, Poll, Utxo } from '@orangecheck/vote-core';

import { verifySignature } from '@orangecheck/bip322';
import {
    mempoolBlockTimeSource,
    resolvePollSnapshot,
    tally,
} from '@orangecheck/vote-core';

// The event contents from Nostr (see Integration for the query).
declare const poll: Poll, ballots: Ballot[];
declare function fetchMyUtxos(addr: string, height: number): Promise<Utxo[]>;

const snap = await resolvePollSnapshot(poll, mempoolBlockTimeSource());
if (!snap.ok) throw new Error(`${snap.code}: ${snap.reason}`);

const result = await tally({
    poll,
    ballots,
    snapshotBlock: snap.height, // required when poll.snapshot_block is "deadline"
    utxosAt: (addr, height) => fetchMyUtxos(addr, height), // [{ value, confirmed_height }]
    verify: ({ address, message, signature }) =>
        verifySignature(address, message, signature),
});

For an anchored poll (deadline on or after 2026-11-15T00:00:00Z), also pass tipHeight, closeHeight and anchorHeight: see the tally algorithm.

Pure function. Same inputs → byte-identical output. tally() refuses to run without a signature verifier. The integration guide has a complete version that reads the poll and ballots from Nostr and UTXOs from mempool.space.

what you'll needLink to this section

  • a Bitcoin wallet that can sign BIP-322 messages: UniSat, Xverse, Leather, OKX, or Phantom. Or paste a signature from any offline signer.
  • a Bitcoin address with some UTXOs if you want your ballot to carry weight. The threshold the poll sets is the bar.

Nothing else. No signup. No KYC. No sats move.