davinci-paper/v3-pq/spec.md
v3-pq/spec.mdRaw
1# DAVINCI v3-PQ — Post-Quantum Protocol Specification
2
3**Status:** draft v1.6 · 2026-11-10 · **audit round**: closes the gaps found by an
4independent audit of v1.5 and removes what v1.5 left without a consumer. Revoting is now
5**hidden writes** (§5.3, §8.4): a batch publishes its packages and its first-write slots,
6and nothing else about slots; which slot each package wrote travels only in a θ-gated
7encrypted write log. The blinded slot vectors, their blinding layers, the accumulator and
8the refresh sample of drafts ≤1.5 are **removed**, and with them the sampling rule, the
9coverage-history rule and the trust in a sequencer's decoy randomness. Census trees are
10**v2's, unchanged** (§8.2, §11): post-quantum voter keys live in a separate key map, and
11both census-conversion proofs of v1.5 are removed. Gaps closed: θ and the context
12parameters are public inputs of the ballot proof (§6); the tally roster is fixed by a
13**roster proof** and the session id is derived after it (§10.4); restart deadlines and
14timeouts are contract-decidable (§10.4); the CSP issuer key is pinned (§11); batch payload
15randomness is bound to the batch content (§8.5). Carries forward from v1.5: the direct
16share-sum tally (§10.1), early stage completion, account-authorized on-chain messages with
17SLH-DSA never verified on-chain, bundle-key share bundles, the ν=θ=1 fast path, named
18deadline profiles, the chunked-proving contract (§2.5); from earlier drafts: slot-overwrite
19revoting with no nullifiers and no revote budget, nf-sized packages, the Benaloh
20cast-as-intended audit, the unified Blake3 profile, per-warden column views (§8.7), early
21complaints with voter recovery (§9.2), ML-KEM-768-only transport.
22v2 remains the deployed protocol. **Review status, stated plainly:** every review round
23so far except one was run by AI reviewer agents under a single coordinator (a
24protocol-architect model for adversarial design review, a second model as independent
25verifier and auditor), not by third parties. Those rounds: three adversarial soundness
26rounds and five improvement design rounds on earlier drafts (one of which blocked a
27candidate quota design with a concrete attack); an audit of the integrated v1.5 text; for
28this revision, two adversarial design rounds on the change set, then one security read and
29one transcription-and-numbers audit of the integrated v1.6 text; three literature surveys
30including a 21-protocol comparison; and a reader-persona pass on the intuition section.
31The one exception is an external design review of an early draft (v1.1). No human
32cryptographer has reviewed v1.6; a consolidated external review and the Phase-0 gates
33(§15) stand between this document and implementation.
34**Annex A** reports measured proof-of-concept results (real GPU proving, gas) for the main
35cost drivers, and lists what is still extrapolated or unmeasured.
36**Audience:** engineers who already know [DAVINCI v2](https://spec.davinci.vote). This document only
37specifies what *changes*. Everything not mentioned here (settlement flow, grace window, blob
38verification via the point-evaluation precompile, census origins, sequencer lifecycle, process
39registry mechanics) works exactly as in v2 [DAV2].
40
41---
42
43## 1. Why v3, in one paragraph
44
45Every ballot DAVINCI v2 publishes in Ethereum blobs [EIP4844] is an ElGamal ciphertext over
46BabyJubjub. Published blob data can be archived by anyone indefinitely, and ElGamal falls to
47Shor's algorithm, so a future quantum computer decrypts **past elections retroactively**
48("harvest now, decrypt later"). Integrity is less urgent (a settled chain cannot be rewritten
49under Ethereum's finality assumptions), but **ballot privacy must be post-quantum today**.
50v3-PQ removes the quantum-vulnerable primitives from the ballot *confidentiality* path: no
51shared-key homomorphic encryption, no pairings, no DKG, no Groth16. Ballot secrecy rests on
52polynomial secret sharing, hashes, STARKs, and one NIST-standardized KEM (a post-quantum
53"public-key lockbox"; §2.4 defines all such terms plainly). The KEM is never
54proven inside the voter's circuit (the batch guest performs a few encapsulations per batch,
55and rare complaint proofs perform decapsulations; see §8.5, §9.2). During the hybrid period voter authentication
56still *also* uses ECDSA (§11), and the settlement wrapper and KZG blob commitments remain
57inherited non-PQ dependencies (§12.5).
58
59### Changes at a glance
60
61| Component | v2 | v3-PQ |
62|---|---|---|
63| Ballot confidentiality | ElGamal over BabyJubjub (threshold key) | Shamir shares + PRF masks over KEM transport (§3) |
64| Ballot proof | Groth16 over BN254 (circom, trusted setup) | Plonky3 STARK over Goldilocks, browser WASM (§6) |
65| Election key | DKG / council ceremony (BabyJubjub) | **None.** Wardens register ML-KEM keys (§4) |
66| Tally | Threshold decryption + BSGS search | Lagrange interpolation of θ proven warden sums (§10) |
67| Running tally | Homomorphic ciphertext accumulator | **None.** Nothing is accumulated in public; wardens sum their recovered shares at the end (§10.1) |
68| Silent revoting | Re-encryption of stored ciphertexts, with a refresh sample as cover | **Hidden writes**: an overwrite publishes nothing about its slot; no refreshes, no cover sample (§5.3, §8.4) |
69| Revotes | Slot overwrite + ciphertext subtraction | Slot overwrite recorded in an encrypted write log, with **no nullifiers, no predecessor consumption, no revote budget** (§5.3) |
70| Census | Merkle tree of (address, weight); CSP credentials | **Unchanged tree**; post-quantum voter keys in a separate key map (§11) |
71| Voter authentication | ECDSA (secp256k1) | Hash-preimage proof in-STARK against a key from the PQ key map; `hybrid` verifies **both**; `hybrid-legacy` admits voters proven unenrolled on ECDSA (§11) |
72| CSP credentials | ECDSA | SLH-DSA (SPHINCS+) [FIPS 205] |
73| Batch proof | ZisK, verifies Groth16 (BN254 precompiles) | ZisK [ZISK], verifies ballot STARKs (Blake3 precompile) |
74| Protocol hash | Poseidon (circuits) + SHA-256 (state) + Keccak (Ethereum, census) | **Blake3 everywhere the protocol chooses** (§2); keccak/SHAKE/SHA-2 survive only as fixed islands |
75| Tally bound | maxValue·maxVoters ≤ 10^12 (BSGS limit) | ≤ 2^61 (field headroom; no search) |
76
77
78
79---
80
81## Protocol intuition (read this first)
82
83*This walkthrough is self-contained: you need no prior DAVINCI knowledge. Every term used
84loosely here gets a precise definition from §2 onward; the jargon cheat-sheet is §2.4,
85and the same flow written out message by message, with notation and pointers into every
86section, is the "Protocol overview" after §4.
87Readers who know v2 will recognize the shape; the deltas are marked "(v2: …)".*
88
89### The cast
90
91| Who | What they do | What you have to trust them with |
92|---|---|---|
93| **You, the voter** | vote from a browser; revote whenever you like | your own device |
94| **The organizer** | creates the election: the **census** (the list of eligible voters and their voting weights), the ballot rules, the schedule, and which registered wardens form the committee | getting the voter list right, and choosing a committee worth trusting (the privacy guarantee below traces to that choice) |
95| **ν key wardens** (say 5) | a committee; each publishes a post-quantum "lockbox" public key up front, meaning anyone can lock a small secret so that only that warden can open it. After the election, any **θ** of them (say 3) jointly produce the result | privacy only: it holds as long as fewer than θ of them collude. They cannot change the result; nobody can. (If fewer than θ show up at the end, the result cannot be produced, the standard committee trade-off) |
96| **Sequencers** | anyone who wants to run one (permissionless). They collect votes, bundle them into **batches**, and *settle* each batch: publish it to Ethereum with a cryptographic proof that every rule was followed | nothing for correctness (the proof is checked by the contract). The one you submit to learns when you revote, and could ignore you, in which case you just switch to another; no sequencer can block the election |
97| **The smart contract** | the referee's referee on Ethereum: verifies every proof, stores the public state, and at the end computes the result itself | it's Ethereum, with the usual assumptions |
98| **Observers** | anyone. All published data is enough to replay and re-check the whole election | — |
99
100Each eligible voter owns one fixed **slot**, a position in the public state that records
101that they have voted. Revoting just writes your slot again; the last write before closing
102counts. Revoting is deliberate: it is what lets a pressured or coerced voter
103quietly change their vote later. (v2 had the same census, slots, sequencers and contract.)
104
105### The trick, with tiny numbers
106
107Everything rests on one idea from 1979, Shamir secret sharing, plus the observation
108that *shares add up*. Suppose θ=2, ν=3, and all arithmetic is modulo some large prime.
109
110- **Alice votes 1.** Her browser picks a random line through her vote:
111 $f_A(x) = 1 + 4x$. Her three *shares* are $f_A(1)=5$, $f_A(2)=9$, $f_A(3)=13$, one per
112 warden. Any two shares pin down the line and reveal $f_A(0)=1$. One share alone says
113 *nothing*: for every possible vote $v$ there is a line through $(0, v)$ and $(1, 5)$, so
114 the share 5 is perfectly consistent with Alice voting 0, 1, or anything else.
115- **Bob votes 0.** His line: $f_B(x) = 0 + 2x$. Shares: 2, 4, 6.
116- Shares are never shown in the clear. Alice hides each one under a **mask**: a random
117 number only warden $i$ will be able to recompute, because its key is locked in that
118 warden's lockbox. Say her masks are 20, 50, 70: she publishes 25, 59, 83. Bob's masks are
119 10, 30, 40: he publishes 12, 34, 46. To everyone else these six numbers are pure static.
120- **After the election**, warden 1 opens its lockboxes and recomputes its masks (20 for
121 Alice, 10 for Bob), which gives it back its two shares: $25 - 20 = 5$ and $12 - 10 = 2$.
122 It adds them: $5 + 2 = 7$. Warden 2 does the same: $9 + 4 = 13$. Those are points of
123 the *sum* line $F(x) = f_A(x) + f_B(x) = 1 + 6x$: indeed $F(1)=7$, $F(2)=13$. The
124 contract draws the line through $(1,7)$ and $(2,13)$ and reads it at zero: $F(0) = 1$.
125 **One yes-vote, and no group of fewer than θ wardens can ever tell whose.** (Warden 1
126 did learn one point of each voter's line along the way, which, as above, is consistent
127 with any vote.)
128
129Two footnotes. Real elections use a huge prime modulus, so
130"random-looking" means genuinely indistinguishable from noise; the small numbers here are
131for readability. And a real ballot is a short *vector* of numbers, one per option ("rate 5
132candidates" is five values; voting weights scale them under the election's rules). Everything
133shown here just happens once per position, and the result is a vector of per-option totals.
134
135No warden ever learns a ballot (one share is noise). No decryption key for "the votes"
136exists anywhere, so there is nothing to steal, leak, or break, short of θ wardens
137colluding, which is the same committee-trust every threshold scheme has. That's the whole
138protocol; the rest is making every step *provable* so nobody has to be trusted for
139correctness.
140
141
142
143### The same story, phase by phase
144
145**Setup.** The organizer registers the election on the contract: census, ballot rules,
146schedule, and which ν registered wardens form the committee. That's it: because wardens'
147lockbox keys already exist, there is **no key-generation ceremony and no election
148encryption key**. (v2 ran a distributed key generation, DKG, to create a shared key
149before every election; that whole phase is gone.)
150
151**Casting.** Your browser splits each ballot value into ν shares, masks them, locks the
152mask keys into the wardens' lockboxes, and, right there in the browser, generates a
153zero-knowledge proof (a STARK: a proof made only of hashes, no trusted setup) that the
154whole construction is honest: the shares encode one valid ballot that follows the election
155rules, the masks match their commitments, and you hold the secret key behind your voter
156identity, a hash-based key that is itself post-quantum (elections may *additionally* accept
157classical wallet signatures during migration, §11), while the batch step below checks that
158identity against the census and your slot.
159The *package* you send (masked shares, locked boxes, commitments) goes to a
160sequencer of your choice over a private channel, proof attached. If you don't trust your
161own browser, you can demand it open any candidate package for inspection on a second
162device, then discard it and cast a fresh one (§5.2); a cheating client gets caught.
163
164**Voting period.** Sequencers verify incoming proofs, bundle packages into batches, and
165settle each batch: the contract accepts it only with a proof that *every* rule was followed
166(this proof is produced by a zkVM, a virtual machine whose entire execution is provable).
167The bulky data, the packages themselves, rides along in Ethereum *blobs*, cheap bulk
168storage attached to the transaction; the contract itself keeps only tiny commitments and
169the verified state.
170
171What does a batch reveal about *who* voted? Only this: the first time your slot is
172written, the batch lists it, so turnout is public (as in v2). After that, **a revote
173publishes nothing about your slot at all**. The new package appears in the batch like any
174other, but which slot it belongs to is not written anywhere public. So an observer sees
175*that* some number of revotes happened in a batch, not *whose*: a revote hides among
176every voter who has already voted. (v2 hid a revote among a random sample of other slots
177that it re-encrypted as cover. v3 needs no cover, because a revote leaves no public mark
178to cover.)
179The link between packages and slots is not lost: every batch leaves the committee a
180sealed note (its key split θ-of-ν across the wardens, the same Shamir trick again)
181recording which slot each package wrote. At tally time the committee opens the notes,
182finds each slot's last package, and reads its shares straight from the lockboxes.
183
184**End of election.** Casting closes; a short *grace window* lets in-flight batches land;
185the state freezes. Then one new deadline (new vs v2): the **complaint deadline**.
186Why it exists: the browser's proof checks everything it can see, but it deliberately cannot
187look *inside* the lockboxes (proving post-quantum encryption in-proof is the one expensive
188step this design avoids). So if some package's lockbox doesn't open to what was promised,
189from a buggy or malicious client,
190the affected warden proves that on-chain and the package is excluded from the count. A
191complaint is itself a proof, so a warden cannot abuse it to exclude an honest vote.
192Wardens can file complaints *from the moment a package lands*, so an honest voter with a
193broken client finds out while voting is still open and simply revotes. The deadline is the
194last moment to complain; then the exclusion list freezes. (If all ν wardens attest early
195that they're done checking, results can start immediately.)
196
197
198
199**Results.** Any θ wardens each do one job: open their lockboxes, use the recovered mask
200keys to read *their own column* of every counted ballot's shares, and publish the **sum of
201those shares** (plus a pinch of jointly-made blinding that vanishes at the finish line),
202with a proof that they did exactly that and nothing else. The θ partial
203sums are θ points on a single polynomial, and its value at zero *is* the election result.
204The contract draws the curve and reads it off, in ordinary modular integer arithmetic (the
205same "mod a large prime" as the example), on-chain, exact.
206(v2 ended with a threshold *decryption* plus a brute-force search to extract the number;
207v3's ending is the schoolbook interpolation you saw above.)
208
209
210
211### Who sees what
212
213- **The public / an observer**: all packages, which slots have voted at least once and
214 when (turnout), how many revotes each batch contained, the complaint list, the result.
215 Never a ballot, and (outside the degenerate cases of §12.1, such as a batch holding a
216 single vote) not which package belongs to which slot or which voters revoted.
217- **Your sequencer**: that *you* (your slot) revoted in the batches it sealed, the same
218 thing the vote-collecting server inevitably sees in v2. Never your ballot or shares.
219- **Fewer than θ wardens, even colluding, even with quantum computers, even in 30 years
220 from archived data**: about ballots, nothing: each holds shares that are individually
221 pure noise. (To be
222 exact: below θ *raw shares* the protection is pure math; the *archived masked data* is
223 additionally guarded by one computational assumption, the ML-KEM lockboxes, a
224 post-quantum lattice scheme. That is the single lock a future cryptanalyst would have to
225 break.) About *who revoted*, one caveat: the tally itself has the participating wardens
226 open the sealed notes together, so after it every one of them knows which slot each
227 package wrote (§12.2).
228- **θ or more colluding wardens**: can reconstruct individual ballots (every threshold
229 voting system has exactly this boundary) and can read the sealed notes at any time.
230 Choose the committee accordingly.
231
232### What this buys you
233
234- **Nothing to harvest.** The quantum "harvest now, decrypt later" attack dies below θ
235 wardens: what is published is masked shares, and the only cryptography guarding the
236 masks is lockboxes (ML-KEM) and hashes, both post-quantum; even with the masks removed,
237 fewer than θ shares are information-theoretic noise. (v2's
238 published ElGamal ciphertexts fall to a future quantum computer retroactively.)
239- **No shared decryption key exists**: not held by anyone, not generated, not reconstructable.
240 Each warden has only its own ordinary keypair. The tally still takes one coordinated
241 ceremony among θ wardens (opening the batches' sealed notes together), but no step of it
242 ever produces a key that decrypts ballots.
243- **Checked, not trusted.** Voter, sequencer and warden each move only with a proof: the
244 contract rejects anything else. Integrity needs no honest operator anywhere. (One caveat:
245 ballot *secrecy* is what's quantum-proof today; the *integrity* plumbing still
246 includes some classical Ethereum-era pieces, namely the proof wrapper, blob commitments, and
247 optional legacy wallet signatures, with a tracked migration path, §12.5. Breaking those
248 could forge state while they last; it can never retroactively read ballots.)
249- **Exact results.** The tally is integer arithmetic: no decryption failures, no noise
250 budgets, no brute-force search at the end.
251
252---
253
254## 2. Notation, parameters and encodings
255
256- $\mathbb{F}$ — the **Goldilocks field**, $p = 2^{64} - 2^{32} + 1$ (the Plonky3 [P3] and ZisK
257 native field). All shares, masks and tally arithmetic live here. Canonical encoding of an
258 element: 8 bytes little-endian, value < $p$.
259- $\nu$ — number of **key wardens**; $\theta$ — tally threshold. **v3.0 supports
260 $1 \le \theta \le \nu \le 8$**, enforced at creation and in the pinned profile (DA and
261 in-circuit cost are linear in ν; ν=8 halves both vs 16. The protocol structures support
262 up to 16, which returns as a future profile once DA/verification optimizations land;
263 committee size is unrelated to the 16 *ballot fields*, which stay). Size rosters with the
264 availability margin in mind: tolerating $f$ unavailable or faulty wardens through the
265 complaint deadline and tally ceremony needs $f < \theta \le \nu - f$ (an 8-of-8 election
266 tolerates none; the registry rejects $\theta = \nu$ for $\nu \ge 2$ unless creation sets
267 an explicit override flag), and the ceremony absorbs individual failures by roster margin (§10.4),
268 with blinding still requiring ≥ 1 honest *accepted dealer*. The complaint-capacity bound (§9.2) depends
269 on admitted casts, not ν: fewer wardens means less aggregate proving/archival redundancy,
270 so deadlines and hardware budgets must be revalidated per roster size.
271- `nf` — active ballot fields, 1..16, as in v2, immutable per election. **Packages carry
272 shares, masks and commitment entries only for fields `1..nf`** (v1.3 fixed everything at
273 16-wide; nf-sizing saves `(16−nf)·ν·8` B per package, ~960 B at ν=8/nf=1). Any 16-wide
274 logical representation is the zero extension: inactive fields have no per-package
275 polynomials, share encodings, mask consumption or commitment entries. Sum-shares and
276 results stay 16-wide via zero extension (inactive fields are identically 0). All
277 component lengths are derived from authenticated election parameters, never from supplied
278 bytes; trailing inactive-field bytes are rejected.
279- **KEM** — **ML-KEM-768 [FIPS 203] (ct 1088 B), the only allowed profile** (v1.2's
280 ML-KEM-512 option is withdrawn: BSI recommends only the 768/1024 sets, and 512 saved just
281 ~2.5 KB per ballot at ν=8; the DA-reduction path is multi-recipient Kyber, §15 item 5). Browser
282 implementations must be pinned and vetted [KEMB]. One *encapsulation* yields `(ct, K)` with
283 a 32-byte shared secret `K`; arbitrary payloads are carried KEM-DEM style (encapsulate,
284 derive a wrapping key from `K`, then DEM-encrypt, §2.1). **Normative decapsulation rule
285 (all paths: warden recovery §10.1, complaint guests §9.2, ceremony recipients §10.4):
286 the FO re-encryption check MUST compare the full re-encrypted ciphertext in constant time;
287 partial or early-exit comparison enables ML-KEM key recovery [FOCT].**
288- **Blake3** — standard Blake3 [B3] is **the protocol hash, everywhere the protocol gets to
289 choose**: the ballot STARK's Merkle trees and Fiat–Shamir challenger; all in-circuit
290 hashing (PRF masks, commitments, voteID, via a re-laid Blake3 AIR section,
291 §6); the state SMT; `pkgDigest`/`ctsDigest`; the column views; and
292 every DEM/PRF/key-derivation role through Blake3's standard *keyed*, *derive_key* and
293 *XOF* modes (§2.1). Digests are 32 bytes. Rationale: fastest software hash in the browser
294 (~1.4 GB/s in WASM; measured on the prototype: proving 3.24 s → 0.69 s, proofs
295 544 → 324 KB), a standard-conformant ZisK precompile (`blake3f`) for every guest
296 recomputation, and a conservative, long-studied ARX design (§12.4). One hash = one
297 implementation to audit on each platform (AIR, guest, browser, warden).
298- **Hash islands the protocol cannot choose**: **keccak256** for values
299 Solidity contracts must compute (blob evaluation points $z_b$, the v2 processID prefix,
300 `archiveAcc`, the session id, and the **census trees and the PQ key map**, which on-chain
301 censuses and the key registry maintain in contracts, §8.2/§11) and for hybrid-mode
302 Ethereum addresses; **SHA-256** for v2's address→slot rule, under which v2's on-chain
303 census contracts enforce slot uniqueness (§8.2); **SHAKE** inside ML-KEM and **SHA-2**
304 inside SLH-DSA (FIPS-fixed internals of black-box primitives); **Poseidon2** inside
305 ZisK's own prover (an inherited proof-system dependency; framing in §12.4; [POS2]).
306 Poseidon and Poseidon2 hold **no application-level role** in v3-PQ. (Drafts ≤1.5 planned
307 a Blake3 census format reached through conversion proofs from a Poseidon tree; the
308 v2 batch program's source in fact verifies a Keccak tree, so the census stays as it is
309 and the conversions are removed.)
310- **256-bit values in circuits** (DEM keys, Blake3 digests crossing into Goldilocks
311 arithmetic): encoded as **eight 32-bit limbs**, each range-checked < 2^32. Never as four
312 64-bit limbs (not injective: $p^4 < 2^{256}$), and never reduced mod $p$.
313
314### 2.1 DEM (authenticated encryption for warden payloads)
315
316Built from Blake3's standard modes, normative for **every protocol payload** (voter→warden is
317pure KEM+PRF and needs no DEM; this DEM covers batch payloads, batch-key share wrapping, and
318ceremony deliveries):
319- **Key separation**: `k_enc = Blake3.derive_key("davinci v3-pq DEM enc key", K)` and
320 `k_mac = Blake3.derive_key("davinci v3-pq DEM mac key", K)`, with fixed application context
321 strings, exactly the standard derive_key mode. `derive_key` creates *separation, not
322 entropy*: `K` must be a ≥256-bit KEM secret or CSPRNG secret.
323- **Keystream**: keyed-Blake3 **XOF**. `keystream = Blake3.keyed(k_enc, nonce ‖ AAD).xof()`,
324 with the counter being the XOF output offset (bounded: payloads < 2^32 blocks, no offset
325 wraparound); ciphertext = plaintext ⊕ keystream. An XOF is a seekable output stream, not
326 repeated hashing of previous output.
327- **Authentication**: encrypt-then-MAC. `tag = Blake3.keyed(k_mac, nonce ‖ AAD ‖ ciphertext)`;
328 receivers verify the **full 32-byte tag before releasing any plaintext**.
329- **Uniqueness**: `nonce = Blake3(AAD)`; the AAD is the canonical, length-unambiguous
330 serialization of a **DEM context** that always includes a purpose tag, the election
331 context, the **batch number or ceremony (session, attempt) identifier**, sender and
332 recipient. It is unique per encryption *including retries* (a ceremony restart is a new attempt
333 id ⇒ fresh masks, keys and nonces; the same derived key and nonce never encrypt two
334 different plaintexts).
335
336These are standard Blake3 modes, but their composition is a
337**protocol-specific authenticated-encryption construction, not a standardized AEAD**; the
338needed assumption is keyed-Blake3's PRF security (§12.4). A short security-argument appendix
339(encrypt-then-MAC composition per Bellare–Namprempre over keyed-Blake3-as-PRF, with the
340deterministic AAD-derived nonce justified by the AAD-uniqueness rule above) is a Phase-0
341publication gate (§15). AES-256-GCM may be used by clients
342for unrelated local storage/transport, never as a substitute encoding of protocol payloads.
343
344### 2.2 Domain-separated contexts
345
346Every derived value uses a purpose-tagged context; nothing is derived without one. Purpose
347tags map to Blake3 `derive_key` context strings; the tuple itself is serialized canonically
348(fixed order, length-prefixed variable fields).
349
350| Purpose | Context contents |
351|---|---|
352| `pkgCtx` — the package context tuple | `(protocolVersion, chainID, registry, processID, wardenEpoch, voteID)`, the common prefix below |
353| `streamCtx(i)` — mask stream for masked shares | `("v3/mask", pkgCtx, recipient i)`: **one keyed XOF stream per (package, warden)**, no field index. `stream_i = Blake3.keyed(K_i, streamCtx(i)).xof()`, 256 bytes of output; field $f$ uses bytes $[16(f{-}1), 16f)$ via the LE128-mod-$p$ rule below. This is a **normative masking definition**: browser, ballot AIR, batch guest and warden implementations must match it bit-exactly (test vectors required) |
354| `hCtx(i)` — share commitment | `("v3/hcommit", pkgCtx, recipient i)` |
355| `commitCtx` — package commitment | `("v3/pkgcommit", pkgCtx)`, the `ctx` argument of `pkgCommit` (§5.1) |
356| `sealCtx` — batch sealing | `("v3/seal", protocolVersion, chainID, registry, processID, wardenEpoch, wardenSetHash, batch number, oldRoot, the package count, the admitted pkgDigests in voteID order)`: bound into every batch DEM AAD and into the derivation of **all** batch payload randomness (§8.5), so equal derivation inputs give a byte-identical payload and no key or nonce ever covers two different plaintexts |
357| `viewCtx` — per-warden column views | `("v3/view/rows", …)`, `("v3/view/firstwrites", …)`, `("v3/view/payload", …)`, `("v3/view/acc", …)`, `("v3/view/root", …)`: the five §8.7 commitments (encoding version 2: no update records); each context binds `(protocolVersion, chainID, registry, processID, wardenEpoch, wardenSetHash)` plus the batch number and (where applicable) the recipient index |
358| `ectx`, `snap` — election context and frozen snapshot | `ectx = (protocolVersion, chainID, registry, processID, wardenEpoch, wardenSetHash)`. `snap = (R_cast, xDigest, batchCount, viewsRoot)`, frozen at the exclusion freeze, where `xDigest` is the registry's running **keccak256** fold of the exclusion set (`xDigest' = keccak256(xDigest ‖ pkgDigest)` on each new exclusion; the registry rejects a duplicate), contract-computed like every value the registry must derive |
359| `joinCtx` — ceremony join | `("v3/join", ectx, snap, attempt, senderIndex, ephemeralPK)`: what a join envelope's SLH-DSA signature covers (§10.4). It contains the ephemeral key and deliberately no session id and no roster |
360| `cerCtx` — ceremony messages after the roster freeze | `("v3/ceremony/<phase>", ectx, snap, sessionId, attempt, sender, dealer-set hash where applicable)`: every dealer bundle, share bundle, bundle-key wrap and contribution binds it (§10.3, §10.4). `sessionId = keccak256("v3/session", ectx, snap, attempt, Π)` is computed by the registry when the proven roster `Π` freezes |
361| `slotCtx` — slot derivation | For Merkle census origins 1-3: **v2's rule, byte for byte**, `SHA-256("davinci-slot-v1" ‖ address)` reduced as v2 does, because v2 requires on-chain census contracts to reject a registration whose slot is already taken under exactly this rule (§8.2; gate 9 confirms the deployed ones do); a different rule would void that uniqueness check. CSP: `slot = 16 + idx`, as v2. Slot leaves hold a constant marker (§7) |
362
363The package's mask nonce is its **voteID**: public, unique per package, authenticated, and
364independent of the masked values (it derives from the secret `k`, §5.2, before any masking),
365so wardens can recompute every `streamCtx` from public data with no circularity. (Earlier
366drafts derived one PRF output per *field*; that definition contradicted the in-AIR cost
367estimates, ≥16 final keyed computations per warden and 256 at ν=16, and was replaced by the
368single per-warden stream above, which needs only one context block plus four 64-byte XOF
369output blocks per warden.)
370
371**Byte→field mapping (normative).** Blake3 outputs bytes; masks and other derived field
372elements are obtained as **LE128 of 16 XOF bytes, reduced mod $p$**, at statistical distance
373from uniform ≈ $2^{-96}$ *per element* (pseudorandom/nearly uniform: not exact uniformity, and not a whole-election bound). Never `LE64(8 bytes) mod p`: its distance is
374≈ $2^{-32}$, which is not.
375
376### 2.3 Protocol parameters
377
378| Parameter | Value | Why |
379|---|---|---|
380| Share/tally field | Goldilocks $p$ | native in the ballot AIR and ~native u64 in ZisK guests |
381| Registry tally cap | `maxValue · maxVoters ≤ 2^61` | per-field tally stays below $p$ with headroom (weights don't change this: each field is individually bounded by `maxValue`) |
382| **Integer-cost profile (enforced)** | `nf · maxValue^costExponent < 2^61`, checked by the registry at creation **and** recomputed overflow-safe in the ballot proof | the cost sum must not wrap mod $p$ (e.g. `costExponent=192` would give $2^{192} \equiv 1$); v2 only *advised* this profile, v3 enforces it |
383| Warden evaluation points | $x_i = i$, $i \in 1..\nu$ | Shamir positions, pairwise distinct, nonzero |
384| Max votes per batch | profile-dependent (§8.6) | in-guest verification cost + the 32-blob batch cap inherited from v2's batch program (see §8.6) |
385| Per-voter casting | **no lifetime bound** (as v2) | the structural rate limit is ≤ 1 ballot per slot per batch (§8.4); first writes are bounded by `maxVoters`. Review ruled out both a flat lifetime cap (capturable) and a two-pool cap (an attacker exhausting the overwrite pool would permanently block every later escape vote, which is worse than congestion). Deliberate cast inflation is priced by admission and provisioned by the adaptive deadlines below |
386| Accepted-batch bound | `M ≤ admitted casts` | every accepted transition must admit ≥ 1 package (registry-enforced on the batch statement's counters); there is **no zero-ballot transition** (an election with zero accepted transitions finalizes by the §9.1 short-circuit). Bounds the per-warden batch-envelope work (§8.5, §10.1) |
387| Adaptive deadlines | `d_complaint = t_freeze + d_0 + α·C + β·M` | complaint and ceremony stage **durations** are workload-derived, computed once at casting freeze from the authenticated terminal counts (C = admitted casts, M = batches; the per-touch term of drafts ≤1.5 is gone with the refresh sample, and write-log work is part of α); coefficients and margins come from an **immutable, versioned deadline profile** in the registry, referenced at creation (optionally scaled by a bounded multiplier never below the profile's calibrated safety floor, overflow-checked; registry updates never alter an existing election's deadlines), budgeting worst-case malformed transport + proving + publication + inclusion + archive catch-up + reorgs, never only honest decapsulation. Profiles are calibrated once at Phase 0 (gate 6), never per election. The ceremony's stage durations scale by the same counts; each tally attempt turns them into absolute deadlines from its own start (§10.4). Subsequent complaints never extend a computed deadline; a stage can close early, when all expected participants have published (§9.2, §10.4), which never moves anyone's deadline earlier |
388| High-stakes FRI profile (named) | blowup 32, **27 queries + 20-bit grinding** ≈ 155 conjectured bits | the pinned "raise the dial" option of §12.4 (~1.5× in-guest verification cost vs the default profile); selecting it is a profile choice, not an ad-hoc edit |
389| Ballot STARK profile | Goldilocks, **blowup 32, 18 FRI queries + 16-bit query grinding**, hiding PCS, **Blake3 everywhere** (Merkle/challenger AND the in-AIR hashing section) | ≈106-bit conjectured FRI soundness (§12.4, same heuristic dial as before); chosen verifier-side: −35% in-guest steps and −39% proof size vs blowup-8/34-queries, for ≈2.45× prover cost (measured single-threaded on the prototype circuit, 2.0× in WASM; Annex A.4). Fallback if browser benchmarks disappoint: blowup 16 / 26 queries, grinding unchanged at 16 bits (measured in Annex A.4: ≈35% faster, half the memory, 34% larger proofs). Profile pinned in full by `ballotVKHash`; the wasm32 challenger fix (§6) is a prerequisite for **any** browser proving with this transcript, with or without grinding (measured: unpatched wasm32 proving panics at every profile, Annex A.4) |
390| Commitments | **salted unkeyed Blake3**, domain-separated | hiding from an independent 256-bit CSPRNG salt (or the secret inputs); binding from collision resistance. Keyed-Blake3 is reserved for MACs/PRFs: a MAC is not automatically a hiding/binding commitment |
391
392### 2.4 Terminology for software engineers
393
394Plain definitions, anchored in things an Ethereum engineer already knows. Skim once; the rest
395of the document assumes them.
396
397- **KEM** (Key Encapsulation Mechanism; here **ML-KEM**, the standardized Kyber) — a
398 public-key *lockbox*: anyone can "encapsulate" against your public key and obtain a fresh
399 32-byte shared secret plus a ciphertext; only you (with the private key) can recover that
400 secret from the ciphertext. Two operations:
401 - $(ct, K) \leftarrow \mathrm{Encaps}(pk)$, run by the sender, returns a
402 public ciphertext `ct` and a secret `K`
403 - $K \leftarrow \mathrm{Decaps}(sk, ct)$, run by the key holder, recovers the
404 same `K`.
405- **PRF** (pseudorandom function) — a keyed hash used as a deterministic random-number
406 generator: same key + input ⇒ same output, and without the key the outputs are
407 indistinguishable from random. Mentally: `keccak256(key, input)` used the way you'd use a
408 seeded RNG. Here PRFs expand a KEM secret into the masks that hide shares.
409- **Shamir secret sharing** — split a value into ν pieces by choosing a random polynomial of
410 degree θ−1 whose value at x=0 is the secret, and handing out its values at x=1..ν. Any θ
411 pieces determine the polynomial (and hence the secret); any θ−1 pieces are statistically
412 independent of it: noise, not "hard to crack".
413- **Threshold θ-of-ν** — ν parties hold pieces; any θ of them suffice to act (here: tally);
414 fewer than θ learn nothing and can block nothing except by being too few.
415- **Lagrange interpolation** — given θ points, there is exactly one polynomial of degree
416 ≤ θ−1 through them; evaluating it at x=0 recovers a Shamir secret. "Draw the unique curve
417 through the points, read it at zero." A few multiplications and additions, cheap even in
418 Solidity.
419- **STARK** — a zero-knowledge proof system built only from hashes (no trusted setup, no
420 elliptic curves, post-quantum). Bigger proofs than Groth16 (hundreds of KB), but
421 browser-provable and cheap to verify.
422- **AIR** — the constraint system of a STARK: its "circuit".
423- **FRI** — the polynomial-checking engine inside a STARK; the reason STARK verification is
424 mostly hashing.
425- **Hiding PCS** — the polynomial commitment inside the STARK is randomized so the proof
426 leaks nothing about private inputs; this is what makes the proof *zero-knowledge* rather
427 than merely succinct.
428- **Witness** — the prover's private inputs (the ballot, the shares, the keys). Never leaves
429 the prover.
430- **Nullifier** — a one-way tag published to mark something as spent (the Tornado Cash /
431 Semaphore pattern). **v3 deliberately has none**: drafts ≤1.3 used them for revote
432 tracking, and adversarial review showed any such voter-derivable public tag is a coercion
433 test (§5.3, §12.3). Defined here because the term appears in those discussions.
434- **Write log** — the per-batch encrypted record of which slot each package wrote. Its key
435 is split θ-of-ν among the wardens, so before the tally nobody below θ can read it; the
436 tally's share exchange lets every participating warden read it (§8.5, §12.2).
437- **Blake3** — a modern general-purpose hash: ARX design (add–rotate–xor, the ChaCha/BLAKE/
438 BLAKE2 lineage; BLAKE was a SHA-3 finalist), extremely fast in software, with standard
439 built-in modes for keyed hashing (MAC), key derivation (`derive_key`) and arbitrary-length
440 output (XOF). v3's single protocol hash.
441- **DEM / AEAD** — symmetric authenticated encryption (ciphertext + tamper-proof tag), the
442 AES-GCM role; v3 instantiates it from Blake3's keyed + XOF modes so one hash covers it and
443 zk-proofs about it stay cheap (§2.1).
444- **Domain separation** — namespacing every hash/PRF input with a purpose tag and context so
445 a value from one context can never be replayed in another, the same reason EIP-712 typed
446 signing exists (§2.2).
447- **Dealer** — a party that generates a secret and distributes shares of it (used in the
448 tally ceremony, §10.3).
449- **CSPRNG** — a cryptographically secure random generator (`crypto.getRandomValues`,
450 `/dev/urandom`); "fresh CSPRNG randomness" means sampled from this, never derived.
451
452### 2.5 Chunked proving (one contract for every chunked proof path)
453
454Complaint proofs (§9.2) and warden contributions (§10.1) MAY be proven in segments. One
455normative contract covers every such path:
456
457- **Authenticated continuation.** Each segment's statement binds the predecessor's complete
458 continuation state: the progress ordinal, every running value (`viewAcc`, partial
459 sums, counters, and for the tally the slot → latest-package map) and the typed, versioned
460 state schema of its path. Carrying a hash alone
461 does not certify earlier computation; the linkage is authenticated execution (the segment
462 proves it resumed from exactly that state under the same pinned program and statement
463 context), never merely a chained digest.
464- **Hiding.** Continuation states are witness material: they MUST NOT contain a plaintext
465 write-log digest (§8.7) or any secret-derived value in the clear; any commitment to
466 low-entropy state such as the slot map MUST be salted; and every chunked
467 path is in scope of the §12.4 hiding verification (Phase-0 gate 4).
468- **Shape.** Everything an outsider can see of a chunked proof (the number of segments,
469 their sizes, progress counters, execution-length metadata) MUST be a function of the
470 declared public workload alone, never of secret state. For the tally this matters: the
471 secret opening work depends on which packages are final bases and which of those are
472 excluded, so a prover that emitted one segment per fixed amount of *executed* work could
473 reveal, at a segment boundary, whether an excluded package was still its slot's final
474 base. Implementations pad to a public bound, or keep intermediate segments private
475 behind one fixed-shape final proof. Salted commitments and a hiding proof system do not
476 cover this on their own.
477- **Completeness.** Only the final segment's statement asserts the whole claim; partial
478 segments assert nothing externally. Open chunks are rejected after their path's closing
479 event (e.g. the exclusion freeze, §9.2).
480
481§9.2, §10.1 and §12.4 reference this contract instead of restating it; path-specific state
482schemas and negative tests remain per path (Phase-0 gate 3).
483
484---
485
486## 3. The core idea: tally without a shared decryption key
487
488v2 hides a ballot inside a ciphertext and adds ciphertexts homomorphically. v3 hides a ballot
489inside **polynomials** and adds polynomials. If you know Lagrange interpolation, you know the
490whole trick:
491
4921. For each ballot field value $b$, the voter picks a random polynomial $f$ of degree
493 $\theta-1$ with $f(0) = b$, and computes one **share** per warden: $s_i = f(i)$. Any
494 $\theta$ shares reconstruct $b$; any $\theta-1$ shares are statistically independent of
495 $b$. Plain Shamir [Sha79]: no curves, just polynomial evaluation in $\mathbb{F}$.
4962. Shares are never published in the clear. The voter publishes **masked shares**
497 $e_i = s_i + \mathrm{mask}_i$, where the masks are sliced from one keyed Blake3 XOF
498 stream per warden (§2.2) and the stream key $K_i$ travels to warden $i$ inside an ML-KEM
499 ciphertext. To everyone except warden $i$, $e_i$ is a uniformly random field element.
5003. Polynomials add: the per-field sum of every counted voter's polynomial is itself a
501 degree-$(\theta-1)$ polynomial whose value at 0 is the **tally**. Nothing has to be
502 accumulated in public while voting runs. The batch program only records, in an
503 encrypted **write log** readable by θ wardens together (§8.5), which slot each package
504 wrote, so that at the end everyone agrees on each slot's last package. A revote is one
505 more package and one more log entry; nothing public says which slot it replaced (§8.4).
5064. At the end, each participating warden decapsulates its KEM ciphertexts, recovers its
507 share of every counted ballot, and publishes its **sum-share** $S_i$: the sum of those
508 shares plus a jointly-created blinding share that vanishes at $x=0$ (§10.3), with a ZisK
509 proof that it did exactly that against on-chain-committed data. Lagrange interpolation of any $\theta$ published
510 sum-shares at $x=0$ **is** the tally. Exact field arithmetic: no decryption of any
511 aggregate, no noise, no discrete-log search.
512
513
514
515(*This section is the intuition; the full computation also handles the exclusion set and a
516tally-time blinding term, §9-§10.*)
517
518The ballot STARK (§6) makes steps 1-2 trustworthy, the batch proof (§8) step 3, the warden
519proofs (§10) step 4. **The zkVM proof chain replaces the homomorphic algebra**, which is the
520structural difference from academic PQ voting designs ([TEV], [PQK]) that obtain the same
521guarantee from lattice commitments. (Some public-key encryption is unavoidable for ballots
522addressed to offline wardens [IR89]; v3 confines it to KEM transport. Threshold *lattice*
523decryption, the known hard part of lattice voting [NOAH], is avoided entirely: the
524threshold lives at the plaintext layer.)
525
526Privacy in one sentence: below $\theta$ colluding wardens, shares are information-theoretically
527useless in isolation, and the computational assumptions protecting ballots are ML-KEM, the
528PRF/hash, and the zero-knowledge of the STARKs, all post-quantum (full leakage model: §12).
529
530---
531
532## 4. Roles: what changed
533
534- **Organizer, sequencers, provers, observers** — unchanged from v2.
535- **Key wardens** no longer run a DKG or hold shares of a secret key. Per *epoch*, each warden
536 generates an ML-KEM keypair **and an SLH-DSA-SHA2-128s signing keypair [FIPS 205]** and
537 calls the **WardenRegistry** contract with: `H(pk)`, **`H(pk_sig)`**, a **settlement
538 account address** (authorizing its proof-less on-chain messages, below), a URI where the
539 full public keys are served (IPFS or HTTPS), and a ZisK **well-formedness proof** (the
540 ML-KEM key pair derives from a committed seed and passes an encaps/decaps self-test). The
541 registry verifies the proof on-chain. The signing key authenticates the warden's published
542 ceremony payloads to **off-chain consumers** (join envelopes and share bundles, §10.4);
543 signatures are ~7.9 KB and verification is pure hashing. **SLH-DSA signatures are never
544 verified on-chain.** On-chain protocol messages that carry no proof (session joins and
545 scan-complete signals, §9.2/§10.4) are authorized by `msg.sender` equal to the warden's
546 registered settlement account, pinned per election by the creation-time snapshot below
547 (registry account rotation never moves an existing election's rights). Proof-carrying
548 messages (complaints §9.2, dealer bundles §10.3, contributions §10.1) are authenticated by
549 their proofs' registered-key-seed clauses and may be submitted by anyone; the roster
550 proof (§10.4) has no author to authenticate, being a public computation anyone can run. The classical
551 dependency this creates is bounded: forging an account signature can only move **closure
552 timing and liveness**, never ballots or confidentiality (§12.5); every
553 confidentiality-relevant payload keeps post-quantum authentication (§10.4). An election
554 pins its committee in `wardenSetHash` (config leaf `0x3`, §7): `(ν, θ, epoch, the ν
555 registered (H(pk), H(pk_sig), account) triples)`. A voter's client fetches the ν public keys (from their URIs or any
556 sequencer), recomputes each hash and the set hash, and verifies it against the on-chain
557 value before casting; it refuses to cast otherwise. The registry refuses to create an
558 election whose warden set is not fully registered.
559 **Archival is a permissionless, untrusted role, not a per-warden duty.** EIP-4844 blobs are
560 pruned after ≈18 days, so for any longer election the history must be captured while it is
561 live, including L1-blob-mode blobs from their **publication** transactions, which precede
562 settlement (§8.6). Any party may serve as an archive provider with no registration: all served data is
563 authenticated by consumers against the accepted chain commitments (the registry's
564 `archiveAcc` manifest chain plus each blob's full commitment/versioned-hash binding;
565 recomputing the manifest fold alone does not authenticate returned bytes). The liveness
566 assumption is **at least one complete, available archive** spanning the casting period,
567 the complaint window, every tally attempt, and the declared retention period, including
568 ceremony and complaint publications, not only batch blobs. A deployment profile MUST
569 obligate each warden to live-capture and retain **its own tally inputs**: its per-package
570 ciphertexts `ct_i` (the column view stores only `Blake3(ct_i)`, §8.7), its column-view
571 streams, and all batch payload envelopes, through finalization plus the declared retention
572 period, with funded retention across every tally attempt (≈1.3 GB per million casts,
573 dominated by the ciphertexts). Authenticated catch-up from any archive remains a valid
574 recovery path for a temporarily offline warden: local capture is resilience, not a
575 participation prerequisite, and it does not replace the complete-public-archive assumption
576 above (ceremony and complaint publications included). A deployment profile SHOULD
577 additionally name at least one accountable archiver (organizer or warden set) even though
578 providers are untrusted.
579 Wardens MAY process incrementally during the voting period (decapsulation and share
580 recovery don't need to wait for the end); complaints may also be filed as soon as a package
581 settles (§9.2), and at the end the participants run one tally ceremony (§9-§10).
582- **Key modes.** *Committee* (lottery over registered operators) and *council*
583 (organizer-invited set) map 1:1 from v2: they only select *which* registered warden keys
584 form the set. *Sequencer mode* is the degenerate $\nu = \theta = 1$ case (the sequencer is
585 the only warden; ~1 KB per ballot, cheaper than v2; the sole operator can reconstruct
586 every ballot, a trust label deployments must surface, and the tally ceremony collapses to
587 one contribution proof, §10.4). **Locked mode is deferred**: it
588 requires an organizer-side share column and a separately reviewed extension of the tally
589 equations; it is not part of v3.0.
590
591---
592
593## Protocol overview: the full flow, end to end
594
595*A map of the whole protocol: who does what, in which order, and what travels where. It
596states no new rules; every step names the section that specifies it. Read it after [§2](#2-notation-parameters-and-encodings)-[§4](#4-roles-what-changed),
597or return to it whenever a later section needs the surrounding context.*
598
599**Parties.** Voter $\mathsf{V}$ (a browser; holds `address` and a PQ secret `sk`, [§11](#11-census-and-authentication)).
600Organizer $\mathsf{O}$. Wardens $\mathsf{W}_1..\mathsf{W}_\nu$, each with an ML-KEM pair
601$(pk_i, sk_i)$, an SLH-DSA pair and a settlement account ([§4](#4-roles-what-changed)); any $\theta$ produce the
602result. Sequencers $\mathsf{Q}$ (permissionless) collect, prove and settle. The registry
603$\mathsf{R}$ on Ethereum verifies every proof and alone writes election state. Blob space
604$\mathsf{DA}$ holds bulk data, captured by untrusted archives ([§4](#4-roles-what-changed), [§9.3](#93-liveness)). Anyone may relay a
605proof-carrying message.
606
607### Before the election
608
609- **Warden registration (per epoch, [§4](#4-roles-what-changed)).** $\mathsf{W}_i \to \mathsf{R}$:
610 $H(pk_i)$, $H(pk^{sig}_i)$, a settlement account, a URI serving both keys, and a ZisK
611 proof that $pk_i$ is well formed. No DKG, no election key ([§3](#3-the-core-idea-tally-without-a-shared-decryption-key)).
612- **Voter enrollment (once, [§11](#11-census-and-authentication)).** $\mathsf{V}$ draws `sk`, sets `pk_PQ = H(sk)` and
613 registers it in the PQKeyRegistry, authorized by its own address. Off-chain censuses may
614 use an organizer-published key map instead; CSP credentials carry `pk_PQ` themselves.
615- **Election creation ([§4](#4-roles-what-changed), [§7](#7-state-tree-changes), [§11](#11-census-and-authentication)).** $\mathsf{O} \to \mathsf{R}$: `censusRoot` (v2's
616 Keccak tree, unchanged), `pqKeyRoot` as of this transaction, the ballot rules, the auth
617 policy (`pq-only` | `hybrid` | `hybrid-legacy`), the deadline profile, the schedule, and
618 `wardenSetHash` over $(\nu, \theta, epoch, \text{the } \nu \text{ registered triples})$.
619 $\mathsf{R}$ rejects an unregistered committee and enforces the [§2.3](#23-protocol-parameters) bounds. The genesis
620 root is built by the first batch proof, not on-chain ([§7](#7-state-tree-changes)).
621
622### Casting (§5, §6)
623
624- **Key check ([§4](#4-roles-what-changed)).** $\mathsf{V}$ fetches $pk_1..pk_\nu$, recomputes `wardenSetHash` and
625 compares it on-chain; mismatch means no cast.
626- **Package ([§5.1](#51-public-package-contents-and-canonicalpackage), [§5.2](#52-construction-browser-pseudocode)).** Let $b_f$ be the voter's chosen value for field $f$ of the ballot,
627 $f \in 1..nf$, already weighted under the election rules. The browser turns the ballot
628 into a package in four steps.
629 - *Share.* For each field $f$ it picks a random polynomial $P_f$ of degree $\theta-1$
630 whose constant term is the vote, $P_f(0) = b_f$, and gives warden $i$ the evaluation
631 $s_{i,f} = P_f(i)$. Any $\theta$ shares of a field recover $b_f$; fewer reveal nothing.
632 - *Lock.* For each warden $i$ it encapsulates against that warden's ML-KEM key,
633 $(ct_i, K_i) \leftarrow \mathrm{Encaps}(pk_i)$: a public ciphertext $ct_i$ and a secret
634 $K_i$ that only warden $i$ can recover from it.
635 - *Mask.* From $K_i$ it derives `nf` pseudorandom masks, one field element per ballot
636 field, through a keyed hash stream ([§2.2](#22-domain-separated-contexts)), and publishes
637 $e_{i,f} = s_{i,f} + \mathrm{mask}_{i,f}$ instead of the share. Warden $i$ regenerates
638 the same masks from $K_i$; to everyone else the column is uniform noise.
639 - *Commit.* It hashes each warden's shares and secret,
640 $h_i = \mathrm{Blake3}(hCtx(i) \,\|\, s_{i,1..nf} \,\|\, K_i)$, folds them into
641 $\mathrm{sharesDigest} = \mathrm{Blake3}(h_1 \,\|\, \dots \,\|\, h_\nu)$, and binds slot and
642 identity to them in
643 $\mathrm{pkgCommit} = \mathrm{Blake3}(\mathrm{commitCtx} \,\|\, slot \,\|\, pk_{voter} \,\|\, \mathrm{sharesDigest} \,\|\, salt)$,
644 with a fresh 256-bit `salt` for hiding; `hCtx(i)` and `commitCtx` are the
645 domain-separation contexts of [§2.2](#22-domain-separated-contexts).
646
647 The public package is: the masked shares $E = (e_{i,f})$, the ciphertexts $(ct_i)$, the
648 commitments $(h_i)$, `pkgCommit`, and a `voteID` derived from a fresh random `k`. Shares,
649 polynomials, secrets and salt stay in the browser as witness of the proof below. Every
650 random value is fresh CSPRNG output, for every attempt.
651- **Proof ([§6](#6-the-ballot-proof-plonky3-stark)).** A browser STARK with publics
652 $(\text{context}, \theta, nf, \mathrm{voteID}, address, pk_{PQ}, slot, weight, E, h, \mathrm{pkgCommit}, \mathrm{Blake3}(cts))$
653 shows: the
654 ballot obeys the rules; each field's $\nu$ shares lie on one polynomial of degree
655 $\le \theta-1$ with constant term $b_f$; masks and $h_i$ match the secrets used; `voteID`
656 is derived correctly; the prover knows `sk` with $H(sk) = pk_{PQ}$. Not shown: that
657 $ct_i$ decapsulates to $K_i$ (complaints cover it, [§9.2](#92-complaints-and-the-exclusion-set-x-open-from-admission), [§10.2](#102-why-malformed-voter-transport-cannot-corrupt-anything)).
658- **Audit or cast ([§5.2](#52-construction-browser-pseudocode)).** The client must offer a Benaloh audit: open a candidate
659 package on a second device, discard it, build a fresh one. Audited packages are never
660 submitted.
661- **Submission ([§5.4](#54-submission-interface-voter-sequencer)).** $\mathsf{V} \to \mathsf{Q}$, private channel:
662 $\{\mathrm{Pkg}, \pi^{ballot}, \mathrm{censusProof}?, \mathrm{hybridSig}?\}$ (`?` marks an optional
663 component: the census proof only where the origin needs one, `hybridSig` only in hybrid
664 modes). A revote is the same message with a fresh package for the same slot ([§5.3](#53-revoting-slot-overwrites-hidden)). The client keeps every
665 voteID it released ([§5.2](#52-construction-browser-pseudocode)).
666
667### Batching and settlement (§8), per batch $b$ of $K$ packages
668
669The sequencer $\mathsf{Q}$ does everything in this stage until settlement, and proves all
670of it: the computation runs inside the batch program, a ZisK guest ([§8](#8-the-batch-program-zisk-guest); the program whose
671execution the zkVM proves), and the
672resulting batch proof $\pi^{batch}$ is what the registry $\mathsf{R}$ verifies before
673accepting the batch. Nothing $\mathsf{Q}$ asserts is taken on trust.
674
675- **$\mathsf{Q}$ collects.** It gathers $K$ submitted packages with their ballot proofs,
676 loads the current state tree, the census and the key map, and draws a fresh batch seed
677 from its CSPRNG. These are the inputs of the batch program.
678- **$\mathsf{Q}$ re-checks every package and proves it ([§8.1](#81-ballot-proof-verification-measured-cost), [§8.2](#82-census-authentication-binding)).** For each package it
679 rebuilds the ballot proof's public vector from the package bytes and the election data,
680 verifies $\pi^{ballot}$ against it, proves the voter's census membership and key-map
681 lookup (present key, or proven absence under `hybrid-legacy`), checks that one
682 `address` runs through census leaf, key map and ballot publics, and verifies `hybridSig`
683 where the policy asks. A package failing any check is not admitted.
684- **$\mathsf{Q}$ computes and proves the state transition ([§7](#7-state-tree-changes), [§8.3](#83-state-transitions), [§8.4](#84-hidden-writes)).** For each admitted package it
685 inserts the leaf `voteID → pkgDigest`, derives the package's slot from the census, and
686 checks that no two packages in the batch share a slot. A slot written for the first time
687 gets the `OCCUPIED` marker and is listed publicly; a slot already occupied is an
688 overwrite and gets no public mark at all. The batch's public outputs about slots are
689 the first-write list and the counters, nothing more.
690- **$\mathsf{Q}$ seals the write log for the wardens, in-proof ([§8.5](#85-the-warden-payload-kem-dem-proven)).** From the seed, bound to the
691 batch contents, it derives a batch key $k_b$ and encrypts under it the write log
692 $L_b$, the slot of each admitted package in voteID order. It then Shamir-shares $k_b$
693 $\theta$-of-$\nu$ and wraps share $i$ to warden $i$'s key $pk_i$ with one in-guest ML-KEM
694 encapsulation plus a salted commitment to the share. $\pi^{batch}$ ties every log entry
695 to its package's census-derived slot, so a wrong or missing payload cannot be proven.
696- **$\mathsf{Q}$ commits to each warden's column ([§8.7](#87-per-warden-column-views-normative)).** Of every admitted package,
697 warden $i$ will later need only its own slice: `voteID`, `pkgDigest`, its masked shares,
698 its $h_i$ and a hash of its $ct_i$. The batch program hashes those slices per warden,
699 together with the first-write list and the payload, into a running accumulator
700 `viewAcc[i,b]` chained from batch to batch, and stores the hash of all $\nu$
701 accumulators, `viewsRoot[b]`, in the state tree. A warden's tally proof later shows it
702 processed exactly these records by recomputing the chain up to the frozen `viewsRoot`,
703 instead of re-hashing every full package in the archive.
704- **$\mathsf{Q}$ publishes and settles ([§8.6](#86-blob-layout-v3-and-da-numbers)).** $\mathsf{Q} \to \mathsf{DA}$: a header, the admitted
705 packages in voteID order, the first-write slots, and the warden payload.
706 $\mathsf{Q} \to \mathsf{R}$: $\pi^{batch}$ with its public outputs
707 `(oldRoot, newRoot, counters, censusRoot, pqKeyRoot, blobsDigest)`. The ballot proofs and
708 `hybridSig` stay with $\mathsf{Q}$ and never reach the blobs ([§5.4](#54-submission-interface-voter-sequencer)).
709- **$\mathsf{R}$ accepts the batch ([§7](#7-state-tree-changes), [§8.6](#86-blob-layout-v3-and-da-numbers)).** It verifies $\pi^{batch}$, binds the blobs
710 through `blobhash` and the point-evaluation precompile, requires `oldRoot` to equal the
711 stored root (or the genesis predicate for the first batch), stores `newRoot`, folds the
712 batch into `archiveAcc`, and retains the `(batchNumber, viewsRoot)` checkpoint. Only now
713 do the packages count as admitted.
714- **Archives and wardens follow along ([§4](#4-roles-what-changed), [§10.1](#101-what-each-participating-warden-computes)).** Archives capture every blob
715 while it is live. Each warden $\mathsf{W}_i$ may, at any time, read its own column from
716 the blobs, decapsulate its ciphertexts $ct_{v,i}$, recover its shares $s_{v,i,f}$ and
717 check them against $h_{v,i}$, so that most of its tally work is done before casting ends.
718
719### Complaints and freeze (§9)
720
721- **Complaints, from first admission ([§9.2](#92-complaints-and-the-exclusion-set-x-open-from-admission)).** If $\mathrm{Decaps}(sk_i, ct_{v,i})$ is
722 inconsistent with $h_{v,i}$, $\mathsf{W}_i$ proves it in ZisK; anyone relays to
723 $\mathsf{R}$, which appends `pkgDigest` to $X$. $X$ is append-only and alters no state. A
724 voter with a broken client sees the exclusion and revotes ([§5.3](#53-revoting-slot-overwrites-hidden), [§14](#14-errors-and-edge-cases-normative)).
725- **Casting freeze ([§9.1](#91-casting-freeze)).** At grace-window close $\mathsf{R}$ freezes $R_{cast}$, the
726 view checkpoint and the counts $C$ (casts), $M$ (batches); computes
727 $d_{complaint} = t_{freeze} + d_0 + \alpha C + \beta M$ and the ceremony stage durations
728 from the pinned profile ([§2.3](#23-protocol-parameters)). No accepted batch: zero result, done.
729- **Exclusion freeze ([§9.2](#92-complaints-and-the-exclusion-set-x-open-from-admission)).** Wardens may signal scan-complete; all $\nu$ signals close
730 early. At $d_{complaint}$ or early close, $X$ freezes and
731 $\mathrm{snap} = (R_{cast}, \mathrm{xDigest}, \mathrm{batchCount}, \mathrm{viewsRoot})$ is
732 fixed; attempt 1 starts.
733
734### Tally (§10), per attempt
735
736One pass through the five stages below is an attempt. Attempt 1 starts at the exclusion
737freeze; if it fails (last bullet) anyone starts the next, and everything attempt-scoped is
738drawn fresh while the snapshot and the batch keys stay fixed ([§10.4](#104-the-batch-key-exchange-and-the-session-state-machine)).
739
740- **Join ([§10.4](#104-the-batch-key-exchange-and-the-session-state-machine)).** $\mathsf{W}_i \to \mathsf{R}$ from its settlement account: an ephemeral
741 ML-KEM key $epk_i$ for this attempt, SLH-DSA-signed with context, `snap` and attempt.
742 Long-term keys never receive ceremony ciphertexts.
743- **Roster ([§10.4](#104-the-batch-key-exchange-and-the-session-state-machine)).** Anyone submits $\pi^{roster}$ (no secret witness) judging every join:
744 valid signature, valid key. Valid joins form $\Pi$, $|\Pi| \ge \theta$; then $\mathsf{R}$
745 derives `sessionId`. Senders re-run the roster program before encrypting to any $epk_j$.
746- **Dealer bundles ([§10.3](#103-the-zero-blinding-ceremony)).** Each $\mathsf{W}_k \in \Pi$ draws per-field $g_{k,f}$ with
747 $g_{k,f}(0) = 0$, commits to each $g_{k,f}(i)$, delivers it KEM-DEM to $epk_i$ for all
748 $i \in \Pi$, and proves all of it (the proof also authenticates $k$). Dealers verified by
749 the deadline form $D$, $|D| \ge \theta$, immutable.
750- **Share bundles ([§10.4](#104-the-batch-key-exchange-and-the-session-state-machine)).** Each $\mathsf{W}_i \in \Pi \to \mathsf{DA}$: one signed bundle
751 of its [§8.5](#85-the-warden-payload-kem-dem-proven) shares for all batches, encrypted under a fresh bundle key wrapped to every
752 $epk_j$, $j \in \Pi \setminus \{i\}$. Each member validates received shares against the batch
753 commitments, rebuilds every $k_b$ from $\theta$ valid shares, decrypts every $L_b$, and
754 learns the write history ([§12.2](#122-what-wardens-and-insiders-learn)).
755- **Contributions ([§10.1](#101-what-each-participating-warden-computes)).** $P_s$ = the package the logs assign to slot $s$ in the
756 highest batch. $\mathsf{W}_i \to \mathsf{R}$: $S_{i,f} = \sum_{s: P_s \notin X} s_{P_s,i,f} + G_f(i)$
757 with $G_f = \sum_{k \in D} g_{k,f}$, plus a ZisK proof of complete,
758 exactly-once processing against the frozen views that opens every counted $h$. No
759 output says how many were counted or excluded.
760- **Finalization ([§10.1](#101-what-each-participating-warden-computes)).** After $\theta$ valid contributions anyone calls
761 `finalizeResults`; $\mathsf{R}$ interpolates the $S_{i,f}$ at $x = 0$ on-chain. Since
762 $\deg P_f \le \theta-1$ and $G_f(0) = 0$, the value is the exact per-field tally ([§3](#3-the-core-idea-tally-without-a-shared-decryption-key),
763 [§10.3](#103-the-zero-blinding-ceremony)). Emits `ProcessResultsSet`; participants destroy ephemeral keys, bundle keys and
764 every $k_b$.
765- **Failure ([§10.4](#104-the-batch-key-exchange-and-the-session-state-machine)).** Missing participants cost margin only. An attempt fails iff
766 $|\Pi| < \theta$, $|D| < \theta$, or $< \theta$ contributions at the respective deadline;
767 then anyone advances to attempt $+1$ with fresh randomness and the same $k_b$. Sequencer
768 mode ($\nu = \theta = 1$): only the contribution proof remains.
769
770---
771
772## 5. The ballot package
773
774A vote is one **package**. Its public part goes into blobs; its private part exists only in
775the voter's browser. **A revote needs no reference to any earlier package**: it is a fresh
776package for the same slot (§5.3).
777
778
779
780### 5.1 Public package contents and CanonicalPackage
781
782| # | Field | Size (ν=8, nf=16, ML-KEM-768) | Description |
783|---|---|---|---|
784| 1 | `version` | 1 B (`0x04`) | package format version |
785| 2 | `processID` | 31 B | as v2 |
786| 3 | `voteID` | 8 B LE | §5.2; also the package's mask nonce (§2.2) |
787| 4 | `E` | ν·nf·8 B = 1,024 B | masked shares for the **nf active fields only** (§2), row-major (warden-major, field-minor), canonical LE |
788| 5 | `cts` | ν·1,088 B = 8,704 B | ML-KEM ciphertexts, warden order 1..ν |
789| 6 | `h` | ν·32 B = 256 B | commitments $h_i = \mathrm{Blake3}(hCtx(i) \,\|\, s_{i,1..nf} \,\|\, K_i)$, over exactly nf canonical LE8 shares; salted unkeyed Blake3 per §2.3 (the secret $K_i$ and shares are the hiding material here) |
790| 7 | `pkgCommit` | 32 B | $\mathrm{Blake3}(\mathrm{commitCtx} \,\|\, slot \,\|\, pk_{\text{voter}} \,\|\, \mathrm{sharesDigest} \,\|\, \mathrm{salt})$. Hiding comes from `salt`, an independent **256-bit CSPRNG commitment salt** kept in the package opening (share entropy alone is NOT enough: given θ−1 shares and a candidate ballot, the whole polynomial is determined) |
791| 8 | `hybridSig` | 65 B or absent | hybrid mode only: ECDSA over `pkgDigest`, Ethereum personal-message format (§11); travels voter→sequencer→batch guest only, **never published** (§5.4) |
792
793Per-package size: `72 + ν·(32 + 1088 + 8·nf)` bytes. There is no predecessor digest and no
794chain counter (both existed in drafts ≤1.3 and were removed with the nullifier machinery,
795§5.3). `CanonicalPackage` = the concatenation of fields 1-7 exactly as listed (fixed order,
796sizes derived from the authenticated election parameters, no framing).
797**`pkgDigest = Blake3(CanonicalPackage)`** is the package's identity: it is the value stored
798at the vote-ID leaf and what complaints reference.
799**`sharesDigest = Blake3(h_1 ‖ … ‖ h_ν)`**. Despite the name it
800binds the shares *through* the per-warden commitments $h_i$ (each AIR-bound to the exact
801$(s_i, K_i)$ used in masking, fixed order and count), which is equivalent binding at a
802fraction of the in-circuit hashing cost. $pk_{\text{voter}}$ in `pkgCommit` is the
803authenticated identity binding of §6 (`address` and `pk_PQ`), never an independent
804witness-only key. The ballot STARK (~195 KB at the pinned profile) accompanies the package to
805the sequencer but is **not** published in blobs.
806
807### 5.2 Construction (browser, pseudocode)
808
809```text
810k = fresh random scalar (CSPRNG — always; see "Client state" below)
811voteID = N + trunc63(Blake3("v3/voteid" || processID || address || k))
812 # trunc63 = lowest 63 bits;
813 # N = 2^63 (v2's namespace offset)
814for f in 1..nf:
815 poly_f = random polynomial, degree θ-1, poly_f(0) = ballot[f] # active fields only
816s[i][f] = poly_f(i) # ν shares per active field
817for i in 1..ν:
818 (ct[i], K[i]) = MLKEM.Encaps(pk_warden[i]) # fresh randomness per package, NEVER reused
819 stream = Blake3.keyed(K[i], streamCtx(i)).xof(16·nf bytes) # ONE mask stream per warden (§2.2);
820 # UNCHANGED per-field offsets — field f
821 # always uses bytes [16(f-1),16f)
822 for f in 1..nf: e[i][f] = s[i][f] + LE128(stream[16(f-1)..16f]) mod p
823 h[i] = Blake3(hCtx(i) || s[i][1..nf] || K[i])
824salt = fresh 256-bit CSPRNG value # hiding salt, kept in the opening
825sharesDigest = Blake3(h[1] || .. || h[ν])
826pkgCommit = Blake3(commitCtx || slot || pk_voter || sharesDigest || salt)
827ctsDigest = Blake3(ct[1] || .. || ct[ν]) # binds the ciphertext bytes (§6)
828proof = BallotSTARK.prove(...) # §6
829```
830
831ML-KEM encapsulation costs ~1-2 ms per warden in browser WASM [KEMB]; the dominant client
832cost is the STARK (§6). **Freshness warning:** encapsulations are fresh per package and per
833attempt, including candidate packages that are never admitted. Reused KEM randomness yields
834identical ciphertexts (publicly linkable); actual *pad* reuse (same key AND same stream
835context) would publish the difference of two sharings, which interpolates to the ballot
836difference. Distinct voteIDs give distinct stream contexts for admitted packages, but
837clients must keep freshness across retries and rejected submissions too.
838
839**Client state: losing it never blocks voting.** All package randomness (`k`, the polynomials,
840the KEM randomness, the salt) is **independent CSPRNG randomness, always**. Because a
841revote is just a fresh package for the same slot (§5.3), **no predecessor opening is ever
842needed again**: a voter who loses every bit of client state simply casts a new package from
843any device holding their census secret, and it overwrites the slot. Drafts ≤1.3 had a
844deterministic "recovery mode" (deriving randomness from `sk`) to restore revoting after
845device loss; with its only justification gone, it is **removed**, which also closes two
846coercion channels it created (an `sk` holder could enumerate the voter's voteIDs and
847reconstruct their historical ballots). This matches v2 exactly: v2's `voteID` also uses
848fresh, underivable randomness per ballot. One thing is worth keeping, though: the client
849MUST retain the `voteID` of every package it has ever released to a sequencer and report
850a vote as "finally counted" only if it is the **latest admitted** of them. A sequencer
851that holds an older authorized package can still settle it later and roll the slot back
852(last settled write wins, §5.3); the voteID leaf of that package then appears in the
853state, which is how the voter sees it and casts again. A client that lost this list
854cannot notice such a rollback.
855
856**Cast-as-intended (Benaloh audit, a normative client flow).** Before submitting, the client
857MUST offer an *audit-or-cast* choice: the voter may demand the candidate package's **full
858opening** (ballot values, polynomials, `k`, salt, KEM coins) and verify on a second device
859that the package encodes the intended ballot. That package is then **permanently
860discarded** (its secrets are exposed; the §5.2 freshness rule already forces completely new
861randomness per attempt) and the client builds a fresh one, which the voter either audits
862again or casts *unaudited*. Any number of audit rounds is allowed; an audited package MUST
863never be submitted (and since its secrets left the device, its voteID belongs on the
864watch list above). This is the standard Benaloh challenge: the client cannot predict which
865candidates will be audited, so a cheating client is caught with probability growing in the
866number of audits. v2 left cast-as-intended entirely to applications; v3 makes the client
867obligation normative.
868
869### 5.3 Revoting: slot overwrites, hidden
870
871v2 overwrote the voter's slot and subtracted the stored ciphertext homomorphically. v3
872keeps the rule and drops the bookkeeping: **a revote is an ordinary fresh package for the
873same slot**. The batch program checks that the package belongs to that slot and records
874the pair in the batch's encrypted write log (§8.4, §8.5). Nothing else happens: no stored
875value is replaced, nothing is subtracted, and nothing public names the slot. The voter's
876proof authorizes writing *their own slot* (identity + census binding, §6/§8.2), nothing
877more.
878
879
880
881- **No nullifiers, no predecessor consumption, no chain counter, no revote budget.** Drafts
882 ≤1.3 enforced a "one-live-chain" rule through published revocation nullifiers; adversarial
883 review established that any public, voter-derivable (or finite, demandable) spend object
884 re-creates a coercion test: a coercer holding the token, or demanding the remaining
885 posting rights, detects replacement. The slot-overwrite model has **no
886 predecessor-status spend object at all**. The only public effects of a revote are a new
887 voteID receipt and one more overwrite in the batch's public count.
888- **No refreshes.** v2 re-encrypted a random sample of other slots in every batch so that
889 an overwritten slot would not stand out, and drafts ≤1.5 imitated that with re-blinded
890 slot vectors. Both needed the cover only because an overwrite left a public mark on its
891 slot. Here it leaves none, so there is nothing to cover: the sample, its sizing rule and
892 the trust in the sequencer's sampling randomness are gone, and a revote hides among
893 every slot that has already voted, not among a sample (§12.1).
894- Invariants enforced by the batch program: a slot's **first write** inserts its marker
895 and is counted (`votersCount ≤ maxVoters`); a slot admits **at most one ballot per
896 batch** (the structural rate limit); exclusions never reset occupancy (§9.2).
897- **No lifetime cast cap: a deliberate decision, as in v2** (which never bounded revotes).
898 Review rejected both alternatives. A flat global cap is capturable by an attacker with
899 enough admissions ($\min(s,b)\cdot m \ge T$), and a two-pool cap (first-votes vs
900 overwrites) is worse: exhausting the overwrite pool would permanently block every later
901 escape vote and complaint recovery while casting is still open. Deliberate cast inflation
902 is instead bounded structurally (≤1 per slot per batch ⇒ a lone voter adds at most $M$
903 casts), priced by admission (STARK proving + sequencer fees + DA per cast; sequencers
904 are free to rate-limit, v2's exact posture), and provisioned by the **adaptive
905 workload-derived deadlines** of §2.3/§9.2. If a deployment needs a hard ceiling, it
906 SHOULD be a per-block settlement rate limit in the profile, never a lifetime admission
907 budget. The cost shift is real: v2 wardens did O(1) work regardless of casts; v3 warden
908 work is linear in admitted casts, so a funded processing commitment sized by the adaptive
909 formula is a real liveness requirement (§9.3), and "admission is priced" is not a
910 substitute (an attacking sequencer pays itself).
911
912Ordering: within a slot, the **last settled write wins**, v2's exact semantics, including
913its caveat that ballots sent to different sequencers have no common order (voters should
914revote through one sequencer, as v2 advises, and clients watch their own voteIDs, §5.2).
915
916**What the voter can and cannot check.** v2 let a voter see that their slot had not been
917touched since their last vote. With hidden writes that signal is gone, by design: it is
918the same signal a coercer would use. What remains is enough for an honest voter. Nobody
919can write a slot without that voter's own authorization proof, every package the voter
920ever authorized has a voteID the voter knows, and admissions are public and ordered. So
921the voter always knows which of *their own* packages was admitted last. What they can no
922longer observe is an overwrite by a package they did not build, which takes their
923identity key (or, for CSP censuses, a CSP that issued the same index twice; or, for
924address-derived slots, a census that admitted two addresses with the same slot, which
925v2 requires census contracts to reject and which anyone can check on a public census list).
926
927### 5.4 Submission interface (voter → sequencer)
928
929The voter submits to one sequencer, over an encrypted channel as in v2:
930`{CanonicalPackage, hybridSig?, ballotProof, censusProof?}`. A revote is byte-identical in
931shape to a first vote. The sequencer (and its prover) still **learns which slot each
932package it seals belongs to, hence which are overwrites** (it sees the census-derived slot
933and its occupancy, the same boundary as v2, where the sealing sequencer learns which
934updates are overwrites). It never learns ballots, shares,
935masks, or `sk`: those stay inside the STARK witness.
936
937**What never enters public data availability:** `hybridSig` (a recoverable signature would
938link the package to its Ethereum address), the ballot proof, and the inner proof's public
939vector all stop at the voter→sequencer→guest boundary.
940Blobs carry only `CanonicalPackage` and the batch-level data of §8.6.
941
942---
943
944## 6. The ballot proof (Plonky3 STARK)
945
946The Groth16 circuit is replaced by a STARK over Goldilocks, proven in the browser via WASM:
947the production descendant of the davinci-stark prototype [DST], minus its elliptic-curve
948section. No trusted setup.
949
950**Public inputs: the raw public vector.** There is no binding hash (v1.0's `inputsHash` is
951removed): the proof exposes the public statement **directly as a pinned, ordered vector of
952Goldilocks elements/limbs**, exactly these elements, in this order (the byte/limb layout is
953part of the complete proof profile fixed before `ballotVKHash` is pinned, end of this
954section): `version` · `chainID` · `registry` · `processID` · `wardenEpoch` · `ν` · `θ` ·
955`nf` · `packedBallotMode` · `voteID` · the identity binding (`address` limbs and `pk_PQ`) ·
956`slot` · `authMode` · `weight` · all `E` coordinates (ν·nf elements) · all `h_i`
957(ν × 8×32-bit limbs) · `pkgCommit` limbs · `ctsDigest` limbs. Everything the relation
958depends on is in this vector or fixed by the pinned verification key: in particular the
959share polynomials' degree bound comes from the **public θ**, and `pkgCtx` (§2.2) is derived
960from the public context values. (Drafts ≤1.5 listed neither θ nor the context parameters;
961with θ free, a voter could have proven a degree-2 sharing in a 2-of-3 election, whose
962three warden pairs interpolate to three different values.) The package's `version` byte
963is the `protocolVersion` of `pkgCtx`: one value. `nf` MUST equal the field count unpacked
964from `packedBallotMode`. There is no `isRevote` flag, no predecessor digest
965and no nullifier in the publics: the guest determines first write vs overwrite from slot
966occupancy alone (§5.3). The vector layout is
967length-prefixed per (ν, nf) and never truncates. `ctsDigest = Blake3(cts)` is computed *outside*
968the circuit and enters as opaque limbs, which **binds** the ciphertext bytes without proving
969anything about ML-KEM.
970
971**Statement contract (normative).** The batch program **constructs the expected public
972vector itself**, from the canonical package it admits, the authenticated election
973parameters (ν, θ and `wardenEpoch` by opening `wardenSetHash`; `chainID` and `registry`
974from the registry-checked batch statement), and the authenticated census and key-map data
975(§8.2), and
976verifies the proof against *that* vector. It never verifies a supplied vector and then
977processes different package data. Inside the AIR, every value used by ballot validation,
978share generation, masking and commitments is constrained equal to
979these publics, so an admitted package is byte-for-byte the one the voter's proof authorized.
980`censusRoot` is **not** a ballot public input: membership is the batch program's job (§8.2).
981Privacy note: the inner proof's public inputs live at the voter→sequencer/guest boundary;
982they are **not** published in blobs beyond what the package itself already publishes.
983
984**The proof shows:**
9851. **Ballot validity** — v2's ballot protocol (ranges, uniqueness, cost sum vs
986 `maxValueSum`/weight, `ballotMode` unpacking), with three normative strengthenings over
987 the v2-era prototype: the weight bound is enforced when `maxValueSum = 0`; all comparisons
988 use sound borrow-checked integer gadgets (no Goldilocks wraparound); and the cost sum is
989 computed overflow-safe under the enforced integer-cost profile (§2.3).
9902. **Share consistency** — for every active field, the ν shares lie on one polynomial of
991 degree ≤ θ−1 whose constant term is the ballot value (inactive fields simply don't exist
992 in the package, §2 zero extension). Cost: ν·nf·(θ−1) multiplications, trivial for the
993 AIR.
9943. **Mask consistency** — $e_{i,f} = s_{i,f} + \mathrm{mask}_{i,f}$ where the nf masks of
995 warden $i$ are the LE128-mod-$p$ slices of the single keyed XOF stream
996 $\mathrm{Blake3.keyed}(K_i, \mathrm{streamCtx}(i))$ (§2.2, fixed per-field offsets), with
997 the same $(s_i, K_i)$ committed in $h_i$.
9984. **voteID derivation** from `(processID, address, k)` (Blake3, §5.2), with all of these
999 bound in the public vector.
10005. **Authentication** (§11): knowledge of `sk` with `H(sk) = pk_PQ`, where `pk_PQ` is a
1001 public input that the **batch program** binds to the voter's address through the
1002 election's PQ key map (§8.2); neither census membership nor the key lookup is proven in
1003 the ballot AIR. For an unenrolled voter in a hybrid-legacy election (`pk_PQ = 0`, with
1004 the address proven **absent** from the key map), identity rests on `hybridSig` alone
1005 (§11).
1006 **There is no revote clause**: first votes and revotes prove the identical statement
1007 (drafts ≤1.3 had predecessor-opening, nullifier and counter clauses here, removed with
1008 §5.3's redesign, which also removes their witnesses and hashing from the AIR; the
1009 instrumented-count gate (§15) measures the net shrink, which must be confirmed, not
1010 assumed, since fewer constraints need not cross a trace-padding boundary). Authentication
1011 relies on the proof system's **knowledge soundness**: the proof must establish that the
1012 prover *knows* the preimage/witness (bound to this entire authorized package), not merely
1013 that one exists.
1014
1015**The in-AIR Blake3 section.** All in-circuit hashing runs in a **re-laid Blake3 section**
1016(~25-32 rows per compression at the circuit's width). Compression budget under the
1017§2.2 stream-masking definition: per warden ≈ 1 context block + ⌈nf/4⌉ XOF output blocks for
1018the masks + ≈4 for $h_i$ at nf=16 (its input is 32 + 8·nf bytes plus context fields; 4.00 measured in the tally kernel, Annex A.2); plus ≈ 8 for
1019`pkgCommit`, `sharesDigest` and voteID (the `NULL`/counter hashing of drafts ≤1.3 is gone).
1020That is **provisionally ≈ 53 compressions at ν=5/nf=16** (5 × (1 + 4 + 4) + 8), **fewer at smaller nf**, to be fixed by
1021instrumented counts of the exact canonical encodings (first votes and revotes prove the
1022same statement). Earlier drafts said ~45/~110 against a per-field masking rule that would
1023actually have needed ≥ 80/256; the stream rule above is what makes counts this low possible.
1024It MUST constrain full standard-Blake3 semantics, not merely a compression gadget:
1025canonical input bytes, exact lengths and zero padding; correct IV / keyed / `derive_key`
1026initialization per mode; the full 7-round schedule with both feed-forward halves; the
102764-byte-block and 1024-byte-chunk structure with correct counters and
1028`CHUNK_START`/`CHUNK_END`/`ROOT` flags; correct chaining between compressions; XOF
1029output-block counters (an XOF is a seekable stream, not repeated hashing); outputs
1030constrained equal to the values consumed elsewhere in the AIR; and selector/phase
1031constraints that cannot skip or disconnect any check. (The instrumented-count gate of §15
1032re-counts the budget against the final relation.) Negative test vectors regenerate
1033otherwise-correct traces with wrong flags, counters, lengths or chaining values.
1034
1035What the proof deliberately does **not** show: that `ct_i` decapsulates to the committed
1036$K_i$. Proving ML-KEM in-circuit would drag SHAKE through the AIR. Instead, mismatched
1037transport is *harmless to integrity* (no tally proof ever runs Decaps, §10.2) and *publicly
1038excludable* (complaints, §9.2). Proving the encapsulation **in-AIR** (§15 item 1) removes this
1039trade-off entirely and is the main tracked upgrade.
1040
1041**Indicative numbers.** Measured on the prototype [DST]: the Blake3 Merkle/challenger profile
1042proves in **0.69 s native** (vs 3.2 s for the old Poseidon2 profile) with **~324 KB proofs**;
1043a standalone Blake3 compression AIR costs ≈3.4 ms/compression at its wide layout. The
1044full-Blake3 ballot (re-laid in-AIR section) is a **projection, not a measurement**:
1045**~2-4 s native (ν-dependent; the blowup-32 profile costs ≈2.45× the old blowup-8 prover time, bought back for the batch guest, §8.1)**, ~195 KB proofs, to be re-benchmarked once the
1046re-laid AIR exists (equal cell counts do not guarantee equal proving cost; the degree and
1047quotient profile must be recomputed). Browser proving is expected at a few × native (mobile
1048slower, to be benchmarked; the proof uploads once to one sequencer and is never stored
1049on-chain). Annex A.4 measures the proof-system side at the pinned profile on the prototype
1050circuit: 1.7 s native single-thread, 4.5-5.2 s in WASM at 478 MiB peak, WASM ≈2.6-3.0×
1051native, with a blowup-8 → 32 multiplier of 2.45× (2.0× in WASM). Benchmark provenance: all prototype figures in this document come from internal
1052prototype commits; exact commits, hardware, compiler flags and proof settings will be
1053published with the reference implementation. Standing adoption gates (from review): fix the
1054vendored challenger's wasm32 query-sampler bug; production hiding CSPRNG; implement full
1055Blake3 chunk/tree semantics over the `blake3f` precompile with boundary-length test vectors
1056(0/63/64/65/1023/1024/1025 B); measure real browser and whole-batch guest costs before
1057deployment guarantees. Before `ballotVKHash` is pinned, the **complete proof profile** must
1058be fixed and published: the challenge extension field and its defining polynomial; trace
1059shapes, maximum constraint degree and quotient construction; FRI folding and final-polynomial
1060parameters; hiding dimensions and the blinding-randomness source; the complete Fiat–Shamir
1061transcript (observe/sample schedule, domain-separated initialization, the Merkle-commitment (MMCS) matrix layout and shape
1062checks, serialization); and the knowledge-soundness assumptions with the claimed quantum
1063security model.
1064
1065---
1066
1067## 7. State tree changes
1068
1069Same sparse-Merkle-tree structure, depth 64, same namespaces as v2, now hashed with
1070**Blake3** (leaf: `Blake3(key_LE8 ‖ value_32 ‖ 0x01)`, node: `Blake3(left ‖ right)`), plus
1071four changes:
1072
1073
1074
10751. **Vote-ID leaves carry the package digest**: `voteID → pkgDigest` (v2 stored 0). This is
1076 the voter's immutable inclusion receipt, and what complaints authenticate against.
1077 Vote-ID leaves are never removed, so a state root never recurs.
10782. **Slot leaves hold a constant marker.** A slot's leaf is absent until its first write,
1079 which inserts the fixed 32-byte value `OCCUPIED = Blake3("davinci-slot-occupied-v3")`.
1080 The leaf never changes again and is **never package-derived**: nothing in the state
1081 says which package a slot currently counts, so there is nothing to compare a published
1082 package against. Occupancy is all a sequencer needs from the state to seal the next
1083 batch, so **any sequencer can admit a write to any slot without any earlier sealer's
1084 secret** (permissionless sequencing preserved; a vanished sequencer blocks nothing).
1085 Drafts ≤1.5 stored a blinded vector of the slot's masked shares here; v1.5's tally
1086 stopped reading it, and it is removed (§8.4).
10873. **Config namespace**: `0x3` = `wardenSetHash` (§4) instead of an encryption key; `0x4`
1088 and `0x5` **reserved under this version** (drafts ≤1.5 kept the accumulator digest at
1089 `0x4`, drafts ≤1.3 the revocation-nullifier SMT at `0x5`). **`0x8` (reserved in v2) =
1090 `viewsRoot`, the per-warden column-view commitment of §8.7**, updated by every
1091 transition (`0x6` is `censusOrigin`, inherited from v2 and not reusable).
10924. **Genesis predicate replaces on-chain genesis computation.** The EVM has no Blake3
1093 precompile, so the registry no longer computes the genesis root itself. Instead it stores
1094 the election parameters and an **initialization flag**, and the **first transition's batch
1095 proof constructs the genesis tree deterministically in-guest** from the registry-supplied
1096 parameters: the canonical empty tree plus *exactly* the prescribed config leaves, **the
1097 pinned empty-view encoding of leaf `0x8` (per-warden `viewAcc[i, genesis]`, §8.7)**, no
1098 slots, no packages, correct initial counters. It then proves `oldRoot` equals that
1099 construction.
1100 Membership proofs under a prover-chosen root are **never** accepted as a substitute (they
1101 show presence, not absence of extra state). Registry rules: the genesis branch is
1102 selected by the stored initialization flag (never caller input); parameters come from
1103 registry storage, not calldata; the first transition and initialization are recorded
1104 atomically; thereafter `oldRoot == storedRoot` always, and re-initialization is
1105 impossible; the outer proof binds the full `(chainID, registry, processID)` (not just
1106 v2's 4-byte prefix). There is **no zero-ballot transition**: an election with zero
1107 accepted transitions never initializes and finalizes by the §9.1 short-circuit (the
1108 canonical genesis and empty-view encodings stay pinned here; the first real transition
1109 still constructs them).
1110
1111---
1112
1113## 8. The batch program (ZisK guest)
1114
1115In one line: the batch program is the referee. It re-checks every vote package, applies the
1116state updates, and seals the record of which slot each package wrote.
1117
1118Same role, same settlement flow, same public-output pattern (`ok`/`failMask`, old/new roots,
1119counters, census root, blobs digest) as v2, plus `pqKeyRoot` (§8.2). The constraint groups change as follows.
1120
1121
1122
1123### 8.1 Ballot proof verification: measured cost
1124The program verifies the K ballot STARKs of a batch **in-guest**, and this is the dominant
1125cost of the v3 batch program. It has been measured on the real emulator and proven on a
1126GPU (a ZisK guest running the Plonky3 verifier at the pinned profile of §2.3; internal
1127prototype, with exact commits, hardware and flags to be published with the reference
1128implementation, §6). Two caveats apply to every number here. The proofs being verified
1129come from the **prototype ballot circuit** (2,048 × 379 trace, 123 public values), not the
1130final §6 AIR, whose trace width and public vector differ; verification cost depends on
1131both, so these figures are a measured baseline, not the final number. And the times are
1132the STARK stage only; the wrap that makes a proof verifiable on-chain is priced separately
1133in Annex A.1.
1134
1135Unoptimized, one verification costs ≈14.5M guest steps (22.1M at the former
1136blowup-8/34-query profile), of which hashing through the `blake3f` precompile is only
1137~1.5M (4,681 compressions); the rest is FRI field arithmetic, Merkle path bookkeeping, the
1138symbolic constraint rebuild and proof deserialization. A reviewed optimization pass with
1139no new precompile brought that to **2.53M steps per additional proof plus ≈2.7M once per
1140batch** (2.62M averaged over a 32-proof batch): the symbolic rebuild is hoisted to once
1141per batch since all proofs share one AIR; Goldilocks inversions use the existing
1142`uint256_inv_mod` `fcall` hint (hint plus multiply check, the mechanism ZisK already uses
1143for secp256k1 and BN254 inverses); opened rows are hashed as words, not byte streams; and
1144a differentially-tested fork of the FRI verifier factors query-independent sums. The
1145first two are **normative implementation requirements**.
1146
1147On one RTX 5090 (cargo-zisk 1.3.0-alpha), verification proves at **0.333 s per proof once
1148the GPU is saturated** (K ≥ 64; small batches measured 0.30 s and understate it), on top
1149of a ≈10 s fixed proving pipeline per batch. A **combined guest** running this
1150verification together with the per-package state work of §8.2-§8.7 has been proven end to
1151end up to K = 256: 2.71M steps per package, 104 s for a 256-ballot batch, 1.4 to 2.5
1152votes per second per GPU for K = 32 to 256 (Annex A.1, which also states what that guest
1153does not yet include). For comparison, v2's production benchmark on the same class of machine (one RTX 5090,
1154ZisK 1.3.0 against 1.3.2 here)
1155proves a 256-vote, 16-field batch in 76.7 s including its wrap, and v3's combined guest
1156takes 107 s including its wrap: v3's post-quantum ballots cost roughly 1.3 to 1.4× v2's
1157proving per vote at 16 fields (2.3× against v2's cheapest 2-field ballots), not the 25×
1158that pre-optimization drafts of this section reported. Practical batch sizes: 32-128 ballots for v2-like
1159latency, 256 for throughput; in native settlement mode the 6-blob limit binds first
1160(§8.6). Throughput scales across provers as in v2. The price of post-quantum ballots is
1161paid in parallelizable sequencer GPU time, not voter experience.
1162
1163The guest implements Blake3's chunk/tree layout over the compression syscall; Merkle
1164parents are `BLAKE3(left ‖ right)`. The ballot verifier configuration (AIR identity, FRI
1165profile, transcript and hash profile) is pinned via `ballotVKHash` at config leaf `0x7`,
1166as in v2, and the guest constructs each proof's expected public vector per the §6
1167statement contract.
1168
1169### 8.2 Census, authentication, binding
1170Census membership is verified **here**, as in v2 (not in the ballot AIR), and **the census
1171itself is v2's, byte for byte**. For Merkle origins 1-3 that is the Keccak lean-IMT the
1172v2 batch program verifies (davinci-zkvm source, commit ef07474): node hash `keccak256(be32(l) ‖ be32(r))` (Solidity's
1173`keccak256(abi.encode(l, r))`), leaf `address·2^88 + weight`, the `leaf < 2^248` rule,
1174v2's per-batch duplicate-leaf check, and each origin's root-acceptance policy. The guest
1175checks the path with the keccak precompile, as v2 does today. Existing censuses, census
1176contracts and census tooling work unchanged. (The v2 paper describes this tree as
1177Poseidon-hashed and drafts ≤1.5 followed it, specifying a Blake3 census format reached
1178through conversion proofs. The program's source verifies Keccak, the hash contracts compute
1179natively, so there is nothing to convert and both conversion proofs are removed; gate 9
1180re-checks this against the deployed contracts and bytecode.)
1181
1182**The slot rule is v2's too.** For origins 1-3 the slot is derived from the address by
1183v2's rule (§2.2). v2 requires on-chain censuses to refuse a registration whose slot is
1184already taken under that rule (gate 9 confirms the deployed contracts do); deriving slots any other way would leave collisions unchecked, and
1185a member could grind an address that collides with a victim's slot and overwrite their
1186ballot. Off-chain census lists MUST be checked for duplicate slots by sequencers and
1187clients, which anyone can do from the public list.
1188
1189**PQ keys come from a separate key map.** A census leaf says who may vote and with what
1190weight. Which post-quantum key authenticates an address is a different fact with a
1191different owner (the voter), so it lives elsewhere: each election over a Merkle census
1192(origins 1-3; CSP credentials carry the key themselves, §11) pins, at creation, a
1193`pqKeyRoot`, the root of a **sparse Merkle map keyed by the 160-bit address** with value
1194`pk_PQ ≠ 0`, where a missing key means "not enrolled". The map is Keccak-hashed with
1195distinct leaf and node tags and fixed encodings (it is maintained by a contract, the
1196island rule of §2; the byte-exact structure is a gate-3 item). For every admitted package
1197of such an election the guest proves the address's **value or absence** under `pqKeyRoot` (at most 160 node
1198hashes, fewer with compressed empty siblings) and proves the **join equality**:
1199
1200$$\text{ballot publics } (address,\, pk_{PQ},\, weight,\, slot,\, authMode) \;=\; \text{census leaf, key-map lookup, slot rule and policy for the same } address$$
1201
1202One `address` runs through the census leaf, the key lookup and the ballot's public vector;
1203the guest hashes the key-map leaf itself and never accepts a supplied leaf value.
1204`authMode` is derived from the immutable election auth policy plus the lookup result
1205(§11) and compared against the proof's public input, never prover-chosen. Authentication
1206then follows the policy: `pq-only` requires a present key equal to the public `pk_PQ` and
1207relies on the in-STARK preimage proof alone; `hybrid` requires the same and *additionally*
1208verifies `hybridSig` (ECDSA over `pkgDigest`, secp256k1 precompile, recovered address =
1209census address); `hybrid-legacy` dispatches on the lookup: a present key means both
1210authenticators, **proven absence** means `pk_PQ = 0` and `hybridSig` alone. Absence is
1211what makes that branch safe: without it, someone holding only an enrolled voter's wallet
1212key could claim the voter was unenrolled and skip the post-quantum check. The census
1213root and `pqKeyRoot` are both bound in the **batch statement** and must be the values the
1214registry holds for the election, never chosen by the prover. The program recomputes
1215`ctsDigest` and `pkgDigest` from the package body and constructs the proof's full expected
1216public vector from that body (§6 statement contract), so an admitted package is
1217byte-for-byte the one the voter's proof authorized.
1218
1219A census leaf is not domain-separated from an inner node: about one inner node in 256
1220would pass the `leaf < 2^248` rule. v2 is safe because the resulting "address" is a hash
1221output nobody holds a wallet key for. v3 keeps that safety wherever a wallet key is still
1222needed (`hybrid`, `hybrid-legacy`) and wherever the key map is the address-authorized
1223registry (§11), since no entry can exist there for an address nobody controls. It does
1224**not** hold for a `pq-only` election over an **organizer-published** key map: the
1225organizer could assign a key to such a pseudo-address and vote through it. That is inside
1226the organizer trust §11 declares for that configuration, not a new power (the organizer
1227already controls who is in the census), but it is the reason that trust has to be stated.
1228
1229### 8.3 State transitions
1230In fixed order, each proven against the previous root, as v2: (1) insert
1231`voteID → pkgDigest` for every admitted package; (2) insert the `OCCUPIED` marker for every
1232first-write slot (§8.4); (3) update `0x8` with the new `viewsRoot` (§8.7), atomically with
1233the rest of the batch state. Every accepted transition admits at least one package (§2.3),
1234so every transition inserts at least one never-removed leaf and the root always changes.
1235
1236### 8.4 Hidden writes
1237A batch makes exactly this public about slots: **the slots written for the first time**,
1238as a list strictly increasing by slot. For every admitted package the guest:
1239
12401. derives the package's slot from the authenticated census data (§8.2);
12412. checks that the batch's K slots are **pairwise distinct**: at most one ballot per slot
1242 per batch (an explicit check over the private slot list);
12433. if the slot's marker is absent, treats the package as a **first write**: inserts the
1244 marker, increments the occupancy counter (`votersCount ≤ maxVoters`,
1245 registry-enforced), and lists the slot;
12464. if the marker is present, treats it as an **overwrite**: proves the marker's presence
1247 under the old root and publishes nothing about the slot;
12485. appends the slot to the batch's **write log** (§8.5), one entry per package.
1249
1250Admitted packages are published **strictly increasing by voteID**, checked in-guest. No
1251order in a batch is chosen by the sequencer: with arrival order or slot order, a party
1252holding the openings of a few packages could count how many writes fall between its own.
1253A voteID is a hash of the voter's secret `k` (§5.2), so its rank says nothing about the
1254slot. A package's **admission ordinal** is its batch number followed by its position in
1255that order.
1256
1257The public counters are as in v2: admitted packages, first writes (hence overwrites, their
1258difference) and the total `votersCount`. That is all. There is no refresh, no decoy and no
1259per-slot value: drafts ≤1.5 published for every touched slot a blinded vector of the
1260voter's masked shares plus two blinding layers, kept a public accumulator of those
1261vectors, and touched a random sample of other slots as cover. v1.5's tally stopped
1262reading any of it, and without a per-slot value there is no mark for a cover to hide, so
1263the vectors, the blinding layers, the accumulator and the sample are all **removed**.
1264
1265What this hides, precisely. Per batch the public learns how many overwrites happened and
1266nothing about which already-occupied slots received them; an overwrite's anonymity set is
1267every occupied slot, where v2's was its refresh sample. Compared with drafts ≤1.5 and
1268with v2's slot activity, explicit overwrite-location leakage is never greater and can be
1269strictly smaller. It is a computational claim (the write log is a ciphertext, §8.5), and
1270it has edges, listed in §12.1: degenerate batches, counts in small elections, and batches
1271that were published but re-sealed with different contents.
1272
1273### 8.5 The warden payload (KEM-DEM, proven)
1274Per batch, the guest takes a fresh secret 256-bit batch seed (drawn by the sealing
1275sequencer from its CSPRNG, **fresh for every sealing**) and computes
1276$\sigma = \mathrm{Blake3.keyed}(\text{seed}, \texttt{sealCtx})$ with the `sealCtx` of §2.2,
1277which contains the old root and the ordered digests of the admitted packages. **All
1278payload randomness derives from σ and nothing from the raw seed**: the batch key $k_b$,
1279the Shamir coefficients, the ML-KEM encapsulation coins and the commitment salts, each
1280under its own domain. So a sequencer that seals twice from the same seed gets either the
1281identical payload (same contents) or unrelated keys (different contents); no key or nonce
1282ever covers two different plaintexts. `sealCtx` is also part of every batch DEM AAD.
1283
1284The guest then: DEM-encrypts (§2.1) the **write log** under $k_b$, one 8-byte slot per
1285admitted package in voteID order (fixed length 8·K; K is public); Shamir-shares $k_b$
1286**coordinate-wise over its 32-bit limbs** θ-of-ν; and for each warden $i$: one in-guest
1287ML-KEM encapsulation to $pk_i$ → wrapping secret → DEM-encrypts share $i$, and publishes a
1288salted Blake3 **commitment to each recipient's share** (opening salts travel inside the
1289respective DEM ciphertexts; these commitments are what lets tally participants validate
1290forwarded shares in §10.4 without decapsulating each other's ciphertexts). The proof binds
1291every log entry to its package's census-derived slot, every ciphertext to its registered
1292recipient key and context, and the share commitments to the shared $k_b$. **Unlike voter
1293transport, a malformed batch payload is unprovable, not merely complainable**: it would
1294hide which slot an accepted package wrote from the tally. All of it is published in the
1295batch's blobs.
1296
1297The write log is the **only** record of which package is a slot's current one. That is
1298deliberate (any public record would be a revote detector) and it is why the log is
1299escrowed to the committee and not to the sequencer. Two alternatives were considered.
1300Keeping a second, public witness of each write is what drafts ≤1.5 did with blinded
1301vectors; the tally never read it. Delivering the slot to each warden inside the voter's
1302package would delete $k_b$, the in-guest encapsulations and a whole ceremony stage, but
1303every single warden would then see every voter's write history as it happens, and a
1304coercer with one corrupt warden could re-coerce before the election ends. The θ gate is
1305worth its cost.
1306
1307### 8.6 Blob layout v3 and DA numbers
1308Blob cells carry 31 payload bytes each (a v3 codec choice; v2 packed typed values, v3 packs
1309an opaque byte stream per section), 4096 cells per blob ⇒ 126,976 B per blob. Sections, in
1310order: header · admitted packages (CanonicalPackage bytes, voteID order) · first-write
1311slots (8 B each, ascending) · warden payload (§8.5: the encrypted write log at 8 B per
1312package plus a 32-B tag, and per warden one ML-KEM ciphertext, one wrapped share and one
1313share commitment, ≈1.2 KB). An overwrite adds its package and its 8-byte log entry and
1314nothing else.
1315Byte-exact cell maps live in the davinci-zkvm normative docs, as in v2. One divergence from
1316v2's blob flow: the evaluation point becomes
1317$z_b = \mathrm{keccak256}(\text{processID} \,\|\, \text{stateRoot}^{old} \,\|\, \text{blobCommitment}_b) \bmod q_{BLS}$,
1318keccak because the **registry contract** computes it (Solidity-native; the guest recomputes
1319it via the keccak precompile, one call per blob, a §2 island).
1320
1321Per-package size: `72 + ν·(32 + ct_len + 8·nf)` bytes ⇒ at nf=16: 10,056 B at ν=8, the
1322v3.0 maximum; 6,312 B at ν=5; 3,816 B at ν=3; 1,320 B at ν=1 (all ML-KEM-768, the only
1323allowed transport, §2). nf-sizing: 9,096 B at ν=8/nf=1. Packages are 99% of a batch.
1324
1325| Profile (256 votes, nf=16) | batch bytes | blobs (126,976 B each) | drafts ≤1.5 (with 256 refreshes) | vs v2 (5 blobs) |
1326|---|---|---|---|---|
1327| **ν=8, ML-KEM-768 (v3.0 max)** | ≈ 2.59 MB | **21** | 25 | ~4× |
1328| ν=5 | ≈ 1.63 MB | 13 | 16 | ~2.6× |
1329| ν=3 | ≈ 0.98 MB | 8 | 10 | ~1.6× |
1330| ν=1 (sequencer mode) | ≈ 0.34 MB | 3 | 4 | ~0.6× |
1331| ν=16 (future profile) | ≈ 5.15 MB ⇒ over the 32-blob cap: smaller batches, or the tracked multi-recipient-Kyber transport (§15 item 5: package 5,640 B ⇒ ≈ 1.47 MB ⇒ 12 blobs) | — | — | — |
1332
1333A batch costs the same whether its packages are first votes or revotes: there is no
1334refresh cover to pay for. (In drafts ≤1.5 an overwrite-heavy batch grew to 27 blobs at
1335ν=8, because every overwrite dragged two refreshed slot vectors with it.)
1336
1337**Settlement modes.** **L1-blob mode** (v2's production path, the OP-Stack flow) posts
1338blobs across multiple Ethereum transactions and proves their chain inclusion on the rollup;
1339the 32-blob batch cap is inherited from v2's batch program and applies here. **Native blob
1340mode** is limited to the settlement transaction's own blobs (≤ 6 under EIP-7594), exactly
1341v2's flow: for every blob the registry reads its own transaction's versioned hashes via the
1342`blobhash` opcode (the only trustworthy on-chain binding between a versioned hash and an
1343actually-published blob) and preserves the binding chain stored versioned hash → commitment
1344via the point-evaluation precompile → $z_b$ as above → the proof-bound ordered blob digest.
1345Native deployments use correspondingly smaller batches: six blobs hold **≈119 votes at
1346ν=5, ≈74 at ν=8, ≈197 at ν=3**, and all 256 at ν=1. L1-blob mode is not an automatic
1347escape hatch on a chain lacking the rollup inclusion-verification path: pick the mode at
1348deployment. Drafts
1349≤1.4 specified a multi-transaction native registration subsystem (`registerBlobs` manifests
1350with freshness, merge and cleanup rules) so native mode could also reach 32 blobs; it is
1351**removed from v3.0** and tracked in §15 in a simplified fold-hash form, to be reinstated
1352only if a native deployment demonstrably needs larger batches. Ceremony and complaint
1353publications ride their own transactions' blobs, `blobhash`-bound like every blob here.
1354
1355**The archive manifest chain.** On every accepted transition the registry folds the batch
1356into a contract-side running value,
1357`archiveAcc' = keccak256(archiveAcc ‖ batchNumber ‖ stateRoot_new ‖ blobsDigest)` (keccak: it
1358is contract-computed, the island rule), and stores `(archiveAcc, batchNumber)`. At the
1359exclusion freeze this pair is frozen with the tally snapshot. It authenticates the ordered
1360batch **manifest**; actual blob bytes are authenticated by their commitment/versioned-hash
1361bindings (§4), and the §8.7 views are bound transitively through each `stateRoot`.
1362
1363DA is v3's main cost regression and is linear in ν: size committees to the election's
1364stakes. The tracked reduction path is **multi-recipient Kyber** (§15 item 5): one shared 960 B
1365component plus 128 B per warden ⇒ transport 1,984 B at ν=8 (vs 8,704 B), package
136610,056 → 3,336 B, a ~3× DA cut with ML-KEM security assumptions (a 256-vote batch at ν=8
1367would fit 7 blobs). (v1.2 tracked Classic
1368McEliece here; withdrawn, since BSI's 2026-09 guidance advises against it in new
1369developments and 2026 cryptanalysis reduced its margins, while its 0.26-1 MB public keys
1370were a poor browser fit anyway.)
1371
1372### 8.7 Per-warden column views (normative)
1373
1374The batch guest already touches every admitted package; this section makes that work
1375reusable so warden tally proofs never re-hash full `CanonicalPackage` bytes and never re-fold
1376the full blob archive. For each warden $i$ and each admitted package $v$, in admission
1377order (§8.4), the `(104 + 8·nf)`-byte
1378
1379```text
1380ColumnRecord(v, i) = voteID (8 B) ‖ pkgDigest (32 B) ‖ E[i][1..nf] (8·nf B, canonical LE)
1381 ‖ h[i] (32 B) ‖ Blake3(ct[i]) (32 B)
1382```
1383
1384(`pkgDigest` is load-bearing: the exclusion set $X$ identifies packages by
1385digest, so the record certifies the join between identity and row.)
1386
1387Per batch $b$ the guest computes the domain-separated commitments of §2.2's `viewCtx`
1388family (view encoding version 2):
1389
1390- `rowsDigest[b,i]` — hash of the batch's K ordered ColumnRecords for warden $i$, with K;
1391- `firstWritesDigest[b]` — hash of the batch's ordered first-write slot list, with its
1392 count (the same bytes the blobs publish);
1393- `payloadDigest[b]` — hash of the batch's **complete encrypted §8.5 payload envelope**,
1394 which carries its own encoding version (version 2 from v1.6: a write log of 8-byte
1395 slots)
1396 (write-log ciphertext, tag, context, per-share commitments, wrapping material). So that
1397 tally proofs need not re-hash ν wrapped shares they never open, the envelope is hashed
1398 as `Blake3(logPart ‖ commitments ‖ Blake3(wraps))`, with the wraps pre-digested.
1399 **Never a digest of the plaintext log: a deterministic plaintext fold is enumerable and
1400 would leak which slots were overwritten;**
1401- `viewAcc[i,b] = Blake3(viewCtx_acc ‖ i ‖ b ‖ viewAcc[i,b−1] ‖ admittedCount[b] ‖
1402 firstWriteCount[b] ‖ rowsDigest[b,i] ‖ firstWritesDigest[b] ‖ payloadDigest[b])`;
1403- `viewsRoot[b] = Blake3(viewCtx_root ‖ batchCount ‖ totalAdmitted ‖ totalFirstWrites ‖ ν ‖
1404 ordered (i, viewAcc[i,b]))`, stored at config leaf `0x8` (§7).
1405
1406Guest obligations: every projected value is derived from the **same** `CanonicalPackage`
1407the guest admits and publishes; it computes `pkgDigest` and each ciphertext digest itself;
1408every admitted package appears exactly once, in voteID order, with ordinals identical in
1409all ν views; the batch's ColumnRecords and its write log cover exactly the same K packages
1410in the same order, superseded and later-excluded ones included; every accepted batch folds
1411its canonically encoded digests (the pinned empty-view encoding exists only inside the
1412genesis predicate, §7); the `0x8` update is atomic with the rest of the batch state. Cost:
1413≈ ν·(18 + 3.9) Blake3 compressions per admitted package (~110 at ν=5, ~175 at ν=8) plus
1414bounded per-batch work. The ciphertext digests (18 compressions each) dominate.
1415
1416No new blob bytes are required: observers and archive providers reconstruct every
1417`ColumnRecord` deterministically from the published `CanonicalPackage` bytes, so views are a
1418*commitment layout*, not extra published data. The registry retains the per-batch
1419`(batchNumber, viewsRoot)` checkpoints it has accepted (one new storage slot per batch,
1420retained until election finalization plus the complaint window, then permissionlessly
1421cleanable), because early complaints (§9.2)
1422prove against historical accepted checkpoints, not the moving current root.
1423
1424Regression tests (normative, from review): omit/duplicate/reorder/substitute one record,
1425one first-write slot or one batch; change `pkgDigest` keeping the row; substitute another
1426warden's row or ciphertext digest; replay a view across
1427elections/epochs/profiles/recipient indices; omit a payload; admit packages out of voteID
1428order; put two packages of one slot in a batch; write a log entry that differs from the
1429package's census-derived slot; list a first-write slot that is already occupied or omit
1430one that is not; seal twice from one seed with different contents and check that no key,
1431coin or nonce repeats; verify no plaintext log digest and no unsalted slot-map digest
1432appears in any public transcript or continuation state; and
1433check, for all θ-subsets through overwrite chains and exclusions, that the §10.1 direct
1434share sum $\sum_{s:\,P_s \notin X} s_{P_s,i,f} + G_f(i)$ interpolates at 0 to the per-field
1435tally.
1436
1437---
1438
1439## 9. End of election: freeze, complaints, exclusions
1440
1441The v2 timeline (end → grace window) gains two phases before results:
1442
1443
1444
1445### 9.1 Casting freeze
1446When the grace window closes the registry stops accepting transitions (as v2). The state
1447root at that moment is the frozen final root $R_{\text{cast}}$; with it freeze the terminal
1448view checkpoint `(batchCount, viewsRoot)` and the counters.
1449
1450**Zero-transition short-circuit.** If no transition was accepted by the freeze
1451(`batchNumber = 0`: the election never initialized, §7), anyone MAY call `finalizeResults`
1452after the freeze; the registry checks the freeze status and `batchNumber = 0` atomically,
1453records the zero vector as the result, and no exclusion freeze, tally session, complaint or
1454warden action ever occurs ($R_{\text{cast}}$ and $X$ are undefined and
1455never referenced; `submitComplaint` and session opening revert at `batchNumber = 0`;
1456`archiveAcc` stays at its initial value 0). Zero accepted transitions is not the same thing
1457as zero *counted* ballots: an election whose every final base lands in $X$ still runs the
1458ordinary tally.
1459
1460### 9.2 Complaints and the exclusion set X, open from admission
1461**Complaints may be filed from the moment a package settles**, throughout the voting period
1462and until the complaint deadline after the casting freeze (the deadline's *coefficients and
1463margins* come from the named deadline profile referenced at creation, §2.3; the deadline
1464itself is computed once at the freeze, below). This is safe because $X$ is **idempotent and append-only** and complaints
1465**change no election state**: no complaint needs to know whether its package is still its
1466slot's current one, and ordering cannot matter. The payoff is voter recovery. An honest voter whose
1467package carried broken transport (a buggy client) learns while casting is still open and
1468simply **revotes**, an ordinary slot overwrite (§5.3) with no special path (the excluded base is
1469then no longer any slot's final base, and §10.1's direct sum omits a slot's share only when
1470its *final* base is excluded). In
1471v1.2 the same voter discovered the exclusion only after casting closed, unrecoverable.
1472
1473Mechanics: anyone may relay
1474`submitComplaint(processID, pkgDigest, publicValues, proof)`; only a warden of the election
1475can produce the proof, a ZisK proof showing
1476`Decaps(sk_i, ct_i)` yields a key inconsistent with the package's admitted $h_i$ (witness:
1477the warden's registered key seed; statement bound to the admitted `pkgDigest` and a
1478**registry-retained accepted checkpoint**, §8.7, never the moving current root, so settled
1479batches cannot invalidate a complaint in flight). The decapsulation is fully constrained
1480in-guest, including implicit rejection and the full-ciphertext constant-time FO comparison
1481(§2); host-provided hints are not acceptable. A complaint proof MAY cover **many packages at
1482once** (chunkable under the §2.5 contract; chunking is for adversarial scale, and the
1483single-package complaint is the expected common case); it proves
1484that **every reported package is malformed toward the complaining warden, never that
1485unreported transports are valid** (that would force decapsulation proofs over honest
1486packages; the final contribution proof independently requires valid openings for everything
1487it counts). The submitter pays gas.
1488
1489Normative exclusion semantics: **exclusion never resets slot occupancy and never restores an
1490earlier package**: $X$ is applied only after each slot's final package has been selected
1491(§10.1). A voter whose slot's *final base* package ends up in $X$ after casting closes
1492is not counted. A deliberately malformed last cast is a
1493provable self-abstention, and a voter+warden coalition retains a bounded post-close
1494withdrawal option for that voter's own ballot. A package malformed toward warden $i$ that is
1495*not* excluded still tallies correctly from wardens that can open it (§10.2); a voter may
1496even re-supply the opening out-of-band; warden $i$ either complains in time or sits out.
1497
1498The timing channel, stated openly: early complaints **improve recoverability without
1499creating any false-exclusion capability** (a complaint against well-formed transport cannot
1500be proven), but they add observable signals. Complaint timing and the voter's reaction are
1501public, and a malicious warden can deliberately delay a valid complaint past the point of
1502recovery or use its timing as a side channel. This is documented leakage, not an integrity
1503risk (§12.3).
1504
1505**Capacity is sized to the actual workload via the adaptive deadline of §2.3**: at casting
1506freeze the registry computes $d_{\text{complaint}} = t_{\text{freeze}} + d_0 + \alpha C +
1507\beta M$ from the authenticated terminal counts (admitted casts $C$, batches $M$), with
1508coefficients and margins fixed by the deadline profile referenced at
1509creation (§2.3). The per-warden budget
1510it must cover: one scan/decapsulation pass over up to $C$ packages, column-view
1511authentication, **a proven decapsulation per reported fault**
1512(worst case $q_i = C$, up to $νC$ across wardens; batching removes per-complaint
1513transaction and verification overhead, not the decapsulations), plus proof generation,
1514publication, inclusion, archive catch-up and reorg margin. Subsequent complaints never
1515extend a computed deadline. There is no per-voter cast bound (§5.3): the provisioning
1516scales with what was actually admitted, and deliberate inflation pays for its own admission
1517while linearly growing a deadline fixed by pinned coefficients. This remains an explicit
1518liveness assumption (§9.3), not an exceptional path. **Early close:** each pinned warden MAY
1519signal **scan-complete** on-chain from its snapshot-pinned settlement account (§4;
1520`msg.sender` is the authorization, and `processID` scoping makes signals inherently
1521replay-safe). A warden MUST NOT signal before completing its scan with all its complaints
1522settled (an honest-warden obligation the signal does not prove). When all ν wardens have
1523signaled, the registry atomically executes the ordinary exclusion freeze with the
1524then-current $X$. Signals assert closure authorization, never that $X$ is empty, and never
1525remove exclusions; θ signals or the tally roster are not sufficient; all complaint paths,
1526including open chunks (§2.5), reject after closure; one missing signal means no
1527acceleration, and the computed deadline stands. This is the one deliberate **classical
1528downgrade** in the warden message layer: forging a signal needs a warden's Ethereum account
1529and can only accelerate closure, a liveness and timing lever, never an integrity or
1530confidentiality one (§12.5; drafts ≤1.4 used SLH-DSA waiver certificates here, which no
1531contract could affordably verify). At the deadline (or all-ν early close) $X$
1532freezes on-chain, as its running digest `xDigest` (§2.2); every tally proof binds the frozen
1533snapshot `snap` $= (R_{\text{cast}}, \text{xDigest}, \text{batchCount}, \text{viewsRoot})$.
1534
1535### 9.3 Liveness
1536The tally needs at least θ wardens (the tally threshold) that complete the scan (and any
1537complaints) inside the window, complete the ceremony (§10.3-10.4), and publish proven
1538contributions, and someone (anyone) to submit each attempt's roster proof. It also needs, as in v2, timely inclusion of their transactions, **plus a funded
1539processing commitment covering the adaptive workload-derived deadlines (§2.3/§9.2: warden
1540work is linear in admitted casts, and "admission is priced" is not a substitute, since an
1541attacking sequencer pays itself)**, **plus at least one complete, available archive of the
1542election's published history** (§4). Blobs prune after ≈18 days, so the history must be
1543captured live (L1-blob-mode blobs from their publication transactions, §8.6); providers are
1544untrusted, since all
1545data is authenticated against the chain commitments, but a sole provider can halt progress by
1546withholding, so redundancy is operational prudence. Availability must span the casting
1547period, the complaint deadline, **every** tally attempt, and the declared retention period,
1548and must include ceremony and complaint publications; reorganizations and archive catch-up
1549time eat into deadlines and must be budgeted. Missing payload history means the tally cannot
1550complete. Compared with v2: v2 also requires post-pruning archival for anyone replaying
1551the election, but v2 wardens tally from one authenticated final accumulator, so **v3's
1552dependence of tally completion on the complete history is strictly stronger**.
1553With fewer than θ such wardens the results are lost, exactly as with v2's "θ of ν wardens
1554take part in decryption".
1555
1556---
1557
1558## 10. Tally: warden sums and Lagrange
1559
1560In one line: this is where the wardens' recovered shares become the election result, in
1561public, with proofs, and without any decryption key.
1562
1563### 10.1 What each participating warden computes
1564After the exclusion freeze, each participating warden $i$:
15651. holds its complete **column view** (§8.7) and the batch payload history, fetched from any
1566 untrusted archive provider and authenticated against the chain commitments, or retained
1567 locally (§4; work is linear in *total casts*, not final voters, and decapsulation/share
1568 recovery MAY run incrementally during the voting period);
15692. decapsulates its per-package ciphertexts (full-ciphertext constant-time FO comparison,
1570 §2), regenerates each package's mask stream
1571 ($\mathrm{Blake3.keyed}(K_{v,i}, \mathrm{streamCtx}(i))$, §2.2), recovers shares
1572 $s_{v,i,f} = e_{v,i,f} - \mathrm{mask}_{v,i,f}$, and checks each against
1573 the admitted $h_{v,i}$;
15743. joins the **tally ceremony** (§10.3-§10.4): the participants exchange batch-key shares
1575 in signed, encrypted bundles on the public DA path (plaintext shares are never public),
1576 reconstruct each $k_b$ from θ shares, decrypt the **write logs** and so learn which slot
1577 every admitted package wrote, all verified against the batch proofs that committed them,
1578 and run the zero-blinding round producing $G_f$;
15794. selects each occupied slot's **final base package** $P_s$: the package the logs assign
1580 to slot $s$ in the highest-numbered batch (a batch holds at most one package per slot,
1581 so there is never a tie). Only then applies the exclusion set: a slot whose final base
1582 is in $X$ counts nothing; an earlier package is never restored. Then computes the
1583 **direct share sum**:
1584
1585$$S_{i,f} = \sum_{s:\,P_s \notin X} s_{P_s,i,f} \;+\; G_f(i)$$
1586
1587In words: sum your recovered share of every counted ballot, add your blinding share, done.
1588The shares come from opening the admitted commitments $h_{P_s,i}$, each AIR-bound at
1589admission to the exact $(s_i, K_i)$ used in masking (§5.1, §6). Each counted term is an
1590evaluation of one degree-(θ−1) ballot polynomial, so the sum is an evaluation of their
1591aggregate; adding $G_f(i)$ (with $G_f(0)=0$) keeps the interpolation at 0 equal to the
1592exact tally. Exactly one contribution program is pinned per registry deployment: a θ-set
1593of contributions computed under two different equations would interpolate garbage that
1594still verifies on-chain.
1595
15965. publishes $S_i$ with a **ZisK proof** whose statement binds: the election context, the
1597 frozen snapshot `snap` (§2.2; the proof opens `xDigest` to the exclusion set it applies),
1598 registry-selected and never warden-supplied (consistency with a chosen list is not
1599 completeness), its recipient index, the session id, the attempt and the frozen dealer
1600 set (§10.3-§10.4); and whose witness contains its KEM key seed (authenticating it as
1601 warden $i$ against the registered commitment), the $(s, K)$ openings **for every
1602 counted slot's final base package** (each checked against its admitted $h_{v,i}$), the
1603 reconstructed payload keys and log openings, and its dealer-delivered blinding
1604 evaluations (opening the $cm_{k,i}$ of §10.3). The program processes warden $i$'s
1605 **column records, the first-write lists and the authenticated batch payloads**, never
1606 full `CanonicalPackage` bytes, and never a re-fold of the blob archive (the chain of
1607 accepted batch proofs already certifies view completeness; the registry's `archiveAcc`
1608 binds the views transitively through each `stateRoot`). It enforces **complete,
1609 exactly-once processing** of the whole history (every admitted package: final base,
1610 superseded, or excluded, with nothing skipped), reaching the frozen terminal
1611 `viewsRoot` and counts. Payload keys are authenticated by reconstruction from
1612 **θ distinct original committed share openings** (§8.5) followed by DEM verification
1613 (successful decryption under an arbitrary supplied key proves nothing); recovered key
1614 limbs must satisfy the 32-bit limb encoding; and the slot of every package comes from
1615 the authenticated logs, never from host-supplied values. As an internal cross-check
1616 the program asserts, per batch, that the slots the log shows written for the first
1617 time are exactly that batch's public first-write list, and at the end that the number
1618 of distinct slots equals `votersCount`. These are assertions, **never outputs**: no public value
1619 may expose how many final bases were counted or excluded, nor any unsalted digest of
1620 slot data. (A tally proof opens $h_{v,i}$; it never hashes actual ciphertext bytes;
1621 only complaint proofs do.) For scale, chunked proving follows the §2.5 contract.
1622 Sizing: total authentication work is $O(C + M\nu)$, history-linear rather than
1623 active-voter-only; the secret opening work scales with counted final bases.
16246. `submitTallyShare(processID, i, S_i, publicValues, proof)`; after θ verified shares,
1625 anyone calls `finalizeResults(processID)`: **the registry performs the Lagrange
1626 interpolation on-chain** (θ ≤ 8 points over Goldilocks in v3.0, a few u64 mulmods per
1627 field; measured gas in Annex A.3), records the per-field results, and emits
1628 `ProcessResultsSet`.
1629
1630Wardens run their **own provers**: the witness contains their secrets, and a shared proving
1631service used by θ wardens would itself hold reconstruction capability. One operator MAY
1632serve wardens of *different* elections on shared infrastructure, provided its aggregate key
1633inventory stays below θ **for every election it touches**: job separation alone is not
1634enough, since epoch keys reused across elections can silently hand one operator θ keys of
1635some committee. Untrusted public
1636*preparation* is fine: anyone may pre-build columns, manifests and lookup structures, since
1637the proof authenticates their use against the frozen commitments, but nothing holding secret
1638witnesses may be outsourced. Proving cost scales with total casts. The inner loop (column
1639record folding, $h_{v,i}$ opening, share accumulation, per-batch key reconstruction and
1640log decryption) has been measured: **9.4 Blake3 compressions and ≈2,000 guest steps per
1641counted package**, about 3.9 of them public view authentication and 4.0 the opening
1642(Annex A.2), against the >10^8 compressions per million casts of v1.2's full-package
1643re-hashing. What that measurement does not yet contain is the slot → latest-package map
1644across batches; Annex A.2 says so.
1645
1646### 10.2 Why malformed voter transport cannot corrupt anything
1647**Decapsulation never appears in any tally proof.** Contributions open the admitted
1648commitments $h$ instead, and under commitment binding every accepted $S_i$ lies on the same
1649aggregate polynomial. A voter publishing a bad `ct_i` only deprives warden $i$ of its opening
1650witness (warden $i$ complains or sits out; the voter could even re-supply the opening
1651out-of-band, which is safe because correctness is tied to $h$, not to the transport). Every clean
1652θ-subset interpolates the same tally, because the ballot STARK proved all ν shares lie on one
1653valid polynomial. Malformed transport is an availability lever against one warden, never an
1654integrity lever against the election.
1655
1656### 10.3 The zero-blinding ceremony
1657In plain terms: before publishing their partial sums, the participating wardens jointly add
1658noise that cancels out exactly at the finish line (x = 0), so the published sums reveal the
1659result and nothing else. Why it's needed: published raw, θ sum-shares determine the aggregate
1660polynomial $F$; any single warden, participant or not, could evaluate it at its own index,
1661compare with sums of its decoded per-package shares, and fingerprint which packages are
1662final bases (hence which slots were overwritten). The
1663ceremony prevents that:
1664
16651. A tally attempt has three sets (§10.4). The **roster $\Pi$**: the wardens whose join
1666 was proven valid, frozen by the roster proof, $|\Pi| \ge \theta$; it MAY exceed θ, and
1667 should, because extra members are failure margin. The **accepted dealer set
1668 $D \subseteq \Pi$**: frozen at the dealer deadline, $|D| \ge \theta$ required so at
1669 least one accepted dealer is honest under the $f < \theta$ corruption bound. The
1670 **contributors $\Gamma \subseteq \Pi$**: any θ roster members with valid contributions.
1671 The registry computes the **session id** when $\Pi$ freezes,
1672 `sessionId = keccak256("v3/session", ectx, snap, attempt, Π)` (§2.2), where `attempt` is a
1673 registry-controlled monotonic nonce incremented on every restart, so the id changes
1674 even with an identical roster and snapshot; the registry tracks exactly one active
1675 attempt and rejects anything bound to a stale one. Candidate dealers are the roster;
1676 blinding evaluations are delivered **only to the frozen roster, never pre-dealt to all
1677 ν wardens or to future replacement candidates** (pre-dealing would hand every warden
1678 its $G(i)$, letting any single non-participant strip the blinding at its own index and
1679 fingerprint which packages are final bases, a confirmed attack).
16802. Each dealer $k$ samples a seed and derives, per field, blinding coefficients
1681 $c_{k,f,1..\theta-1}$, defining $g_{k,f}(x) = \sum_j c_{k,f,j} x^j$. **The constant term
1682 is structurally absent, so $g_{k,f}(0) = 0$ by construction** (this is the
1683 "zero-certificate": the dealer proof's coefficient witness simply has no degree-0 entry).
16843. Dealer $k$ publishes (in a session blob): **per-recipient hiding evaluation commitments**
1685 $cm_{k,i} = \mathrm{Blake3}(g_{k,1..16}(i) \,\|\, r_{k,i})$; the KEM-DEM ciphertexts to each
1686 co-participant $i \in \Pi$ encrypting $(g_{k,1..16}(i), r_{k,i})$, after the dealer has
1687 re-run the roster check itself (§10.4);
1688 and a **ZisK dealer proof** over one coefficient witness showing that the degree-0 term
1689 is structurally absent and that every $cm_{k,i}$ and every ciphertext is consistent with
1690 that witness, under the recipients' **ephemeral session keys** (§10.4) and this session's
1691 context. The dealer proof also **authenticates the dealer**: its statement carries the
1692 full canonical envelope digest and the `cerCtx` tuple as public inputs, constrained
1693 in-circuit against the dealer's witnessed registered key seed (proving key possession
1694 without binding the whole message would permit envelope substitution under a replayed
1695 proof; `cerCtx` closes cross-attempt, cross-session and cross-election replay). There is
1696 no separate signature and no standalone coefficient commitment: drafts ≤1.4 had both,
1697 nothing ever opened the coefficient commitment, and the proof subsumes the signature,
1698 which also makes admission to $D$ fully objective (a valid on-chain-verified proof
1699 present by the deadline).
17004. Contributions use $G_f(i) = \sum_{k \in D} g_{k,f}(i)$ over the **accepted dealer set
1701 $D$**, fixed on-chain after the dealer deadline and **immutable thereafter: a dealer
1702 whose publication is missing or invalid before the deadline simply doesn't enter $D$
1703 (margin), and once $D$ is frozen, a member's later unresponsiveness never removes its
1704 polynomial** (removing it would put contributions on different blinded polynomials and
1705 corrupt the interpolation); every contribution proof binds the same $D$ and session id,
1706 and **opens the evaluation commitments $cm_{k,i}$** (the recipient learned the opening by
1707 decapsulating off-circuit; decapsulation still never enters any tally proof). Only if
1708 $|D| < \theta$ at the deadline does the session restart with fresh masks.
1709
1710As long as one accepted dealer is honest, no one outside the ceremony, and no
1711non-participating warden, learns anything about $F$ beyond what the public tally
1712$F(0)$ itself reveals. Under the direct share sum (§10.1), tally-time write-history
1713hiding rests **solely** on this one-honest-accepted-dealer property, and the committee
1714bound $f < \theta$ itself implies it: $|D| \ge \theta$ and $D \subseteq \Pi$, so an
1715all-malicious accepted dealer set would require ≥ θ corrupt roster members, and θ corrupt
1716roster members already hold θ shares of every batch key and know the complete write
1717history without touching $F$. Whenever the blinding could matter, that adversary has
1718already crossed the θ boundary. The blinding has nothing to do with slots or logs: it
1719protects the aggregate share polynomial, which is why it stays although every slot-level
1720blinding of earlier drafts is gone. Roster members do learn the
1721write history (which slot each package wrote); that is the documented
1722metadata leakage of §12.2.
1723
1724### 10.4 The batch-key exchange and the session state machine
1725
1726The batch keys $k_b$ (§8.5) are θ-of-ν shared; **reconstructing them must not leak
1727them**: publicly releasing enough shares of any $k_b$ reveals that batch's write log,
1728exactly the metadata hidden writes exist to conceal. An attempt is **five one-shot
1729publications** (join and share bundle SLH-DSA-signed; roster proof, dealer bundles and
1730contributions proof-authenticated), with no pairwise request/response on the success path:
1731
17321. **Join.** Each participating warden publishes a **fresh ephemeral ceremony ML-KEM
1733 keypair for this attempt** in a join envelope: the 1,184-byte encapsulation key and an
1734 SLH-DSA signature, under its registered signing key (§4), over `joinCtx` (§2.2), which
1735 **includes the ephemeral key itself**, the election context, the frozen snapshot, the
1736 attempt and the sender index. The join is a transaction from the warden's
1737 snapshot-pinned settlement account (§4) carrying the envelope as calldata; the registry
1738 enforces the exact envelope length, computes `keccak256` of those calldata bytes
1739 itself, and stores the digest at the warden's index. One join per index per attempt,
1740 immutable. The join stage closes at its deadline or as soon as all ν wardens have
1741 joined; no join is recorded after that.
1742 **Long-term warden keys MUST NOT be the recipients of ceremony ciphertexts**, and the
1743 ephemeral secret, together with every recovered bundle key, share and reconstructed
1744 batch key, MUST be destroyed once the tally finalizes. Why: the bundles below are
1745 published on a DA path and archived forever. If they were encrypted to lifetime keys, a
1746 *single* participant's later key compromise would reveal ≥θ shares of every $k_b$, i.e.
1747 the complete write history, from the public archive alone (§12.2). Ephemeral keys
1748 restore "steal a key later ⇒ learn nothing" for honest-deleting participants.
17492. **Roster proof.** The account check says *who* joined; it says nothing about whether
1750 the envelope is usable. So once the join stage has closed, anyone submits one ZisK
1751 proof, with no secret witness, that decides it. Its statement binds the election
1752 context, the frozen snapshot, the attempt, the registry's indexed vector of join
1753 digests and the snapshot-pinned signing-key commitments. For **every** recorded join it
1754 computes a verdict: the signature verifies under the registered key and `joinCtx`,
1755 **and** the encapsulation key passes the FIPS 203 validity check. The program is
1756 total: malformed bytes yield "invalid", never an abort (otherwise one garbage join per
1757 attempt would block the tally forever). It outputs the roster $\Pi$ as the ordered
1758 (index, envelope digest) pairs of the valid joins. The registry requires
1759 $|\Pi| \ge \theta$, freezes $\Pi$, and only then computes the session id (§10.3). Every
1760 later message binds that id, and every delivery obligation, completion rule and
1761 threshold below refers to $\Pi$. An invalid join is simply not in it: one lost slot of
1762 margin, whoever sent it.
1763 **Senders re-check.** Before encrypting anything to a roster key (dealers in step 3,
1764 bundle senders in step 4), a sender recomputes $\Pi$ by running the same pinned roster
1765 program on the published envelopes. This is what keeps the authentication of ephemeral
1766 keys post-quantum: the registry's acceptance rests on a wrapped proof whose wrapper is
1767 classical (§12.5), the sender's own run rests on SLH-DSA. If the frozen $\Pi$ contains
1768 an envelope the sender's run rejects, the proof system or its wrapper is broken: the
1769 sender stops sending and contributing in this election and raises the alarm. It never
1770 triggers an on-chain reset. (If $\Pi$ omitted an envelope the sender's run accepts, the
1771 sender would simply proceed with $\Pi$; running the identical program leaves no room
1772 for two libraries to disagree on an edge-case key.) The stakes: a forged ephemeral key
1773 that senders did encrypt to would collect up to $m - 1$ shares of every batch key from
1774 a roster of $m$, enough to read every write log whenever $m > \theta$. That is why
1775 this one message keeps post-quantum authentication while §9.2's closure signals do not.
17763. **Dealer bundles** (§10.3), delivered to every member of $\Pi$; $D$ frozen at their
1777 deadline.
17784. **Share bundles.** Each roster member publishes ONE signed, authenticated logical
1779 bundle (context `cerCtx`, §2.2): its canonical vector of §8.5 shares and commitment
1780 salts for **all batches**, DEM-encrypted once under a fresh 256-bit CSPRNG **bundle key**
1781 (fresh per attempt, never reused), plus one KEM-DEM wrap of that bundle key to each
1782 other roster member's ephemeral key. The SLH-DSA envelope covers the body ciphertext
1783 **and the complete ordered per-recipient wraps** (stripping or substituting a wrap is
1784 only denial of service, since a wrong key fails the DEM tag, but binding them is free
1785 attribution hygiene). Every recipient receives the identical sender vector; bundle
1786 bytes are $O(mM + m^2)$ (at 1M casts in 256-cast batches: ≈3.1 MB for m=8, ≈1.9 MB for
1787 m=5; drafts ≤1.4 encrypted the vector once per recipient, 21.1 and 7.5 MB).
1788 Publication is on a **publicly verifiable DA path** so missing-message timeouts are
1789 objective ("I sent it privately" proves nothing); one logical bundle may span multiple
1790 transactions/blobs. A recipient **validates every recovered share against the batch's
1791 published per-share commitments** (§8.5) before use. An invalid opening is simply
1792 ignored; any θ valid distinct shares reconstruct each $k_b$ (all decapsulations follow
1793 the §2 full-ciphertext constant-time FO rule).
1794 Signatures give authorship attribution; the protocol still does **not** claim publicly
1795 verifiable fault attribution for encrypted contents (a signature proves who sent a
1796 ciphertext, not what it decrypts to; confidential ZK fault proofs are a tracked
1797 hardening, §15). Faults are absorbed by **margin**, and fault adjudication is never on
1798 the successful tally's critical path.
17995. **Contributions** (§10.1 step 5): any θ valid contributions from roster members, all
1800 bound to the same snapshot, session, attempt and frozen $D$. No separate signature: the
1801 contribution proof authenticates the warden through its registered key seed, binding the
1802 full envelope digest and `cerCtx` exactly as dealer proofs do (§10.3).
1803
1804Plaintext key shares and reconstructed keys never appear on-chain or in blobs; contribution
1805proofs reference the log *openings* (witness), not the keys.
1806
1807**Deadlines and restarts** (contract-side). At the casting freeze the registry fixes five
1808stage **durations** from the deadline profile and the terminal counts (§2.3). Attempt 1
1809starts at the exclusion freeze; each attempt turns the durations into absolute deadlines
1810counted from its own recorded start, in the order join close, roster proof, dealer
1811bundles, share bundles, contributions. One boundary convention holds everywhere: a message
1812is on time if its block timestamp is at or before the deadline. A stage opens as soon as
1813its predecessor closes, and **every stage closes early on completion**: the join stage
1814when all ν pinned wardens have joined; the roster stage when the roster proof is accepted;
1815the dealer stage when every member of $\Pi$ has a bundle with a verifying proof on-chain;
1816the share-bundle stage when every member of $\Pi$ has completed authenticated DA
1817publication of its bundle (publication is the observable event, never the validity of
1818encrypted contents); the contribution stage when θ valid contributions are accepted, after
1819which anyone can call `finalizeResults`. Closing a stage early only opens the next one sooner; it never moves a
1820deadline earlier for a party that has not yet published. A fully-responsive committee
1821goes from exclusion freeze to results in minutes (the same rule gives §9.2 its early
1822exclusion freeze).
1823
1824An attempt **fails** on exactly three contract-decidable conditions, and on nothing else:
1825no accepted roster proof with $|\Pi| \ge \theta$ by the roster deadline; $|D| < \theta$ at
1826the dealer deadline; fewer than θ accepted contributions at the contribution deadline.
1827The share-bundle deadline has no failure condition of its own: a missing or faulty bundle
1828is never adjudicated and shows up, if it matters, as a contribution shortfall. After a
1829failure anyone may call the registry to advance; that transaction records the next
1830attempt (attempt + 1) starting at its own timestamp, with fresh deadlines, a fresh roster
1831and fresh blinding and transport randomness; batch keys never change, and anything bound
1832to the old attempt is rejected from then on. **A missing or invalid participant reduces
1833margin and never by itself forces a restart**; no accusation, no claim about encrypted
1834contents and no early completion can trigger one. Attempts are not capped: with θ
1835responsive honest roster members no single participant who joins and then withholds can
1836make an attempt fail, and without them neither a cap nor a bond would produce a tally.
1837`finalizeResults` accepts θ distinct roster members' contributions bound to one accepted
1838session and its frozen dealer set. To be clear about what remains: **removing the
1839election-key DKG does not remove coordinated cryptographic ceremonies. v3 replaces it with
1840different (smaller, tally-time-only) coordination work**, and the exchange stays interactive
1841in substance (no PQ primitive lets θ parties privately reconstruct without communicating;
1842there is no silent-threshold shortcut; these stages are the minimum for ν ≥ 2).
1843
1844**The ν=θ=1 fast path.** In sequencer mode the ceremony collapses entirely: no join, no
1845roster proof, no dealer bundles, no share exchange, and $G_f = 0$ (blinding only protects
1846against parties outside the ceremony, and there are none). The exclusion freeze, the
1847authenticated payload reconstruction (the single warden decapsulates its own §8.5 share,
1848which alone reconstructs each $k_b$) and the contribution proof remain, bound to a canonical
1849single-warden context and the frozen snapshot. The sole-operator privacy trust of §4
1850applies.
1851
1852---
1853
1854## 11. Census and authentication
1855
1856- **Census trees are v2's, unchanged** (§8.2): the same Keccak lean-IMT, leaf packing,
1857 root policies per origin and slot rule. A v2 census is a v3 census; nothing is converted
1858 or rebuilt. What v3 adds is the voter's post-quantum key, and it lives outside the
1859 census.
1860- **The PQ key map.** `pk_PQ = H(sk)` for a CSPRNG-generated secret `sk`. Each election
1861 pins a `pqKeyRoot` at creation (§8.2): the root of an address-keyed sparse Merkle map
1862 from address to `pk_PQ`, where a missing address means "not enrolled".
1863 - *On-chain and token censuses* use the global **PQKeyRegistry** contract. A voter
1864 enrolls with one transaction, reusable across all elections. **Registration is
1865 authorized by the address itself**: the transaction's sender, or a relayed wallet
1866 signature over the domain-separated tuple `(chainID, PQKeyRegistry address, voter
1867 address, new pk_PQ, nonce)`, where the registry keeps a **per-address nonce** and
1868 increments it on *every* successful update, direct or relayed. The signature
1869 *authorizes* and is never key entropy, so a future ECDSA break does not reveal PQ
1870 secrets. As long as ECDSA holds at registration time, nobody else can enroll or squat an
1871 address (§12.5). A voter may replace their key the
1872 same way; a replacement affects only elections created afterwards, and because of the
1873 nonce an old authorization can never be replayed to put a replaced (possibly
1874 compromised) key back.
1875 - *Off-chain censuses* SHOULD use the global registry too. Where that is impractical
1876 the organizer publishes its own key map of the same structure next to the census
1877 list, and MUST obtain each key from the voter it belongs to (validated enrollment).
1878 An organizer who assigns
1879 keys holds **identity authority**, not only eligibility authority: in a `pq-only`
1880 election it could vote as a listed member. That is stronger trust than v2's off-chain
1881 census (where the organizer chose who may vote but could not vote as them) and
1882 deployments MUST say so; `hybrid` removes it, since the organizer has no wallet keys.
1883 The key list is published with the census, and `pqKeyRoot` is immutable for every
1884 origin.
1885 - *CSP censuses* carry `pk_PQ` in the credential (below) and use no key map.
1886- **Snapshot rule.** `pqKeyRoot` for an on-chain registry is the root the registry holds
1887 **at the moment of the election-creation transaction**, read in that transaction:
1888 registrations earlier in the same block count, later ones do not. A voter's key and
1889 enrollment status for an election never change afterwards, whichever (newer)
1890 eligibility root the census contract later accepts.
1891- **Election auth policy** (immutable registry parameter, fixed at creation):
1892 - `pq-only`: every package must present a key-map entry for its address; authentication
1893 is the in-STARK preimage proof alone; no ECDSA anywhere in the ballot path. A census
1894 member with no entry simply cannot vote in this election: checking enrollment coverage
1895 before creating a `pq-only` election is the organizer's job, and SDKs SHOULD refuse to
1896 create one over a census with unenrolled members without an explicit override.
1897 - `hybrid`: as `pq-only`, and every package is also verified on the second
1898 authenticator, `hybridSig` (ECDSA over `pkgDigest`, verified by the batch program).
1899 No OR-downgrade exists in this mode.
1900 - `hybrid-legacy`: an enrolled voter authenticates on **both**, exactly as in `hybrid`;
1901 a voter **proven absent** from the key map is admitted on `hybridSig` alone, with the
1902 STARK's PQ-preimage clause skipped (`pk_PQ = 0`). The batch program decides the branch
1903 from the key-map lookup, never from the package: an enrolled voter cannot be treated
1904 as unenrolled, so stealing only their wallet key is not enough to vote as them.
1905 Anyone can count the unenrolled census members (census and key map are public),
1906 though not which packages are theirs. Ballot *privacy* is fully PQ for these voters;
1907 the election's **integrity assumptions include ECDSA security for its unenrolled
1908 voters** (§12.1, §12.5). This mode is what makes existing token censuses usable before
1909 universal enrollment.
1910- **CSP censuses** (origin 4). v2 identified the CSP by its Ethereum address and recovered
1911 its key from each ECDSA credential; SLH-DSA has no key recovery, so the key is pinned
1912 directly: `censusRoot` **is** the CSP's 32-byte SLH-DSA-SHA2-128s public key
1913 (`PK.seed ‖ PK.root`), byte-exact, never reduced or range-checked as a field element.
1914 A credential is a FIPS 205 pure signature [FIPS 205], with the fixed context string
1915 `davinci-v3-csp`, over v2's credential message extended with the deployment and the
1916 voter's key: `chainID_32 ‖ registry_20 ‖ processID_32 ‖ address_20 ‖ weight_32 ‖ idx_8 ‖
1917 pk_PQ_32` (big-endian byte lengths, as v2). The batch guest verifies each credential
1918 against the registry-held key (pure hashing through the SHA-256 precompile; SLH-DSA's
1919 internal SHA-2 is a FIPS island, §2) and uses `slot = 16 + idx` as v2. A stable
1920 one-to-one mapping between addresses and indexes, and one fixed `pk_PQ` per voter per
1921 election, are **issuer obligations**: no single credential can prove them, and a CSP
1922 that signs the same index for two addresses lets the second overwrite the first.
1923 `pk_PQ = 0` in a credential is accepted only under `hybrid-legacy`; the hybrid modes
1924 keep their voter ECDSA check independently of the credential.
1925- Participation visibility and the census origins 1-4 mechanics: as v2, with the additions
1926 above. The v2 census invariants (slot uniqueness across the census; stable distinct CSP
1927 indexes) remain assumptions of integrity.
1928
1929---
1930
1931## 12. Security properties
1932
1933### 12.1 What holds, under what
1934
1935| Property | Holds if |
1936|---|---|
1937| **Tally integrity** | STARK/zkVM soundness (FRI + hashes) and the classical wrapper (§12.5), binding commitments, correct pinned programs, the settlement chain executes the registry, the v2 census invariants (unique slots / stable CSP indexes), and an authentic key map (§11; organizer trust where the organizer publishes it; ECDSA at registration time for the on-chain registry), plus ECDSA itself for the unenrolled voters of a `hybrid-legacy` election. Then no coalition of voters, sequencers, provers or wardens can shift a tally, including via malformed KEM transport (§10.2). |
1938| **Ballot privacy** | fewer than θ warden keys compromised **over their whole lifetime** (not just the active epoch), ML-KEM IND-CCA, PRF/hash security, hiding STARKs, and honest voter devices. Below θ, shares in isolation are information-theoretically independent of the ballot. **Post-quantum computational privacy, not "everlasting"**: an unbounded adversary could attack archived KEM transcripts. Claimed only beyond what the published tally and public metadata reveal: in a small electorate, or when overlapping tallies are combined, the tally itself may reveal choices (as in v2). |
1939| **Revote hiding (public data)** | hiding proofs + PRF/hash and DEM security + ML-KEM (the write log's key shares travel under it) + no party able to read the logs discloses them (θ colluding wardens before the tally; any single roster member after a share exchange, §12.2) + the sealing sequencer/prover keeps its batch seed and what it sealed secret. **An overwrite publishes nothing about its slot**: per batch the public learns how many overwrites occurred, never which occupied slots received them, so an overwrite hides among all occupied slots (v2: among its refresh sample), and no party's sampling randomness is trusted. This holds even for a coercer holding the voter's identity key and the coerced package's complete opening (§12.3). **Edges, all inherent to public counts and timing:** (a) degenerate batches: a single-package first-write batch links that package to its slot, and a batch with all or no first writes shows every package's status; (b) counts: zero overwrites in every later batch is a certain "nobody revoted", and in a small election a count of one narrows it to few candidates; a party that fills a batch with K−1 packages of its own learns whether the remaining one was a first write, though not an overwrite's slot; (c) re-sealing: two published versions of a batch that differ in admitted packages reveal, through their first-write lists and counts, a dropped first-write package's slot and any dropped package's status; (d) exclusion counts and (e) an active one-per-batch probe, both in §12.3. Participation per slot (first writes), turnout and complaint timing are public, as in v2. |
1940| **Exact tally** | unconditional arithmetic (mod-$p$ sums, Lagrange). ML-KEM's residual decapsulation-failure probability (≈2^-164 at ML-KEM-768; election-wide union bound over *all* encapsulations: per-ballot, batch shares, ceremony deliveries) is not zero even for proven-correct encapsulations. Each failure degrades gracefully: a per-ballot failure becomes a complaint (filable immediately, §9.2, so the voter can revote); a batch-key *share* failure is tolerated provided at least θ valid shares remain available (with ν=θ, or only θ responsive wardens, one failed share means that payload cannot be reconstructed and the tally cannot complete, so size ν above θ accordingly); a ceremony delivery failure reduces margin, and only a shortfall below θ at a deadline fails the attempt (§10.4). Deliberately malformed batch transport is a different thing entirely: it is unprovable (§8.5), so it cannot appear in an accepted batch. |
1941| **Liveness** | ≥1 honest sequencer with proving capacity and timely inclusion (as v2), plus someone submitting each attempt's roster proof (permissionless) and ≥θ responsive honest roster members through the ceremony's deadlines with θ valid accessible original shares per batch (§10.4; margins absorb individual failures), plus **≥1 complete available archive of the published history spanning casting, complaints, every tally attempt and the retention period** (blobs prune in ≈18 days; providers untrusted, data chain-authenticated; missing payload history prevents tally completion, §4/§9.3), plus a funded processing commitment for the workload-derived deadlines (§2.3/§9.2). |
1942
1943### 12.2 What wardens and insiders learn
1944θ colluding wardens can reconstruct **every package's ballot**, exactly v2's boundary, where
1945θ wardens can decrypt every ballot. New, and narrower: the parties that can learn the
1946**write history** (which slot each package wrote, hence who revoted and when; metadata,
1947not contents) are defined **cumulatively**. For each
1948batch, that set is anyone who obtains $k_b$, receives its plaintext onward, or
1949**accumulates θ distinct
1950valid original shares of $k_b$, including shares received across different
1951attempts** (fresh blinding cannot revoke knowledge already obtained; two incomplete attempts
1952can cumulatively suffice). In a delivered share exchange to a roster of size $m$, **every
1953roster recipient**, not only the final θ contributors, gains reconstruction capability,
1954and any one of them can leak the history onward. So the precise statement is: before the
1955tally it takes θ colluding wardens to read a write log; after a share exchange, one
1956roster member suffices. Because share bundles are DA-published
1957(§10.4), compromise of a recipient's ceremony decryption key would reveal the complete
1958write history from
1959the permanent public archive, which is why ceremony keys are **ephemeral per attempt and
1960destroyed after finalization**, together with every recovered bundle key, share and batch
1961key (§10.4): for honest-deleting participants, a later key theft
1962reveals nothing. Non-participating wardens and the public learn nothing about the history
1963(hidden writes §8.4 + tally blinding §10.3 close those channels; tally-time hiding
1964rests solely on ≥1 honest accepted dealer, which the committee bound $f < \theta$ itself
1965implies, §10.3, with blinding delivered only to the frozen roster). The sequencer/prover that seals a
1966package learns its slot and whether it is an overwrite (§5.4), as in v2, and a malicious
1967sealer can disclose that; removing the refresh sample does not make sealers oblivious.
1968
1969### 12.3 The coercion statement
1970v3 keeps v2's informal posture (no formal receipt-freeness; a revote is hidden) and
1971improves on it for public data: there is **no predecessor-status spend object**, no
1972nullifier, no ticket, no counter, and since v1.6 **no per-slot mark of a revote at all**.
1973v2's public data let anyone conclude "this slot was never touched again, so its voter did
1974not revote"; here that conclusion is unavailable for an individual slot, outside the
1975degenerate cases of §12.1 (a batch holding one vote; an election with no later overwrite
1976at all). Drafts ≤1.3
1977lacked even v2's level; the review history (a demandable-ticket attack blocked the first
1978quota design) is why the standing rule is: *no public, finite, voter-derivable spend
1979objects of any kind*. The claims below were adversarially derived; wording is deliberately
1980exact.
1981
1982| Coercer's access | Defensible claim |
1983|---|---|
1984| Public data only | Nothing published names the slot of an overwrite, and no package-content equality test exists (there is no per-slot value). Participation, per-batch counts, timing, complaints, exclusions and tally leakage remain, with the edges listed in §12.1. |
1985| Captured unsubmitted authorization (a signed/proven but unsent package) | Its admission does not depend on whether an earlier package remains current: holding it reveals nothing about later revotes. Submitting it actively overwrites the voter's ballot; that is impersonation, not detection, and is not prevented (as in v2). The voter sees it happen, because they know that package's voteID (§5.2), and can cast again. |
1986| Identity key, or the coerced package's complete opening | Cannot derive a later-replacement status test from that material alone. A disclosed opening can still prove the historical package's admission and contents. Key possession permits impersonation, and an overwrite by a package the voter did not build is invisible to the voter (§5.3). **The v2 delta:** v2's sealer-side re-encryption meant no published ciphertext corresponded to a voter's opening, so even *historical* content was unprovable from public data; v3 publishes the voter-built package verbatim, so historical-content provability is inherent to the design. What is preserved, and is the coercion-relevant boundary, is that no material proves the package is still the *counted* ballot, and the voter can always revote after disclosure. The operational rules below (opening-export warnings; no UI claim that derivation proofs are harmless) exist for exactly this channel. |
1987| Identity key, used actively (a probe) | A coercer holding the key can submit a probe package for the victim's slot to the sequencer the victim uses: if the victim's own package already holds that slot's one-per-batch place, the probe is deferred a batch, which the coercer observes. This needs the key and the same sequencer, costs the coercer an overwrite of the victim's vote anyway, and exists in v2 as well; it is listed because "from that material alone" above does not cover active use. |
1988| A deliberately malformed coerced package | **A test exists in fixed-sum elections.** If the coercer makes the voter cast a package with broken transport, an honest warden excludes it (§9.2). Where every ballot's fields sum to a known constant, the result totals reveal how many ballots were counted, hence whether the excluded package was still its slot's final base. This is the public face of §9.2's "provable self-abstention": it lets a coercer enforce abstention, for one victim at a time, more precisely than v2's visible non-participation. Contribution proofs therefore never output counted or excluded totals, but the result itself can. |
1989| Adaptive demands for future authorizations | A demanded finite list is never exhaustive: the voter can always generate fresh randomness and another authorized ballot afterward. There is no committed finite universe (ticket or counter) to enumerate. |
1990| Full device snapshot BEFORE the escape vote | Protection requires fresh entropy after the snapshot and an uncompromised later submission path; merely continuing an extracted PRNG state is insufficient. |
1991| Continuous compromise, or disclosure of the escape package's opening | **Not protected**: the coercer recognizes or proves the later admission. Best achievable here is cancellation (the Hirt–Sako axiom [HS00]); the nullification failsafe is tracked (§15). |
1992| Sealing insider, or anyone able to read the write logs (§12.2) | **Not protected**: these parties learn the write history and can leak it. The sealing-sequencer boundary is v2's own; the log readers (θ wardens before the tally, any roster member after a share exchange) are v3's addition. |
1993
1994Also unaddressed, in v2 and v3 alike: **forced abstention** (per-slot participation is
1995public) and first-write visibility; hiding first writes too is tracked (§15). This is **not receipt-freeness or formal coercion
1996resistance** in the game-based sense of [KTV]; the claims are conditional on §12.1's hiding/PRF assumptions, honest
1997escape-vote sealing, and independent future voter randomness (which is why deterministic
1998recovery derivation was removed, §5.2).
1999
2000Additional documented leakage: complaint timing (§9.2; a malicious warden can time a valid
2001complaint as a signal or delay it past recovery) and scan-complete signal timing (§9.2's early
2002close is observable metadata).
2003
2004**Operational requirements for clients and deployments**: fresh CSPRNG package randomness
2005always (§5.2); explicit warnings before exporting identity keys or package openings; **no UI
2006or API claim that any derivation proof is harmless**; private authenticated submission to a
2007sequencer the voter trusts; truthful "included" vs "finally counted" status indication (a
2008vote-ID receipt proves inclusion, not final counting), computed over every voteID the
2009client ever released (§5.2).
2010
2011**Remaining roadmap** (§15 item 2): nullification failsafes (full-extraction class →
2012cancellation), trapdoor-chain depth precedence (last-minute coercion; protected-credential
2013assumptions), fake credentials (the strongest class). The literature's structural dichotomy,
2014recorded: duplicate resolution must either be keyed inside the batch program
2015(sealing-sequencer trust, v2's own posture) or moved to the θ-warden
2016tally (v3 since v1.6: the batch program only enforces one ballot per slot per batch, and
2017which package is a slot's last is resolved at the tally from the write logs); no known primitive gives public exactly-once enforcement that the involved voter
2018cannot be forced to re-derive.
2019
2020### 12.4 Proof-system notes
2021The pinned ballot STARK profile targets **≈106-bit** *conjectured* FRI soundness (18 queries × log₂32 + 16 grinding bits; ethSTARK heuristic
2022[ETHS]). That is an explicit engineering dial (queries × log-blowup + grinding), to be raised for
2023high-stakes deployments, and **not** claimed as 128-bit PQ security. The Blake3
2024Merkle/challenger layer uses **full** Blake3 (7 rounds is the standard, not a reduction) with
2025256-bit digests: ~128-bit classical collision resistance, adequate for the classical target
2026above, while generic *quantum* collision bounds on any 256-bit hash are ~2^85 query bounds
2027(BHT is the generic quantum collision-search algorithm, a query-count bound under heavy memory assumptions, not a practical attack cost); the profile is therefore justified against the
2028classical conjectured target, not claimed as ≥102-bit end-to-end quantum security (the same
2029caveat applies to a Poseidon2 profile). The ~2^85 figure concerns **collision resistance:
2030commitments and binding**. It does not mean 256-bit *keys* have 85-bit confidentiality
2031(generic quantum key search is the Grover ~2^128 regime). The v2-era prototype's
2032three known defects (weight-bound bypass at `maxValueSum=0`; wraparound-prone comparators;
2033weak hiding-PCS blinding RNG with a constant fallback seed) are normatively fixed in v3
2034(§6, statement item 1; 256-bit CSPRNG blinding seed, fail-closed).
2035
2036**Where Poseidon2 still lives.** Blake3 replaces Poseidon2 in application hashing
2037and the ballot proof system. Poseidon2 remains an **inherited ZisK proof-system dependency**:
2038a break there may compromise accepted state transitions and tally integrity, and can thereby
2039compromise privacy *during protocol execution* (e.g. forged transitions could overwrite
2040slots without authorization and mislead honest wardens into revealing a skewed aggregate).
2041Passive confidentiality of archived ballot transport and masking no longer relies on
2042application-level Poseidon2. "Repairable" means future executions can migrate to a repaired
2043verifier, not that past disclosures or finalized decisions can be undone. Why the move:
2044cryptanalysis of Poseidon2 is young and moving (round-estimate revisions [TOSC25],
2045the EF Poseidon attack-reward program [PINIT], and the FreeLunch family of algebraic attacks
2046on arithmetization-oriented primitives [FL24]), while Blake3 carries long-standing ARX
2047analysis. This is a conservatism call, not a response to any full-round break.
2048
2049**Every published proof must be hiding, not merely sound.** The ballot STARK is not the only
2050proof carrying secrets: batch proofs (the batch seed, $k_b$, every package's slot and the
2051write-log plaintext), complaint proofs,
2052**including chunked complaint proofs and their authenticated continuation states** (warden
2053key seeds, decapsulation outputs), dealer proofs (blinding coefficients), warden
2054contributions **and their chunk continuations** (KEM seeds, shares, payload keys; chunking
2055per §2.5) and
2056key-registration proofs all have sensitive witnesses. Each proof
2057profile must therefore be verified to be **zero-knowledge/hiding**, not only sound. Known
2058status: the BN254 PlonK wrapper applies explicit blinding; the hiding of ZisK's *native*
2059VADCOP-final STARK path (ZisK's last recursion stage, the proof the wrapper wraps) is **unverified**, which makes "drop the wrapper for direct STARK
2060verification" (§15) a **privacy question, not only a cost change**.
2061
2062### 12.5 Out of scope / inherited
2063EIP-4844 KZG commitments (Ethereum's own PQ roadmap), organizer/sequencer Ethereum accounts,
2064hybrid-mode ECDSA (by construction), the BN254 PlonK wrapper around ZisK proofs, and the
2065warden settlement accounts that authorize proof-less on-chain messages (§4: ceremony joins
2066and scan-complete signals; forging one moves closure timing and liveness only, §9.2; a
2067forged join cannot enter the roster without a valid SLH-DSA envelope, §10.4), and the
2068wallet keys that authorize PQ key registration and replacement (§11: an ECDSA forger
2069could enroll or replace a key ahead of a future election and then vote in it, even under
2070`pq-only`; elections already created are unaffected). These
2071classical dependencies are **integrity-critical, and an integrity failure during execution
2072can compromise privacy (§12.4)**. What they cannot do, provided the published proof paths
2073retain their required hiding and the KEM/PRF assumptions hold, is retroactively decrypt
2074archived ballots (breaking a proof system's *soundness* does not by itself recover
2075witnesses). The wrapper is replaceable by direct on-chain STARK verification (indicative public
2076data point: ~5-6 MGas for a WHIR/FRI verifier on the EVM [WHIR]; not a measured cost for ZisK
2077proofs; and a privacy-gated change, §12.4), tracked as the final migration phase.
2078
2079---
2080
2081## 13. Cost summary
2082
2083Annex A reports the proof-of-concept measurements behind this table, and separates what
2084was measured from what is extrapolated or estimated.
2085
2086| Metric | v2 | v3-PQ |
2087|---|---|---|
2088| Browser proving | seconds (Groth16, 35.5 MiB key download) | no key download. Final §6 circuit: projected ~2-4 s native, not yet built. Measured at the pinned profile on the prototype circuit: 1.7 s native single-thread, 4.5-5.2 s in WASM, 478 MiB peak (Annex A.4) |
2089| Ballot upload to sequencer | ~2 KB | 6-10 KB package at ν=5-8 + ~195 KB proof (proof not stored on-chain) |
2090| DA per ballot | ~2 KB, plus ~1-2 KB per refreshed slot | the package: 1.3 / 3.8 / 6.3 / 10.1 KB at ν = 1 / 3 / 5 / 8, plus 8 B of write log. A revote costs the same as a first vote; there are no refreshes (§8.6) |
2091| Blobs per 256-vote batch (16 fields) | 5 | 3 / 8 / 13 / 21 at ν = 1 / 3 / 5 / 8 |
2092| Batch proving, one RTX 5090, wrapped proof included | 76.7 s per 256-vote batch at 16 fields (0.30 s/vote); 46.2 s at 2 fields | **107 s per 256-ballot batch (0.42 s/vote), 61 s per 128, 38 s per 64**, measured (Annex A.1; verified proofs come from the prototype ballot circuit). ≈1.3-1.4× v2 at 16 fields |
2093| Prover hardware | one 32 GB-class GPU | the same: the wrap stage needs ≈30 GB of GPU memory and 32-38 GB of host RAM, for sequencers **and for every warden that submits a proof** (Annex A.2) |
2094| Tally | θ partial decryptions of one accumulator + BSGS | history-linear warden jobs over column views, $O(C + M\nu)$: inner loop measured at 9.4 compressions and ≈2,000 steps per package, ≈8 GPU-minutes per million casts by extrapolation (Annex A.2), + one ceremony + on-chain Lagrange (measured: 217-387k gas) |
2095| Settlement gas per batch | 498-667k for 1-4 blobs (v2 benchmark) | ≈0.41M + ≈50k per blob: 0.46M at 1 blob, 0.56M at 3, 0.71M at 6 (measured parts, Annex A.3) |
2096| Tally ceremony gas (fixed per election) | θ decryption transactions | ≈4.4M / 6.5M / 10.1M at ν/θ = 3/2, 5/3, 8/5; ≈1M in sequencer mode (**estimate** from measured parts: one wrapped-proof verification per roster proof, dealer and contribution; §15 item 11 tracks aggregating them) |
2097| Ceremony DA | — (DKG runs pre-election) | 2 signed publications per participant (join + share bundle; ~79/126 KB of SLH-DSA signatures at m=5/8) + share bundles ≈ m·96·M + m(m−1)·1152 B, ≈1.9/3.1 MB at m=5/8 for 1M casts in 256-cast batches |
2098| Registry tally cap | 10^12 | 2^61 |
2099
2100### 13.1 Positioning against the literature
2101
2102A 21-protocol, 17-property comparison against the academic and deployed state of the art
2103(Helios, Belenios, ElectionGuard, Civitas/JCJ, VoteAgain, DeVoS, VoteXX, MACI, Kryvos,
2104PQKryvos, T-EVOLVE, CRISP, Swiss Post, Estonia IVXV, and others; maintained with the research
2105artifacts) supports this positioning: **v3-PQ is the most complete post-quantum-private
2106design for permissionless on-chain voting**. As of late 2026 it is the only specified protocol
2107combining PQ ballot privacy, permissionless proof-enforced execution, multi-field ballots,
2108hidden revoting, and no shared decryption key; each near rival misses at least one pillar
2109(CRISP: no permissionless entry; FHE-based designs: operator consensus instead of proofs;
2110PQKryvos/T-EVOLVE: no revoting, trusted bulletin board; MACI: not PQ, trusted coordinator).
2111What the comparison does NOT support is an unqualified "top protocol" claim: the field
2112weights formal analysis, cast-as-intended deployment experience and audits, where v3-PQ is a
2113draft. Those are precisely the Phase-0 gates (§15), plus the §5.2 Benaloh flow. Known
2114property gaps vs specific systems, named explicitly: participation privacy (DeVoS's dummy
2115updates), everlasting privacy (open for the whole PQ complaint-based line), hidden tallies /
2116non-additive methods (PQKryvos; out of scope by design here), and formal machine-checked
2117analysis (Belenios, Swiss Post).
2118
2119---
2120
2121## 14. Errors and edge cases (normative)
2122
2123- **voteID collision** (admission finds the leaf occupied): resample `k` and re-cast, as
2124 v2.
2125- **Slot-write race** (two sequencers hold packages for the same slot): the first settles;
2126 the loser simply seals its package in a later batch against the new root. Nothing in the
2127 package refers to the slot's earlier contents, so there is nothing to rebase. Last
2128 settled write wins (§5.3). Voters who revote rapidly should use one sequencer, as v2
2129 advises.
2130- **Re-sealing a published batch.** A batch whose data was published but which did not
2131 settle may be re-sealed with the same or different packages. No cover rule applies
2132 (v2's coverage-history rule existed to keep refresh sets consistent across retries, and
2133 there are no refreshes), but two published versions that differ in content do reveal
2134 what §12.1 edge (c) describes, so sequencers SHOULD re-seal the same package set when
2135 they can. Every sealing uses a fresh seed; `sealCtx` makes an accidental reuse harmless
2136 (§8.5).
2137- **Stale package settled late.** A sequencer that held one of a voter's older packages
2138 settles it after the voter's newer one, rolling the slot back. The voter's client sees
2139 that package's voteID appear (§5.2) and casts again while casting is open.
2140- **Slot's final base excluded** ($P_s \in X$): the client detects it (public $X$, watchable
2141 from the moment of casting, §9.2) and informs the voter. **While casting is open,
2142 recovery is an ordinary overwrite** (§5.3, no special path). After the casting freeze, no
2143 recovery within the election.
2144- **Warden key unavailable at cast time**: the client refuses to cast (it cannot build a
2145 complete package); election creation already requires all ν keys registered (§4).
2146- **Ceremony participant failure**: absorbed by margin. A missing/invalid dealer before the
2147 dealer deadline simply doesn't enter $D$; after $D$ freezes, failures reduce the
2148 contributor margin (§10.4). An attempt fails only on the three deadline conditions of
2149 §10.4; if no attempt ever reaches θ, the tally is lost, counted under liveness (§9.3).
2150- **Invalid join.** A join whose envelope fails the roster proof's checks (bad signature,
2151 malformed key) is not in the roster: one slot of margin, no stall (§10.4).
2152
2153---
2154
2155## 15. Tracked upgrades
2156
21571. **In-AIR verifiable encapsulation** — prove **FIPS 203 ML-KEM-768 `Encaps` inside the
2158 ballot STARK**, retiring the complaint mechanism entirely (transport correctness becomes
2159 part of admission). Estimated (not measured): FIPS-exact ≈ +4M trace cells, +1.5-4 s native prover;
2160 fallback: K-PKE-768 with Blake3-derived coins (≈ +1.2M cells, +0.5-1 s) **plus a written
2161 IND-CCA argument** (FIPS 203 §3.3 forbids bare K-PKE; the FO-binding lemma of
2162 Takahashi–Zaverucha [TZ21] supplies the key step). **Never prove encryption with non-FO-derived
2163 coins** (decryption-failure oracles). Batch-guest verification deltas must be recomputed
2164 against the measured 2.53M-step-per-proof baseline (§8.1) before choosing the variant. (v1.2
2165 tracked "RLWE-LPR" here; withdrawn, since Ring-LWE over Goldilocks needs n ≥ 4096 and
2166 ≥6 KB ciphertexts, and dedicated lattice-VE schemes carry 19 KB proofs or relaxed
2167 decryption.)
21682. **PQ coercion-hardening ladder** (§12.3) — what remains after hidden writes
2169 (§5.3/§8.4; design history: a Merkle-cast-ticket quota was proposed
2170 and then **rejected by adversarial review**, because a coercer demands the remaining
2171 ticket tags and watches the public spend tree, so any public finite per-voter posting
2172 right is itself a coercion test; the quota-free design replaced it; v1.4 hid revotes
2173 behind re-blinded slot vectors, and v1.6 removed the per-slot mark altogether):
2174 a. **Nullification failsafe** (VoteXX-style Shamir-shared flags [VXX]): converts full key
2175 extraction from total loss into vote cancellation, the best achievable outcome for
2176 that class [HS00].
2177 b. **Trapdoor-chain depth precedence** [TDC] (deepest-position-wins at tally): adds
2178 last-minute-coercion resistance but admits a "cast at maximum depth" adaptive demand,
2179 presumes a protected credential store, and forces tally-time winner selection.
2180 Separate, deeper research.
2181 c. **Fake credentials** (JCJ lineage [JCJ]) with warden-held rosters: strongest target,
2182 heaviest machinery (deniable enrollment + a reviewed filtering trust model: insider
2183 secrecy, a PQ verifiable mix, or malicious-secure MPC; a zkVM proof alone does not
2184 hide filtering from its prover).
2185 d. **Hidden first writes** (participation privacy, the gap named in §13.1): drop the
2186 slot markers too, so that a first write is as invisible as an overwrite. The slot
2187 already travels only in the write log; what is missing is a replacement for the
2188 occupancy counter: an authenticated bound on eligible slots (the census leaf count
2189 for Merkle censuses, `idx < maxVoters` for CSP, append-only or excluded for dynamic
2190 off-chain censuses) so the tally cannot overflow, and acceptance that live turnout
2191 and overwrite counters disappear until the tally. It would hide participation from
2192 the public only: the sealing sequencer still sees the address, and roster members
2193 learn everything at tally. Not a small amendment; reviewed as worth tracking.
2194 e. **Compositional hiding argument for hidden writes** (formalization work, not
2195 a mechanism): a written game-based argument covering disclosed old openings, the
2196 encrypted write logs, per-batch counts, public proofs/continuations, and the final
2197 tally, feeding the ePrint submission (gate 7 below). The tally side is simple since
2198 v1.5 (published contributions depend only on final-base shares and $G$); the casting
2199 side is simpler since v1.6 (nothing per-slot is published).
22003. **Locked mode** as a separately specified and reviewed extension (§4).
22014. Direct on-chain STARK verification (drop the PlonK wrapper) once rollup gas permits,
2202 **gated on establishing the native proof path's hiding, not only its cost** (§12.4).
22035. **Multi-recipient Kyber transport** (KKPP20-style FO-mKEM [MMK]): one shared 960 B
2204 component + 128 B per warden ⇒ package 10,056 → 3,336 B at ν=8 (~3× DA cut: a 256-vote
2205 batch fits 7 blobs, inside one native settlement at 6 blobs for ≈220 votes) and 5,640 B
2206 at ν=16 (a 256-vote batch ≈ 1.47 MB ⇒ 12 blobs, bringing the 16-warden
2207 profile inside the 32-blob cap, §8.6); also the cheapest
2208 in-AIR circuit for item 1. **Gated on**: (i) warden-key well-formedness/distinctness
2209 proofs covering the pinned scheme's honest-key requirements (malicious keys break lattice
2210 multi-recipient schemes; a 2025 proof-free fix was broken within a year; §4's
2211 seed-derived keygen proof is the intended vehicle), and (ii) verified **per-recipient
2212 shared-secret independence** (a common secret across wardens would let a single warden
2213 unmask every column, which is fatal). The gate review SHOULD be scheduled alongside
2214 Phase 0, since this transport is also the cheapest circuit for item 1. (v1.2 tracked
2215 Classic McEliece here; withdrawn, §8.6.)
22166. **Proof-certified per-warden exclusion bitsets** for adversarial-extreme elections: each
2217 admission carries a public immutable **ordinal** (§8.4: settled batch number, then
2218 position in the batch's voteID order), bound to `pkgDigest` identically in
2219 every §8.7 column view; a bit never denotes different packages in different bitsets);
2220 per-warden bitset commitments $X_i$ updated only by their own warden's complaint proofs
2221 (monotone: set bits are preserved; every new bit justified), published as authenticated
2222 delta bitmaps; the election's $X$ = the union. Collapses 1M exclusions from a 32 MB
2223 digest list (≈512M gas of calldata) to a 125 KB bitmap. Deferred from v3.0: typical
2224 elections see ~0 exclusions, the per-package and chunked-batch complaint paths (§9.2)
2225 already exist, and item 1 retires the whole mechanism; adopt only if the Phase-0
2226 prototype shows complaint gas/DA is binding. "Normally zero complaints" never waives
2227 gate 8's all-malformed throughput test: if the digest representation fails it, adopt
2228 this item or shrink the supported workload envelope.
22297. **Confidential ceremony fault proofs**: ZK proofs binding a signed ceremony ciphertext,
2230 the recipient's ephemeral key, correct decapsulation/DEM processing and the §8.5 share
2231 commitment, outputting *which envelope entry is faulty* without revealing plaintext:
2232 publicly attributable misbehavior for slashing/eligibility policy. Deferred from v3.0:
2233 margin (§10.4) already keeps faults off the tally's critical path; this is
2234 accountability, not liveness.
22358. **Per-election warden keys** as an operational-lifecycle option: the §12.1 *lifetime*
2236 key-compromise assumption means rotating epochs does not protect old ballots if old
2237 secrets survive; per-election keys plus specified destruction (including backups) make the
2238 retention story auditable. (Ceremony keys are already ephemeral per attempt, §10.4.)
22399. **Fold-hash native blob registration**, if a native deployment ever needs > 6-blob
2240 batches (§8.6): constant registry storage per `(process, sender)`, with each registering
2241 transaction reading its own `blobhash` values and appending
2242 `h' = keccak256(h ‖ index ‖ versionedHash)`; settlement re-supplies the ordered hashes as
2243 calldata (≤ 1 KB) and re-folds. Recorded hazards from review: the maximum-registration-age
2244 window anchors to the **first** registration block (appends never renew availability); any
2245 state-root change still kills the whole fold; indices are bound inside the fold, so gaps
2246 or reordering fail the settlement re-fold; a mistaken append is uncorrectable except by
2247 reset (sender-anytime, permissionless after expiry); `blobhash` is still read in the
2248 registering transaction itself, so the versioned-hash binding adds no new KZG assumption.
2249 This replaces drafts ≤1.4's 32-slot indexed manifests (~640k gas of fresh SSTOREs) with
2250 constant storage.
225110. **Multi-election settlement** (`settleMany`): one batch-guest invocation proving an
2252 ordered table of independent transitions (unique process IDs, per-entry registry checks,
2253 stale entries skipped rather than poisoning the group), amortizing the measured ≈10 s
2254 proving pipeline and one wrapper verification across many small elections. Deferred from
2255 v3.0: 50 concurrent small elections need only 1-2 sustained GPUs, so the pipeline is not
2256 a fleet cliff; adopt if gate 8's synchronized closing-burst test shows otherwise.
225711. **Aggregated ceremony proofs.** The tally ceremony's on-chain footprint is its proof
2258 verifications: one roster proof, one per dealer and one per contribution, each a
2259 separately wrapped proof (≈6.5M gas in total at ν=5/θ=3, Annex A.3, the dominant fixed
2260 cost of a small election). Recursively aggregating an attempt's dealer proofs, and its θ
2261 contributions, into one wrapped proof each would take nine verifications down to three
2262 and save about 2.3M of that. Moving the 9 KB join envelopes out of calldata would save
2263 most of another 1.9M. Deferred
2264 from v3.0: it changes who proves what (an aggregator needs every dealer's proof but no
2265 secret), and sequencer mode already pays one proof.
2266
2267### Phase-0 gates (normative; pass before `ballotVKHash` is pinned)
2268
22691. Re-laid full-Blake3 ballot AIR: instrumented compression counts (first votes and revotes
2270 prove one statement; the net AIR shrink from removing the predecessor/nullifier clauses
2271 must be **measured, not assumed**, since fewer constraints need not cross a trace-padding
2272 boundary); measured native + browser proving (desktop and
2273 a 2023 mid-range phone; pass: browser p50 ≤ 10 s AND p95 peak prover memory ≤ 1.5 GiB on
2274 that phone, since the wasm32 address space and mobile tab limits bind before time does;
2275 else adopt the fallback FRI profile, whose batch-guest verification cost is pre-computed
2276 now so a late profile flip cannot invalidate GPU economics or deadline profiles);
2277 **per-nf test vectors** (packages, h_i, digests, views) for all nf = 1..16, incl.
2278 mask-prefix equality at nf boundaries and rejection of trailing inactive bytes.
22792. wasm32 challenger query-sampler fix + production hiding CSPRNG, with negative tests.
22803. **Byte-exact pinned encodings + negative test vectors** for every new structure:
2281 the ballot public vector including θ and the context parameters (§6; cross-threshold,
2282 cross-ν, cross-context and inconsistent-nf rejection); ColumnRecord, first-write lists,
2283 `viewAcc`/`viewsRoot` (encoding version 2) and the pre-digested payload envelope
2284 (§8.7); `sealCtx`, the σ derivation and the write-log envelope (§8.5; a same-seed
2285 re-seal with different contents must repeat no key, coin or nonce); the PQ key map
2286 (leaf and node tags, value encoding, membership and absence proofs, the creation-time
2287 snapshot, §8.2/§11; an enrolled voter presented as absent must be rejected; a replayed
2288 or cross-registry key authorization must be rejected after a replacement); the CSP
2289 credential message and context string (§11; cross-registry replay, changed index or
2290 key, forbidden zero `pk_PQ`); the join envelope, `joinCtx`, the roster program and the
2291 session id (§10.4; key substitution under a lifted signature, an omitted valid join, an
2292 included invalid join, a stale attempt, a wrong registered signing key, garbage bytes
2293 that must yield "invalid" and never abort); the ceremony bundle envelope (body + ordered
2294 per-recipient bundle-key wraps); scan-complete signal semantics (§9.2); the attempt
2295 state machine (§10.4: each of the three failure conditions, the latest permitted
2296 roster proof still leaving downstream time, delayed advancement creating exactly one
2297 new attempt); chunk continuation states (§2.5); and the §8.7 test list, which is
2298 normative. Also: overwrite after total client-state loss; a stale package settled
2299 after a newer one (the client's voteID watch must flag it); final-base exclusion with
2300 no occupancy reset; θ-subset tally invariance through overwrite chains and exclusions.
23014. **Hiding/zero-knowledge verification for every new published proof path**: chunked
2302 complaint proofs and warden-contribution chunks added to the §12.4 list; every statement
2303 branch and continuation path of the merged warden guest audited separately (one VK is
2304 not one hiding analysis); the VADCOP-final
2305 hiding question filed upstream with ZisK (feeds item 4 above); the §2.5 shape rule,
2306 tested on paired histories with identical public counts but different final-base and
2307 exclusion assignments, including at segment boundaries; plus the §15 item 2e
2308 compositional hiding argument for hidden writes.
23095. DEM security-argument appendix published (§2.1).
23106. The named high-stakes FRI profile (§2.3) documented alongside the default; the versioned
2311 deadline profiles (§2.3) calibrated once from measured scan/proving rates, never per
2312 election, with deadline-overflow and synchronized closing-burst
2313 workload tests; early-close tests (scan-complete signals and stage completion, §9.2 and
2314 §10.4, including θ-subset insufficiency); scaled ceremony deadlines.
23157. **ePrint submission of the construction** (masked Shamir shares over KEM transport +
2316 hidden writes with a θ-gated write log + the zero-blinded direct share-sum tally) for
2317 public peer review, the protocol's main novelty debt.
23188. Prototype-derived deployment limits: full batch proving cost, warden tally throughput,
2319 complaint throughput under adversarial all-malformed load (worst case remains linear in
2320 reported faults, §9.2), last-minute malformed floods, synchronized closing bursts across
2321 many concurrent elections, ceremony wall-clock,
2322 electorate/committee/deadline/hardware
2323 envelopes, measured under funded adversarial load, not modeled. The deployment profile
2324 publishes a **ν-sizing table** (ν=1 ≈ v2 cost with sole-operator trust; ν=3-5 for
2325 routine elections; ν=8 for genuinely high stakes): DA, ceremony and warden costs are all
2326 linear or worse in ν, and defaulting to ν=8 triples a fleet's DA bill for no threat-model
2327 reason.
23289. **Census compatibility, checked against deployed contracts, not the paper**: the
2329 batch guest's census verification is byte-compatible with the deployed v2 batch
2330 program (node hash, leaf packing, the `leaf < 2^248` rule, the slot rule, per-origin
2331 root policy); the deployed census contracts' slot-uniqueness check is confirmed to
2332 cover every slot v3 derives; and the PQKeyRegistry contract (address-authorized
2333 registration and replacement, the sparse map's on-chain update cost and behaviour under
2334 concurrent registrations) is built and measured.
2335
2336**First implementation target (from the external design review).** The atomic cost PoCs of
2337Annex A are done (per-component measurements, real proofs); what follows is the
2338*integration* target. A complete, reproducible
2339**3-of-5, ML-KEM-768 end-to-end election prototype**: browser casting through settlement,
2340complaints, exclusions, the ceremony, warden proofs, and on-chain finalization,
2341with these measured gates: the complete 16-field ballot relation including overwrites,
2342production hiding randomness, the exact pinned proof profile verified inside ZisK, full
2343batch proving cost **through the wrapped proof**, complaint throughput under adversarial
2344load, the complete warden tally job (archive authentication and last-write selection
2345across batches included), and the ceremony's real gas. Browser latency/memory and deployment limits
2346(electorate sizes, committee sizes, deadlines, hardware) are derived from those measurements,
2347not from component benchmarks. Warden-side statements (key well-formedness §4, complaints
2348§9.2, the roster proof §10.4, dealer §10.3, contributions §10.1) SHOULD compile into **one guest binary** with a
2349leading statement-type tag in the public outputs; every contract entry point checks its
2350exact expected tag, version, output schema and registry-derived context (a valid
2351low-obligation statement must never substitute for a complaint or contribution). That gives
2352one VK to pin and one audit target, while gate 4 still audits every branch separately.
2353
2354---
2355
2356## 16. References
2357
2358- [DAV2] Vocdoni, *DAVINCI protocol specification v2*. https://spec.davinci.vote
2359- [FIPS 203] NIST, *Module-Lattice-Based Key-Encapsulation Mechanism Standard (ML-KEM)*, 2024. https://doi.org/10.6028/NIST.FIPS.203
2360- [FIPS 205] NIST, *Stateless Hash-Based Digital Signature Standard (SLH-DSA)*, 2024. https://doi.org/10.6028/NIST.FIPS.205
2361- [Sha79] A. Shamir, *How to Share a Secret*, CACM 22(11), 1979.
2362- [DST] Vocdoni, *davinci-stark: Plonky3 ballot proof prototype*. https://github.com/vocdoni/davinci-stark
2363- [P3] Polygon Zero, *Plonky3*. https://github.com/Plonky3/Plonky3
2364- [ZISK] Polygon, *ZisK zkVM*. https://github.com/0xPolygonHermez/zisk
2365- [POS2] L. Grassi et al., *Poseidon2: A Faster Version of the Poseidon Hash Function*, ePrint 2023/323.
2366- [TOSC25] *Poseidon and Neptune: Gröbner Basis Cryptanalysis Exploiting Subspace Trails*, IACR ToSC. https://tosc.iacr.org/index.php/ToSC/article/view/12244
2367- [FL24] A. Bariant et al., *The Algebraic FreeLunch: Efficient Gröbner Basis Attacks Against Arithmetization-Oriented Primitives*, CRYPTO 2024 (ePrint 2024/347).
2368- [PINIT] Ethereum Foundation, *Poseidon Initiative — cryptanalysis attack reward program*. https://www.poseidon-initiative.info
2369- [B3] J. O'Connor, J.-P. Aumasson, S. Neves, Z. Wilcox-O'Hearn, *BLAKE3: one function, fast everywhere*. https://blake3.io
2370- [ETHS] StarkWare, *ethSTARK Documentation*, ePrint 2021/582.
2371- [EIP4844] V. Buterin et al., *EIP-4844: Shard Blob Transactions*, 2022.
2372- [IR89] R. Impagliazzo, S. Rudich, *Limits on the Provable Consequences of One-Way Permutations*, STOC 1989.
2373- [NOAH] M. Dahl et al., *Noah's Ark: Efficient Threshold-FHE Using Noise Flooding*, WAHC/CCS 2023.
2374- [TEV] J. Alizadeh, *Threshold Post-Quantum E-Voting from Lattice Commitments*, ePrint 2026/2500.
2375- [PQK] N. Huber et al., *PQKryvos: Post-Quantum Secure E-Voting With Flexible Ballot Formats and Public Tally-Hiding*, PoPETs 2026.
2376- [MMK] J. Katsumata, K. Kwiatkowski, F. Pintore, T. Prest, *Scalable Ciphertext Compression Techniques for Post-Quantum KEMs and their Applications* (multi-recipient Kyber), ePrint 2020/1107; and *mKyber* follow-ups, ePrint 2022/1046.
2377- [FOCT] *Careless to Compare: ML-KEM Key Recovery from Partial Fujisaki–Okamoto Re-encryption Comparison*, ePrint 2026/1682.
2378- [TZ21] A. Takahashi, G. Zaverucha, *Verifiable Encryption from MPC-in-the-Head*, ePrint 2021/1704 (App. B: FO binding).
2379- [HS00] M. Hirt, K. Sako, *Efficient Receipt-Free Voting Based on Homomorphic Encryption*, EUROCRYPT 2000 (the cancellation axiom for full extraction).
2380- [JCJ] A. Juels, D. Catalano, M. Jakobsson, *Coercion-Resistant Electronic Elections*, WPES 2005.
2381- [VXX] D. Chaum et al., *VoteXX: Extreme Coercion Resistance*, ePrint 2022/1212 (nullification).
2382- [TDC] J. Erdmanis, *Trapdoor-Chain Vote Precedence*, E-Vote-ID 2026 (depth-based precedence; smartcard-assisted).
2383- [KTV] R. Küsters, T. Truderung, A. Vogt, *A Game-Based Definition of Coercion-Resistance and its Applications*, CSF 2010 (the game-based framework a formal treatment of §12.3 would use).
2384- [KEMB] *ML-KEM WebAssembly implementations and benchmarks*. https://github.com/dchest/mlkem-wasm
2385- [WHIR] *EVM Verification of WHIR over a 31-bit Field*, ethresear.ch, 2025.
2386
2387---
2388
2389## Annex A: measured feasibility (proof-of-concept results)
2390
2391*This annex answers one question: can this specification be implemented, at production
2392scale, with today's tools? The main cost drivers were built as small, self-contained
2393proofs of concept and measured with real GPU proving on 2026 commodity hardware. An
2394independent audit of the previous version of this annex found it claimed more than it had
2395measured, so every figure below carries one of three labels. **Measured**: a proof was
2396generated and verified, or gas was read from an executed transaction. **Extrapolated**:
2397scaled linearly from measured runs. **Estimated**: composed from measured parts plus stated
2398assumptions. A.6 lists what is not measured at all.*
2399
2400**Method.** Eight PoCs (Rust ZisK guests, a WASM prover build, Solidity under Foundry),
2401each atomic: in-guest ML-KEM-768; the batch guest's per-package state work; a **combined
2402batch guest** running proof verification and state work in one program; the wrap that
2403turns a ZisK proof into one the EVM can verify; the warden tally inner loop; the voter's
2404ballot prover at the pinned profile, native and in WASM; the on-chain contracts; and the
2405on-chain verification of our own wrapped proofs. Hardware: one NVIDIA RTX 5090 (32 GB),
240659 GB host RAM. Toolchain: cargo-zisk 1.3.0-alpha (GPU) for the STARK-stage figures and
2407the 1.3.2-alpha production GPU binaries for everything involving the wrap, with the STARK
2408stage re-measured the same day (within −2% to +8%); ziskemu for exact step counts, Node/V8
2409for WASM, Foundry for gas. Parameters: ν=8, nf=16, θ=5 for the guests (the heaviest v3.0
2410profile) unless stated. Guest outputs are checked byte-for-byte against independent native
2411recomputation, and every kernel ships negative tests (a corrupted witness share aborts the
2412tally guest; tampered batch inputs and corrupted ballot proofs are rejected; a tampered
2413ciphertext is rejected by the FO check at identical step count). Every GPU proof quoted
2414passed `cargo-zisk verify`. Sources, reproduction commands and raw logs will be published
2415with the reference implementation (§6's provenance rule applies).
2416
2417**Two limits apply throughout.** The ballot proofs being verified in-guest, and proven in
2418the browser, come from the **prototype ballot circuit** (a v2-era circuit: 2,048 × 379
2419trace, 123 public values), not the final §6 circuit, which does not exist yet. And the
2420state-work guests implement the batch format of draft v1.5. v1.6 removes work from that
2421format (slot vectors, blinding derivations, refresh updates) and adds one key-map lookup
2422per package (§8.2, up to 160 Keccak calls) and changes the census path's hash, so the
2423state-work figures are expected to be close to an upper bound for v1.6. That expectation
2424is not a measurement.
2425
2426### A.1 Sequencer: throughput and hardware
2427
2428**Measured**, per component, in guest steps:
2429
2430| Component | Steps |
2431|---|---|
2432| Ballot-proof verification (§8.1) | 2.53M per proof + ≈2.7M once per batch |
2433| State work per package (digests, census path, SMT writes, column views, the v1.5 slot updates) | 0.161M per package + 0.13M per batch |
2434| **Combined guest** (both of the above in one program, one proof) | **2.71M per package**, additive to within 0.4% |
2435| §8.5 payload: ν=8 ML-KEM encapsulations, measured in its own guest | 3.7M per batch (not in the combined guest) |
2436
2437**Measured**, wall-clock on one GPU, combined guest:
2438
2439| Ballots per batch | STARK stage | **Wrapped proof, ready for the chain** | Votes/s/GPU, wrapped | v2 production, wrapped, 16 fields |
2440|---|---|---|---|---|
2441| 64 | 33.0 s | **38.2 s** | 1.68 | 30.3 s (2.1/s) |
2442| 128 | 56.4 s | **61.1 s** | 2.10 | 45.7 s (2.8/s) |
2443| 256 | 103.7 s | **107.3 s** | 2.39 | 76.7 s (3.3/s) |
2444
2445
2446
2447The wrap (recursion to one final STARK, then a PLONK proof over BN254) adds **≈5.2 s per
2448proof whatever the proof's size**; the previous version of this annex omitted it. Adding
2449the ML-KEM payload (≈0.4 s per batch, estimated from its own guest) changes only the last
2450digit of those rates. So one GPU sustains **1.7 to 2.4 votes per second with on-chain-ready
2451proofs**, 145k to 206k votes a day, and v3 costs **1.3 to 1.4× v2's proving per vote** at
245216 ballot fields.
2453
2454
2455
2456Verifying the voter's proof is 78% of a vote's proving time at 256 per batch; all state
2457work is 8%; the rest is fixed cost per batch. The marginal cost is 0.37 s per extra ballot
2458at GPU saturation (0.333 s verification + 0.036 s state work); small batches measured
2459earlier understated it at 0.30 s.
2460
2461**Hardware (measured).** The wrap stage asks for 30.05 GB of GPU memory, against 30.32 GB
2462available on a 32 GB card, and 32-38 GB of host RAM. A 256-ballot batch peaks at 47 GB of
2463host RAM, or 38 GB with the prover's low-memory flag at a 10% time cost (118 s). A
2464sequencer therefore needs a 32 GB-class GPU and 48-64 GB of RAM, the same class v2's prover
2465uses. One of three 256-ballot runs without the low-memory flag hung in the STARK stage and
2466was killed by the prover's own timeout; both retries passed, and production already
2467treats that error as transient and retries in low-memory mode.
2468
2469**Extrapolated.** A 100k-voter election with 120k casts needs ≈14 GPU-hours of sequencer
2470proving at 256 per batch, ≈16.5 at the 119 per batch that native settlement allows at ν=5,
2471≈19 at the 74 it allows at ν=8 (§8.6), parallelizable across sequencers as in v2. At an
2472assumed USD 0.5-1.5 per GPU-hour that is USD 7-30 per election, under USD 0.0003 per voter; the rental price is an assumption, not a measurement. "Fifty concurrent small
2473elections on one or two GPUs" is likewise an estimate from the ≈16 s all-in cost of a
2474small wrapped proof, not a measured load test (gate 8).
2475
2476**What the combined guest does not contain.** It verifies real ballot proofs and runs the
2477state work, but the proofs' public values are not yet bound to the packages (they are
2478hashed into the output; a real equality check would cost about the same); it has no
2479occupancy counter, no `hybridSig` ECDSA, no key-map lookup, and no encapsulations. All are
2480small next to the 2.5M steps of one verification, and the 3-of-5 prototype (§15) is where
2481they get measured together.
2482
2483### A.2 Wardens
2484
2485**Measured.** The inner loop of the §10.1 contribution was built for its hashing, against
2486the v1.5 log format: column-record folding, the $h_i$ opening against witnessed $(s, K)$, per-batch
2487key-share commitment checks and key reconstruction, log decryption, share accumulation.
2488It costs **1,988 steps and 9.37 Blake3 compressions per counted package** (3.85 for the
2489record, 4.00 for the opening, 1.52 amortized per-batch work), flat from 1k to 102k
2490packages. Runs: 1,024 packages in 10.9 s (15.9 s wrapped); 10,240 in 13.6 s; 102,400 in
249144 s at 27.6 GiB of host RAM. Nine other tampered inputs besides the corrupted share are
2492each rejected by their named check.
2493
2494**Extrapolated.** A million-cast contribution is ≈10 such chunks: ≈6 minutes of proving,
2495≈7 minutes of wall-clock, ≈8 with a wrap per chunk. No million-cast job was proven as one, and chunk
2496linking (§2.5) is not implemented.
2497
2498
2499
2500**Not in that measurement:** selecting each slot's last package across batches (the PoC
2501counts every package, the worst case for the secret work but with no slot map); the
2502exclusion set; opening the blinding commitments; the statement's bindings to snapshot,
2503session and dealer set. The slot map is the only one that scales with the election: a
2504map lookup and update per package.
2505
2506**Complaints (measured unit, extrapolated totals).** One proven decapsulation with the
2507full FO check costs 608K steps, 0.064 s of GPU at the margin. An ordinary complaint about
2508one package is a small proof, ≈16 s all-in with its wrap. The funded adversarial worst
2509case, a complaint against every package, is ≈2.1 GPU-hours per warden at 120k casts and
2510≈18 at a million, which is the workload the deadline profiles (§2.3) provision for.
2511
2512**Hardware: the correction that matters.** Every proof a warden submits on-chain
2513(contribution, dealer bundle, complaint, and the permissionless roster proof) must be
2514wrapped, and the wrap needs the same ≈30 GB of GPU memory and 32-38 GB of host RAM as a
2515sequencer's. The work is light (minutes), but the machine is not: as configured, **a
2516warden needs a 32 GB-class GPU**, not a laptop. Two ways around it exist and neither is
2517measured: a CPU wrap path, and handing the final STARK to someone else to wrap, which is
2518acceptable only once that proof's hiding is established (§12.4, gate 4), since it carries
2519the warden's secrets in its witness.
2520
2521### A.3 Ethereum
2522
2523**Measured** (Foundry; the Lagrange test reconstructs known tallies from Shamir sum-shares
2524and must match exactly; the point-evaluation precompile was exercised with a valid KZG
2525vector; the wrapper verifier was run on **our own** wrapped proofs with the program key
2526and root pinned, and rejects a flipped proof byte, a flipped public value, another
2527program's key and a swapped proof):
2528
2529| Item | Gas |
2530|---|---|
2531| `finalizeResults`, the on-chain tally, θ = 1 / 3 / 5 / 8 (whole transaction) | 162k / 217k / 278k / 387k |
2532| `scanComplete` signal, middle / freeze-triggering (whole transaction) | 75k / 97k |
2533| Wrapped-proof verification, our batch proof / our tally proof (execution) | 271,146 / 269,898 |
2534| The same as a standalone transaction | 306k |
2535| Point-evaluation precompile, per blob | 50,461 |
2536| Settlement bookkeeping in a stand-in contract ($z_b$ keccaks, `archiveAcc` fold, root, counters) | 57k |
2537
2538The verifier is PLONK over BN254 with a 768-byte proof and one public input, so its gas
2539does not depend on the guest or the batch size. Interpolating the result on-chain, the
2540step that replaces v2's threshold decryption, costs about as much as one DEX trade. No
2541contract verifies SLH-DSA, Blake3 or anything else exotic.
2542
2543**Estimated: settlement per batch.** 21k base + 57k bookkeeping + ≈44k for the per-batch
2544view checkpoint (§8.7, a new storage slot) + 271k verification + ≈16k calldata + 50.5k per
2545blob: **≈0.41M + 50k per blob**, i.e. 0.46M at 1 blob, 0.56M at 3 and 0.71M at 6. v2's production
2546benchmark of the same flow is 498-667k for 1-4 blobs, the same shape.
2547
2548**Estimated: the tally ceremony, fixed per election.** At ν=5, θ=3: creation 0.30M
2549(estimate), five scan signals 0.40M, five joins 1.92M (each carries a ≈9 KB envelope as
2550calldata, which pays the EIP-7623 floor of about 40 gas per byte: ≈0.38M per join,
2551computed, not measured), the roster proof 0.35M, five dealer proofs 1.83M, five
2552share-bundle transactions 0.35M (estimate), three contributions 1.19M, finalization
25530.22M: **≈6.5M gas**, of which 3.4M is nine proof-carrying transactions and 1.9M is join
2554calldata. ≈4.4M at ν/θ = 3/2, ≈10.1M at 8/5, ≈1M in sequencer mode. This is the dominant
2555cost of a small election, it is several times what the previous version of this annex
2556stated (≈1M, which counted no proof verifications), and §15 item 11 tracks cutting it.
2557
2558**Estimated: whole elections, native settlement** (at most 6 blobs per batch, which sets
2559the batch size, §8.6):
2560
2561| ν / θ | Votes per batch | 500 voters: batches, execution gas, per voter | 100k voters, 120k casts: batches, execution gas, per voter | Blob gas, 100k voters |
2562|---|---|---|---|---|
2563| 1 / 1 | 256 (3 blobs) | 2, 2.1M, 4.2k | 469, 264M, 2.6k | 184M |
2564| 3 / 2 | 197 | 3, 6.6M, 13.1k | 610, 439M, 4.4k | 480M |
2565| 5 / 3 | 119 | 5, 10.1M, 20.2k | 1,009, 725M, 7.2k | 794M |
2566| 8 / 5 | 74 | 7, 15.1M, 30.1k | 1,622, 1,165M, 11.6k | 1,276M |
2567
2568
2569
2570In money, at USD 3k per ETH, execution alone costs a 100k-voter election USD 0.008 to USD 0.035 per
2571voter at 1 gwei and ten times that at 10 gwei; a 500-voter election, where the ceremony
2572dominates, USD 0.01 to USD 0.09 per voter at 1 gwei. Blob gas is a separate market: priced as
2573high as execution gas it would roughly double the large-election figures, and it normally
2574trades far lower. (The previous version of this annex quoted USD 0.02-0.21 per voter for the
2575100k case from a model that settled 256-vote batches in 6 blobs, which only ν=1 can do;
2576the corrected figure for ν=5 at 10 gwei is USD 0.22 execution-only.) Two things would move
2577these numbers a lot and are not costed here: settling on a rollup with L1 blobs (v2's
2578production path, where execution gas is far cheaper; its inclusion-proof flow has no
2579measurement in this annex), and the multi-recipient transport of §15 item 5, which would
2580triple the votes per blob.
2581
2582### A.4 The voter: proving a ballot in the browser
2583
2584**Measured** on the prototype ballot circuit at the pinned proof profile (§2.3: blowup 32,
258518 FRI queries, 16-bit grinding, hiding PCS, Blake3 transcript), natively and compiled to
2586WASM under Node's V8 (Chrome's engine), with the wasm32 challenger defect patched (a
2587one-line u64 comparison; unpatched, wasm32 proving panics at **every** profile, so the fix
2588is a prerequisite for any browser proving, §6). A pinned-profile proof made in WASM
2589verifies under the native verifier and is rejected after a one-byte flip or under the
2590wrong profile. "Browser" here means that engine run from the command line: no real
2591browser tab was measured.
2592
2593| Profile | Native, 1 thread | WASM, warm (cold first proof) | Proof size | Peak WASM memory |
2594|---|---|---|---|---|
2595| blowup 8 / 34 queries (baseline) | 0.70 s | 2.3 s (2.5 s) | 324 KB | 122 MiB |
2596| fallback: blowup 16 / 26 queries | 1.05 s | 3.0 s (3.4 s) | 264 KB | 240 MiB |
2597| **pinned: blowup 32 / 18 queries** | **1.71 s** | **4.5 s (5.2 s)** | **196 KB** | **478 MiB** |
2598
2599
2600
2601Against the Phase-0 gate (p50 ≤ 10 s and ≤ 1.5 GiB on a 2023 mid-range phone): **time
2602passes with ≈2× headroom on desktop hardware** (a phone more than ≈2× slower than this
2603desktop, or a final circuit more than ≈2× heavier, consumes it), and **memory sits at
2604about a third of the budget** (478 MiB of linear memory; 614 MiB for the whole Node
2605process). Memory does not depend on CPU speed, so that verdict carries to phones for this
2606circuit, with room for one doubling of the final circuit's rows but not two. Proof size
2607came in 39% below the blowup-8 baseline, as §2.3 states, and the blowup-8 → 32 cost
2608multiplier is 2.45× single-threaded, 2.0× in WASM. The essential caveat: this is the
2609prototype circuit, not the final §6 ballot AIR with the re-laid in-AIR Blake3 section;
2610these numbers are floors and scaling factors, and gate 1's phone benchmark remains the
2611decisive test. The fallback profile buys ≈35% of the time and half the memory for 34%
2612larger proofs: a real safety valve if the final circuit runs heavy. Not measured: any real
2613browser tab, Firefox
2614and Safari engines, real phones, WASM threads.
2615
2616### A.5 ML-KEM-768 inside the zkVM
2617
2618**Measured** (RustCrypto `ml-kem`, 24 verified proofs):
2619
2620| Operation | Steps (Keccak precompile) | Steps (pure software) | GPU marginal |
2621|---|---|---|---|
2622| Encapsulation | 462K | 1.04M | 0.049 s |
2623| Decapsulation + full constant-time FO comparison | 608K | 1.24M | 0.064 s |
2624
2625The §8.5 batch payload (ν encapsulations) is a per-batch cost of ≈0.4 s GPU at ν=8,
2626invisible per vote. The §2 normative FO rule is precisely what the measured implementation
2627does: the re-encrypted ciphertext is compared over all 1,088 bytes with no early exit,
2628verified in source and by a tamper test that completes in the identical step count on the
2629rejection path. The decapsulation guest measures the primitive; it does not yet bind the
2630warden's registered key seed or the package's $h_i$ as a real complaint proof must.
2631
2632### A.6 What this annex establishes, and what it does not
2633
2634**Established by measurement.** One guest can verify ballot proofs and do the batch's
2635state work, and prove 256 ballots in under two minutes on one consumer GPU, wrapped; the
263664-ballot wrapped proof was verified by the production verifier contract on a local chain
2637for 271k gas. The per-vote proving cost is
2638within 1.4× of v2's. A warden's tally loop costs ≈2,000 steps per package. A WASM
2639build proves a ballot at the pinned profile in about five seconds and under half a
2640gigabyte, on desktop hardware under V8. ML-KEM inside the zkVM costs about half a million steps per operation. The
2641contracts need no unusual cryptography, and the on-chain tally costs a few hundred
2642thousand gas.
2643
2644**Extrapolated or estimated, and labelled so above:** million-cast warden jobs; GPU-hours
2645and dollar costs per election; the ceremony's gas; whole-election gas tables.
2646
2647**Not measured, and owned by the Phase-0 gates (§15):**
2648- the **final ballot circuit**, on which both the browser numbers and the in-guest
2649 verification cost (78% of sequencer time) depend;
2650- the v1.6 batch format itself (hidden writes, the key-map lookup, `sealCtx`, the Keccak
2651 census path), expected but not shown to cost no more than the measured v1.5 format;
2652- the complete contribution proof (slot map across batches, exclusions, bindings) and
2653 chunk linking;
2654- the roster, dealer and complaint guests as real statements, and SLH-DSA credential
2655 verification per package for CSP censuses;
2656- a CPU wrap path, or any way for a warden without a 32 GB GPU to submit a proof;
2657- real phones and non-V8 browser engines;
2658- the registry contracts themselves (creation, the key registry, the attempt state
2659 machine) and rollup settlement;
2660- anything under adversarial or concurrent load.
2661
2662What moved against earlier claims: saturated verification costs 0.333 s per proof, not
26630.30; the wrap adds 5 s per proof; a warden needs a large GPU; large elections cost two to
2664three and a half times the Ethereum gas first reported, and the ceremony's fixed gas
2665several times (≈6.5M against ≈1M at five wardens).
2666What moved in favour: v3's proving cost is close to v2's, not an order of magnitude above
2667it; the tally loop landed at the low end of its projection; the prover multiplier of the
2668pinned profile is below the assumed one; and v1.6's hidden writes cut 17 to 24% of every
2669batch's data.