Developer documentation
Verify it yourself
The protocol lives in isolated, dependency-light TypeScript modules you can run anywhere.
Modules
lib/protocol/encoding.ts— domain-separated hashing and byte encoding.lib/protocol/commitments.ts— credentials, commitments, nullifiers, parsing.lib/protocol/merkle.ts— snapshot roots, inclusion proofs.lib/protocol/randomness.ts— seed commitments, randomness, unbiased winner selection.lib/protocol/claims.ts— claim verification and payout binding.lib/protocol/treasury.ts— ledger reconciliation and prize tier math.lib/protocol/draw-verification.ts— full re-derivation of a completed draw.
Verify a draw
import { verifyDraw } from './lib/protocol/draw-verification'
// A published draw object (snapshot, seed, beacon, winners)
const draw = JSON.parse(await readFile('ZV-0001.json', 'utf8'))
const report = verifyDraw(draw)
console.log(report.overall) // "verified" | "failed" | "pending"
for (const check of report.checks) console.log(check.label, check.status)Create an entry credential
import { createCredential, computeCommitment } from './lib/protocol/commitments'
const credential = createCredential('ZV-0003') // uses a CSPRNG
const memo = `ZV1:${credential.drawId}:${computeCommitment(credential)}`
// Send the entry amount from your shielded wallet with this memo.
// Store `credential` offline. It is the only way to claim.Run the test suite
pnpm testTests cover commitment binding, nullifier uniqueness, Merkle proof tampering, seed-commitment mismatch, winner selection determinism and distinctness, claim replay rejection, transparent-address rejection, and treasury discrepancy detection.
Read API
The planned public API serves the same raw draw objects shown on the Proof Explorer. Every field needed to recompute a result is included; no field contains participant identity.