davinci-paper/v3-pq/spec.md
v3-pq/spec.mdRaw
1# DAVINCI v3-PQ — Post-Quantum Protocol Specification
2
3**Status:** draft v1.5 · 2026-10-25 · **simplification and operability round** on the v1.4
4blinded-slot mainline. The warden contribution is now a **direct share sum** (§10.1; the
5layered unwind equation is removed, with equal tallies and a smaller proof); every
6post-freeze stage closes **early on completion**, not only the complaint window (§9.2,
7§10.4); on-chain protocol messages are authorized by registered warden **accounts**, and
8SLH-DSA is never verified on-chain (§4); ceremony share bundles use per-sender **bundle
9keys**, O(m·M) instead of O(m²·M) bytes (§10.4); the multi-transaction native-blob
10registration subsystem and the initialization-only transition are **removed** (§8.6, §9.1);
11new: a v2→v3 census conversion proof (§8.2), named deadline profiles (§2.3), a ν=θ=1 fast
12path (§10.4), and one consolidated chunked-proving contract (§2.5). Carries forward from
13v1.4: blinded-slot revoting (ordinary slot overwrites over public masked slot vectors, no
14nullifiers, no predecessor consumption, no chain counters, no batch pad), nf-sized packages,
15adaptive workload-based deadlines, the Benaloh cast-as-intended audit; from v1.3: unified
16Blake3 profile, per-warden column views (§8.7), ceremony v2 (§10.3-10.4), early complaints
17with voter recovery (§9.2), ML-KEM-768-only transport.
18v2 remains the deployed protocol. Reviewed: three adversarial soundness rounds + five
19improvement design rounds (protocol reviewer, incl. one that **blocked** a candidate quota
20design with a concrete attack) + audience-representative sign-off + one external design
21review + three adversarial synthesis reviews + three literature surveys incl. a 21-protocol
22SoTA comparison; a final consolidated review gates implementation (Phase 0).
23**Annex A** reports measured proof-of-concept results (real GPU proving, gas) for every
24load-bearing cost in this document.
25**Audience:** engineers who already know [DAVINCI v2](https://spec.davinci.vote). This document only
26specifies what *changes*. Everything not mentioned here (settlement flow, grace window, blob
27verification via the point-evaluation precompile, census origins, sequencer lifecycle, process
28registry mechanics) works exactly as in v2 [DAV2].
29
30---
31
32## 1. Why v3, in one paragraph
33
34Every ballot DAVINCI v2 publishes in Ethereum blobs [EIP4844] is an ElGamal ciphertext over
35BabyJubjub. Published blob data can be archived by anyone indefinitely, and ElGamal falls to
36Shor's algorithm, so a future quantum computer decrypts **past elections retroactively**
37("harvest now, decrypt later"). Integrity is less urgent (a settled chain cannot be rewritten
38under Ethereum's finality assumptions), but **ballot privacy must be post-quantum today**.
39v3-PQ removes the quantum-vulnerable primitives from the ballot *confidentiality* path: no
40shared-key homomorphic encryption, no pairings, no DKG, no Groth16. Ballot secrecy rests on
41polynomial secret sharing, hashes, STARKs, and one NIST-standardized KEM (a post-quantum
42"public-key lockbox"; §2.4 defines all such terms plainly). The KEM is never
43proven inside the voter's circuit (the batch guest performs encapsulations, and rare complaint
44proofs perform decapsulations; see §8.5, §9.2). During the hybrid period voter authentication
45still *also* uses ECDSA (§11), and the settlement wrapper and KZG blob commitments remain
46inherited non-PQ dependencies (§12.5).
47
48### Changes at a glance
49
50| Component | v2 | v3-PQ |
51|---|---|---|
52| Ballot confidentiality | ElGamal over BabyJubjub (threshold key) | Shamir shares + PRF masks over KEM transport (§3) |
53| Ballot proof | Groth16 over BN254 (circom, trusted setup) | Plonky3 STARK over Goldilocks, browser WASM (§6) |
54| Election key | DKG / council ceremony (BabyJubjub) | **None.** Wardens register ML-KEM keys (§4) |
55| Tally | Threshold decryption + BSGS search | Lagrange interpolation of θ proven warden sums (§10) |
56| Running tally | Homomorphic ciphertext accumulator | Sum of public blinded slot vectors over Goldilocks (§8.4) |
57| Silent revoting | Re-encryption of stored ciphertexts | Uniform blinded slot-vector updates: refreshes and overwrites publish identical records (§7, §8.4) |
58| Revotes | Slot overwrite + ciphertext subtraction | Slot overwrite + slot-vector delta, with **no nullifiers, no predecessor consumption, no revote budget** (§5.3) |
59| Voter authentication | ECDSA (secp256k1) | Hash-preimage proof in-STARK; `hybrid` verifies **both**; `hybrid-legacy` admits unenrolled voters on ECDSA (§11) |
60| CSP credentials | ECDSA | SLH-DSA (SPHINCS+) [FIPS 205] |
61| Batch proof | ZisK, verifies Groth16 (BN254 precompiles) | ZisK [ZISK], verifies ballot STARKs (Blake3 precompile) |
62| Protocol hash | Poseidon (circuits) + SHA-256 (state) + Keccak (Ethereum) | **Blake3 everywhere the protocol chooses** (§2); keccak/SHAKE/SHA-2 survive only as fixed islands |
63| Tally bound | maxValue·maxVoters ≤ 10^12 (BSGS limit) | ≤ 2^61 (field headroom; no search) |
64
65
66
67---
68
69## Protocol intuition (read this first)
70
71*This walkthrough is self-contained: you need no prior DAVINCI knowledge. Every term used
72loosely here gets a precise definition from §2 onward; the jargon cheat-sheet is §2.4.
73Readers who know v2 will recognize the shape; the deltas are marked "(v2: …)".*
74
75### The cast
76
77| Who | What they do | What you have to trust them with |
78|---|---|---|
79| **You, the voter** | vote from a browser; revote whenever you like | your own device |
80| **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) |
81| **ν 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: fewer than θ of them must stay honest. 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) |
82| **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 |
83| **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 |
84| **Observers** | anyone. All published data is enough to replay and re-check the whole election | — |
85
86Each eligible voter owns one fixed **slot**, a position in the public state that holds their
87current (hidden) vote. Revoting just writes your slot again; the last write before closing
88counts. Revoting is deliberate: it is what lets a pressured or coerced voter
89quietly change their vote later. (v2 had the same census, slots, sequencers and contract.)
90
91### The trick, with tiny numbers
92
93Everything rests on one idea from 1979, Shamir secret sharing, plus the observation
94that *shares add up*. Suppose θ=2, ν=3, and all arithmetic is modulo some large prime.
95
96- **Alice votes 1.** Her browser picks a random line through her vote:
97 $f_A(x) = 1 + 4x$. Her three *shares* are $f_A(1)=5$, $f_A(2)=9$, $f_A(3)=13$, one per
98 warden. Any two shares pin down the line and reveal $f_A(0)=1$. One share alone says
99 *nothing*: for every possible vote $v$ there is a line through $(0, v)$ and $(1, 5)$, so
100 the share 5 is perfectly consistent with Alice voting 0, 1, or anything else.
101- **Bob votes 0.** His line: $f_B(x) = 0 + 2x$. Shares: 2, 4, 6.
102- Shares are never shown in the clear. Alice hides each one under a **mask**: a random
103 number only warden $i$ will be able to recompute, because its key is locked in that
104 warden's lockbox. Say her masks are 20, 50, 70: she publishes 25, 59, 83. Bob's masks are
105 10, 30, 40: he publishes 12, 34, 46. To everyone else these six numbers are pure static.
106- The public **running total** per warden is just the sum of published numbers:
107 warden 1: 37, warden 2: 93, warden 3: 129.
108- **After the election**, warden 1 opens its lockboxes, recomputes its two masks
109 (20 and 10), and subtracts: $37 - 30 = 7$. Warden 2: $93 - 80 = 13$. Those are points of
110 the *sum* line $F(x) = f_A(x) + f_B(x) = 1 + 6x$: indeed $F(1)=7$, $F(2)=13$. The
111 contract draws the line through $(1,7)$ and $(2,13)$ and reads it at zero: $F(0) = 1$.
112 **One yes-vote, and no group of fewer than θ wardens can ever tell whose.** (Warden 1
113 did learn one point of each voter's line along the way, which, as above, is consistent
114 with any vote.)
115
116Two footnotes. Real elections use a huge prime modulus, so
117"random-looking" means genuinely indistinguishable from noise; the small numbers here are
118for readability. And a real ballot is a short *vector* of numbers, one per option ("rate 5
119candidates" is five values; voting weights scale them under the election's rules). Everything
120shown here just happens once per position, and the result is a vector of per-option totals.
121
122No warden ever learns a ballot (one share is noise). No decryption key for "the votes"
123exists anywhere, so there is nothing to steal, leak, or break, short of θ wardens
124colluding, which is the same committee-trust every threshold scheme has. That's the whole
125protocol; the rest is making every step *provable* so nobody has to be trusted for
126correctness.
127
128
129
130### The same story, phase by phase
131
132**Setup.** The organizer registers the election on the contract: census, ballot rules,
133schedule, and which ν registered wardens form the committee. That's it: because wardens'
134lockbox keys already exist, there is **no key-generation ceremony and no election
135encryption key**. (v2 ran a distributed key generation, DKG, to create a shared key
136before every election; that whole phase is gone.)
137
138**Casting.** Your browser splits each ballot value into ν shares, masks them, locks the
139mask keys into the wardens' lockboxes, and, right there in the browser, generates a
140zero-knowledge proof (a STARK: a proof made only of hashes, no trusted setup) that the
141whole construction is honest: the shares encode one valid ballot that follows the election
142rules, the masks match their commitments, and you hold the secret key behind your voter
143identity, a hash-based key that is itself post-quantum (elections may *additionally* accept
144classical wallet signatures during migration, §11), while the batch step below checks that
145identity against the census and your slot.
146The *package* you send (masked shares, locked boxes, commitments) goes to a
147sequencer of your choice over a private channel, proof attached. If you don't trust your
148own browser, you can demand it open any candidate package for inspection on a second
149device, then discard it and cast a fresh one (§5.2); a cheating client gets caught.
150
151**Voting period.** Sequencers verify incoming proofs, bundle packages into batches, and
152settle each batch: the contract accepts it only with a proof that *every* rule was followed
153(this proof is produced by a zkVM, a virtual machine whose entire execution is provable).
154The bulky data, packages and slot vectors, rides along in Ethereum *blobs*, cheap bulk
155storage attached to the transaction; the contract itself keeps only tiny commitments and
156the verified state.
157
158Your slot then holds a public **blinded vector**: your masked shares with an extra layer of
159blinding added by the sequencer. Why the extra layer? Consider revoting without it: your
160slot's numbers would change from your old package's numbers to your new package's, and
161since packages are public, anyone could match the change and see you revoted. So the
162sequencer re-blinds, and each batch *also* re-blinds a sample of slots whose
163owners did nothing, **sized by protocol rule so that revotes don't stand alone** (a single
164overwrite travels with sixteen look-alike refreshes, or as many as there are other occupied
165slots; in a nearly-empty election there is little crowd to hide in, as in v2). The result:
166**a revote and a routine "refresh" publish byte-identical
167kinds of records.** Fresh-looking numbers either way; an observer sees *that* slots changed,
168never *which* of the changes were revotes. The hiding is among the batch's touched slots,
169which is exactly why the sample rule exists. (v2 achieved the same by re-encrypting stored
170ciphertexts; v3 re-blinds stored vectors, with no encryption needed.)
171A revote's batch simply subtracts the slot's old vector and
172adds the new one, the published delta, so the old ballot leaves the total the moment the
173new one enters. Nothing is lost under the blinding: every batch leaves the committee a
174sealed note (its key split θ-of-ν across the wardens, the same Shamir trick again)
175recording which updates were real, so at tally time the committee knows which vote is each
176slot's current one and reads it straight from the lockboxes, never needing to peel the
177blinding off. The running total is the sum of all current slot vectors:
178public, continuously updated, and unreadable.
179
180**End of election.** Casting closes; a short *grace window* lets in-flight batches land;
181the running total freezes. Then one new deadline (new vs v2): the **complaint deadline**.
182Why it exists: the browser's proof checks everything it can see, but it deliberately cannot
183look *inside* the lockboxes (proving post-quantum encryption in-proof is the one expensive
184step this design avoids). So if some package's lockbox doesn't open to what was promised,
185from a buggy or malicious client,
186the affected warden proves that on-chain and the package is excluded from the count. A
187complaint is itself a proof, so a warden cannot abuse it to exclude an honest vote.
188Wardens can file complaints *from the moment a package lands*, so an honest voter with a
189broken client finds out while voting is still open and simply revotes. The deadline is the
190last moment to complain; then the exclusion list freezes. (If all ν wardens attest early
191that they're done checking, results can start immediately.)
192
193
194
195**Results.** Any θ wardens each do one job: open their lockboxes, use the recovered mask
196keys to read *their own column* of every counted ballot's shares, and publish the **sum of
197those shares** (plus a pinch of jointly-made blinding that vanishes at the finish line),
198with a proof that they did exactly that and nothing else. The θ partial
199sums are θ points on a single polynomial, and its value at zero *is* the election result.
200The contract draws the curve and reads it off, in ordinary modular integer arithmetic (the
201same "mod a large prime" as the example), on-chain, exact.
202(v2 ended with a threshold *decryption* plus a brute-force search to extract the number;
203v3's ending is the schoolbook interpolation you saw above.)
204
205
206
207### Who sees what
208
209- **The public / an observer**: all packages, all blinded vectors, the running total, which
210 slots changed and when, turnout, the complaint list, the result. Never a ballot, and
211 never whether a change was a revote or a refresh.
212- **Your sequencer**: that *you* (your slot) revoted in the batches it sealed, the same
213 thing the vote-collecting server inevitably sees in v2. Never your ballot or shares.
214- **Fewer than θ wardens, even colluding, even with quantum computers, even in 30 years
215 from archived data**: each holds shares that are individually pure noise. Nothing. (To be
216 exact: below θ *raw shares* the protection is pure math; the *archived masked data* is
217 additionally guarded by one computational assumption, the ML-KEM lockboxes, a
218 post-quantum lattice scheme. That is the single lock a future cryptanalyst would have to
219 break.)
220- **θ or more colluding wardens**: can reconstruct individual ballots (every threshold
221 voting system has exactly this boundary) and, at tally time, jointly learn which slot
222 updates were revotes. Choose the committee accordingly.
223
224### What this buys you
225
226- **Nothing to harvest.** The quantum "harvest now, decrypt later" attack dies below θ
227 wardens: published shares are information-theoretic noise, and the only cryptography
228 guarding the mask keys is lockboxes (ML-KEM) and hashes, both post-quantum. (v2's
229 published ElGamal ciphertexts fall to a future quantum computer retroactively.)
230- **No shared decryption key exists**: not held by anyone, not generated, not reconstructable.
231 Each warden has only its own ordinary keypair. The tally still takes one coordinated
232 round among θ wardens (opening the batches' sealed notes together), but no step of it
233 ever produces a key that decrypts ballots.
234- **Checked, not trusted.** Voter, sequencer and warden each move only with a proof: the
235 contract rejects anything else. Integrity needs no honest operator anywhere. (One caveat:
236 ballot *secrecy* is what's quantum-proof today; the *integrity* plumbing still
237 includes some classical Ethereum-era pieces, namely the proof wrapper, blob commitments, and
238 optional legacy wallet signatures, with a tracked migration path, §12.5. Breaking those
239 could forge state while they last; it can never retroactively read ballots.)
240- **Exact results.** The tally is integer arithmetic: no decryption failures, no noise
241 budgets, no brute-force search at the end.
242
243---
244
245## 2. Notation, parameters and encodings
246
247- $\mathbb{F}$ — the **Goldilocks field**, $p = 2^{64} - 2^{32} + 1$ (the Plonky3 [P3] and ZisK
248 native field). All shares, masks and tally arithmetic live here. Canonical encoding of an
249 element: 8 bytes little-endian, value < $p$.
250- $\nu$ — number of **key wardens**; $\theta$ — tally threshold. **v3.0 supports
251 $1 \le \theta \le \nu \le 8$**, enforced at creation and in the pinned profile (DA and
252 in-circuit cost are linear in ν; ν=8 halves both vs 16. The protocol structures support
253 up to 16, which returns as a future profile once DA/verification optimizations land;
254 committee size is unrelated to the 16 *ballot fields*, which stay). Size rosters with the
255 availability margin in mind: tolerating $f$ unavailable or faulty wardens through the
256 complaint deadline and tally ceremony needs $f < \theta \le \nu - f$ (an 8-of-8 election
257 tolerates none; the registry rejects $\theta = \nu$ for $\nu \ge 2$ unless creation sets
258 an explicit override flag), and the ceremony absorbs individual failures by roster margin (§10.4),
259 with blinding still requiring ≥ 1 honest *accepted dealer*. The complaint-capacity bound (§9.2) depends
260 on admitted casts, not ν: fewer wardens means less aggregate proving/archival redundancy,
261 so deadlines and hardware budgets must be revalidated per roster size.
262- `nf` — active ballot fields, 1..16, as in v2, immutable per election. **Packages carry
263 shares, masks and commitment entries only for fields `1..nf`** (v1.3 fixed everything at
264 16-wide; nf-sizing saves `(16−nf)·ν·8` B per package, ~960 B at ν=8/nf=1). Any 16-wide
265 logical representation is the zero extension: inactive fields have no per-package
266 polynomials, share encodings, mask consumption or commitment entries. The accumulator,
267 blinding vectors and tally equations STAY 16-wide via zero extension ($\widehat E_{i,f}=0$,
268 $\widehat{\mathrm{mask}}_{i,f}=0$ for $f>nf$; inactive results interpolate to 0). All
269 component lengths are derived from authenticated election parameters, never from supplied
270 bytes; trailing inactive-field bytes are rejected.
271- **KEM** — **ML-KEM-768 [FIPS 203] (ct 1088 B), the only allowed profile** (v1.2's
272 ML-KEM-512 option is withdrawn: BSI recommends only the 768/1024 sets, and 512 saved just
273 ~2.5 KB per ballot at ν=8; the DA-reduction path is multi-recipient Kyber, §15.5). Browser
274 implementations must be pinned and vetted [KEMB]. One *encapsulation* yields `(ct, K)` with
275 a 32-byte shared secret `K`; arbitrary payloads are carried KEM-DEM style (encapsulate,
276 derive a wrapping key from `K`, then DEM-encrypt, §2.1). **Normative decapsulation rule
277 (all paths: warden recovery §10.1, complaint guests §9.2, ceremony recipients §10.4):
278 the FO re-encryption check MUST compare the full re-encrypted ciphertext in constant time;
279 partial or early-exit comparison enables ML-KEM key recovery [FOCT].**
280- **Blake3** — standard Blake3 [B3] is **the protocol hash, everywhere the protocol gets to
281 choose**: the ballot STARK's Merkle trees and Fiat–Shamir challenger; all in-circuit
282 hashing (PRF masks, commitments, voteID, via a re-laid Blake3 AIR section,
283 §6); the census tree; the state SMT; `pkgDigest`/`ctsDigest`; and
284 every DEM/PRF/key-derivation role through Blake3's standard *keyed*, *derive_key* and
285 *XOF* modes (§2.1). Digests are 32 bytes. Rationale: fastest software hash in the browser
286 (~1.4 GB/s in WASM; measured on the prototype: proving 3.24 s → 0.69 s, proofs
287 544 → 324 KB), a standard-conformant ZisK precompile (`blake3f`) for every guest
288 recomputation, and a conservative, long-studied ARX design (§12.4). One hash = one
289 implementation to audit on each platform (AIR, guest, browser, warden).
290- **Hash islands the protocol cannot choose**: **keccak256** for values
291 Solidity contracts must compute (blob evaluation points $z_b$, the v2 processID prefix,
292 the origin-3 running registration commitment of §8.2) and for hybrid-mode Ethereum
293 addresses; **SHAKE** inside ML-KEM and **SHA-2** inside SLH-DSA (FIPS-fixed internals of
294 black-box primitives); **Poseidon2** inside ZisK's own prover (an inherited proof-system
295 dependency; framing in §12.4; [POS2]). Poseidon2 and SHA-256 hold **no
296 application-level role** in v3-PQ.
297- **256-bit values in circuits** (DEM keys, Blake3 digests crossing into Goldilocks
298 arithmetic): encoded as **eight 32-bit limbs**, each range-checked < 2^32. Never as four
299 64-bit limbs (not injective: $p^4 < 2^{256}$), and never reduced mod $p$.
300
301### 2.1 DEM (authenticated encryption for warden payloads)
302
303Built from Blake3's standard modes, normative for **every protocol payload** (voter→warden is
304pure KEM+PRF and needs no DEM; this DEM covers batch payloads, batch-key share wrapping, and
305ceremony deliveries):
306- **Key separation**: `k_enc = Blake3.derive_key("davinci v3-pq DEM enc key", K)` and
307 `k_mac = Blake3.derive_key("davinci v3-pq DEM mac key", K)`, with fixed application context
308 strings, exactly the standard derive_key mode. `derive_key` creates *separation, not
309 entropy*: `K` must be a ≥256-bit KEM secret or CSPRNG secret.
310- **Keystream**: keyed-Blake3 **XOF**. `keystream = Blake3.keyed(k_enc, nonce ‖ AAD).xof()`,
311 with the counter being the XOF output offset (bounded: payloads < 2^32 blocks, no offset
312 wraparound); ciphertext = plaintext ⊕ keystream. An XOF is a seekable output stream, not
313 repeated hashing of previous output.
314- **Authentication**: encrypt-then-MAC. `tag = Blake3.keyed(k_mac, nonce ‖ AAD ‖ ciphertext)`;
315 receivers verify the **full 32-byte tag before releasing any plaintext**.
316- **Uniqueness**: `nonce = Blake3(AAD)`; the AAD is the canonical, length-unambiguous
317 serialization of a **DEM context** that always includes a purpose tag, the election
318 context, the **batch number or ceremony (session, attempt) identifier**, sender and
319 recipient. It is unique per encryption *including retries* (a ceremony restart is a new attempt
320 id ⇒ fresh masks, keys and nonces; the same derived key and nonce never encrypt two
321 different plaintexts).
322
323These are standard Blake3 modes, but their composition is a
324**protocol-specific authenticated-encryption construction, not a standardized AEAD**; the
325needed assumption is keyed-Blake3's PRF security (§12.4). A short security-argument appendix
326(encrypt-then-MAC composition per Bellare–Namprempre over keyed-Blake3-as-PRF, with the
327deterministic AAD-derived nonce justified by the AAD-uniqueness rule above) is a Phase-0
328publication gate (§15). AES-256-GCM may be used by clients
329for unrelated local storage/transport, never as a substitute encoding of protocol payloads.
330
331### 2.2 Domain-separated contexts
332
333Every derived value uses a purpose-tagged context; nothing is derived without one. Purpose
334tags map to Blake3 `derive_key` context strings; the tuple itself is serialized canonically
335(fixed order, length-prefixed variable fields).
336
337| Purpose | Context contents |
338|---|---|
339| `pkgCtx` — the package context tuple | `(protocolVersion, chainID, registry, processID, wardenEpoch, voteID)`, the common prefix below |
340| `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) |
341| `hCtx(i)` — share/pad commitment | `("v3/hcommit", pkgCtx, recipient i)` |
342| `commitCtx` — package commitment | `("v3/pkgcommit", pkgCtx)`, the `ctx` argument of `pkgCommit` (§5.1) |
343| `slotUpdCtx` — slot-update blinding | `("v3/slotupd/zero", …)` and `("v3/slotupd/mask", …)`: the per-touched-slot zero-sharing coefficients and unstructured masks of §8.4, derived in-guest; contexts bind the election tuple, batch number, slot, and (for masks) the recipient index and field. Mask subkeys derive from the authenticated batch key $k_b$ under the mask domain (§8.5), never from recipient seeds, and zero-sharing randomness is domain-separated from both. Byte-exact derivation (subkey structure and per-coefficient/per-field XOF offsets) is pinned by Phase-0 gate 3; the LE128-mod-$p$ extraction rule below applies. (Batch-seed → $k_b$/encapsulation-randomness derivations are guest-internal, pinned by the program key, and need no published context.) |
344| `viewCtx` — per-warden column views | `("v3/view/rows", …)`, `("v3/view/payload", …)`, `("v3/view/acc", …)`, `("v3/view/root", …)`: the four §8.7 commitments; each context binds `(protocolVersion, chainID, registry, processID, wardenEpoch, wardenSetHash)` plus the batch number and (where applicable) the recipient index |
345| `cerCtx` — ceremony envelopes | `("v3/ceremony/<phase>", pkgCtx-style election tuple, session, attempt, sender, roster hash, dealer-set hash where applicable)`: the signed-envelope context of §10.4; every ceremony signature, DEM context, bundle-key body and per-recipient wrap context (§10.4 step 3), and proof-carried envelope binding (§10.3, §10.4) derives from it |
346| `slotCtx` — slot derivation | `("davinci-slot-v3", address)`: the Blake3 replacement of v2's SHA-256 `"davinci-slot-v1"` address→slot rule (§8.2). Slot-vector **leaves** use the single tag `"davinci-slotvec-v3"` for every touched slot, real write or refresh alike (§7); there is **no** refresh-specific domain tag, because a branch-distinguishing tag would publicly mark refreshes, contradicting §8.4. (Drafts ≤1.3's `"davinci-refresh-v3"` is removed.) |
347
348The package's mask nonce is its **voteID**: public, unique per package, authenticated, and
349independent of the masked values (it derives from the secret `k`, §5.2, before any masking),
350so wardens can recompute every `streamCtx` from public data with no circularity. (Earlier
351drafts derived one PRF output per *field*; that definition contradicted the in-AIR cost
352estimates, ≥16 final keyed computations per warden and 256 at ν=16, and was replaced by the
353single per-warden stream above, which needs only one context block plus four 64-byte XOF
354output blocks per warden.)
355
356**Byte→field mapping (normative).** Blake3 outputs bytes; masks and other derived field
357elements are obtained as **LE128 of 16 XOF bytes, reduced mod $p$**, at statistical distance
358from 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
359≈ $2^{-32}$, which is not.
360
361### 2.3 Protocol parameters
362
363| Parameter | Value | Why |
364|---|---|---|
365| Share/tally field | Goldilocks $p$ | native in the ballot AIR and ~native u64 in ZisK guests |
366| 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`) |
367| **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 |
368| Warden evaluation points | $x_i = i$, $i \in 1..\nu$ | Shamir positions, pairwise distinct, nonzero |
369| 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) |
370| Max refreshed slots per batch | 2048, rule as v2 | unchanged |
371| Per-voter casting | **no lifetime bound** (as v2) | the structural rate limit is ≤ 1 real 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 |
372| 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); refresh-only batches are not accepted. Bounds the per-warden batch-envelope work (§8.5, §10.1) |
373| Adaptive deadlines | `d_complaint = t_freeze + d_0 + α·C + β·M + γ·U` | complaint/ceremony/contribution deadlines are **workload-derived**, computed once at casting freeze from the authenticated terminal counts (C = admitted casts, M = batches, U = total slot touches; `U ≤ C + 2048·M`); 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 share-bundle and contribution deadlines scale by the same counts (§10.4). Subsequent complaints never extend a computed deadline; completion can shorten one: every post-freeze stage closes early when all expected participants have published (§9.2, §10.4) |
374| 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 |
375| 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.7× prover cost, measured (§8.1). Fallback if browser benchmarks disappoint: blowup 16 / 26 queries, grinding unchanged at
37616 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) |
377| 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 |
378
379### 2.4 Terminology for software engineers
380
381Plain definitions, anchored in things an Ethereum engineer already knows. Skim once; the rest
382of the document assumes them.
383
384- **KEM** (Key Encapsulation Mechanism; here **ML-KEM**, the standardized Kyber) — a
385 public-key *lockbox*: anyone can "encapsulate" against your public key and obtain a fresh
386 32-byte shared secret plus a ciphertext; only you (with the private key) can recover that
387 secret from the ciphertext. Think of it as the post-quantum replacement for ECDH key
388 exchange, except there is no shared-curve math and the two parties never need to be online
389 together.
390- **PRF** (pseudorandom function) — a keyed hash used as a deterministic random-number
391 generator: same key + input ⇒ same output, and without the key the outputs are
392 indistinguishable from random. Mentally: `keccak256(key, input)` used the way you'd use a
393 seeded RNG. Here PRFs expand a KEM secret into the masks that hide shares.
394- **Shamir secret sharing** — split a value into ν pieces by choosing a random polynomial of
395 degree θ−1 whose value at x=0 is the secret, and handing out its values at x=1..ν. Any θ
396 pieces determine the polynomial (and hence the secret); any θ−1 pieces are statistically
397 independent of it: noise, not "hard to crack".
398- **Threshold θ-of-ν** — ν parties hold pieces; any θ of them suffice to act (here: tally);
399 fewer than θ learn nothing and can block nothing except by being too few.
400- **Lagrange interpolation** — given θ points, there is exactly one polynomial of degree
401 ≤ θ−1 through them; evaluating it at x=0 recovers a Shamir secret. "Draw the unique curve
402 through the points, read it at zero." A few multiplications and additions, cheap even in
403 Solidity.
404- **STARK** — a zero-knowledge proof system built only from hashes (no trusted setup, no
405 elliptic curves, post-quantum). Bigger proofs than Groth16 (hundreds of KB), but
406 browser-provable and cheap to verify.
407- **AIR** — the constraint system of a STARK: its "circuit".
408- **FRI** — the polynomial-checking engine inside a STARK; the reason STARK verification is
409 mostly hashing.
410- **Hiding PCS** — the polynomial commitment inside the STARK is randomized so the proof
411 leaks nothing about private inputs; this is what makes the proof *zero-knowledge* rather
412 than merely succinct.
413- **Witness** — the prover's private inputs (the ballot, the shares, the keys). Never leaves
414 the prover.
415- **Nullifier** — a one-way tag published to mark something as spent (the Tornado Cash /
416 Semaphore pattern). **v3 deliberately has none**: drafts ≤1.3 used them for revote
417 tracking, and adversarial review showed any such voter-derivable public tag is a coercion
418 test (§5.3, §12.3). Defined here because the term appears in those discussions.
419- **Accumulator** (as used here) — just a running sum vector of field elements maintained by
420 the batch program. *Not* an RSA or Merkle accumulator.
421- **Blake3** — a modern general-purpose hash: ARX design (add–rotate–xor, the ChaCha/BLAKE/
422 BLAKE2 lineage; BLAKE was a SHA-3 finalist), extremely fast in software, with standard
423 built-in modes for keyed hashing (MAC), key derivation (`derive_key`) and arbitrary-length
424 output (XOF). v3's single protocol hash.
425- **DEM / AEAD** — symmetric authenticated encryption (ciphertext + tamper-proof tag), the
426 AES-GCM role; v3 instantiates it from Blake3's keyed + XOF modes so one hash covers it and
427 zk-proofs about it stay cheap (§2.1).
428- **Domain separation** — namespacing every hash/PRF input with a purpose tag and context so
429 a value from one context can never be replayed in another, the same reason EIP-712 typed
430 signing exists (§2.2).
431- **Dealer** — a party that generates a secret and distributes shares of it (used in the
432 tally ceremony, §10.3).
433- **CSPRNG** — a cryptographically secure random generator (`crypto.getRandomValues`,
434 `/dev/urandom`); "fresh CSPRNG randomness" means sampled from this, never derived.
435
436### 2.5 Chunked proving (one contract for every chunked proof path)
437
438Complaint proofs (§9.2) and warden contributions (§10.1) MAY be proven in segments. One
439normative contract covers every such path:
440
441- **Authenticated continuation.** Each segment's statement binds the predecessor's complete
442 continuation state: the progress ordinal, every running accumulator (`viewAcc`, partial
443 sums, counters) and the typed, versioned state schema of its path. Carrying a hash alone
444 does not certify earlier computation; the linkage is authenticated execution (the segment
445 proves it resumed from exactly that state under the same pinned program and statement
446 context), never merely a chained digest.
447- **Hiding.** Continuation states are witness material: they MUST NOT contain a plaintext
448 operation-log digest (§8.7) or any secret-derived value in the clear, and every chunked
449 path is in scope of the §12.4 hiding verification (Phase-0 gate 4).
450- **Completeness.** Only the final segment's statement asserts the whole claim; partial
451 segments assert nothing externally. Open chunks are rejected after their path's closing
452 event (e.g. the exclusion freeze, §9.2).
453
454§9.2, §10.1 and §12.4 reference this contract instead of restating it; path-specific state
455schemas and negative tests remain per path (Phase-0 gate 3).
456
457---
458
459## 3. The core idea: tally without a shared decryption key
460
461v2 hides a ballot inside a ciphertext and adds ciphertexts homomorphically. v3 hides a ballot
462inside **polynomials** and adds polynomials. If you know Lagrange interpolation, you know the
463whole trick:
464
4651. For each ballot field value $b$, the voter picks a random polynomial $f$ of degree
466 $\theta-1$ with $f(0) = b$, and computes one **share** per warden: $s_i = f(i)$. Any
467 $\theta$ shares reconstruct $b$; any $\theta-1$ shares are statistically independent of
468 $b$. Plain Shamir [Sha79]: no curves, just polynomial evaluation in $\mathbb{F}$.
4692. Shares are never published in the clear. The voter publishes **masked shares**
470 $e_i = s_i + \mathrm{mask}_i$, where the masks are sliced from one keyed Blake3 XOF
471 stream per warden (§2.2) and the stream key $K_i$ travels to warden $i$ inside an ML-KEM
472 ciphertext. To everyone except warden $i$, $e_i$ is a uniformly random field element.
4733. Polynomials add: the per-field sum of every active voter's polynomial is itself a
474 degree-$(\theta-1)$ polynomial whose value at 0 is the **tally**. So the protocol only
475 ever needs to add public field elements. Each occupied slot holds a public **blinded slot
476 vector** $T_s \in \mathbb{F}^{\nu \times 16}$ (the voter's masked shares plus
477 sequencer-added blinding layers, §8.4), and the public **accumulator** is simply
478 $A = \sum_s T_s$, updated by each batch's published slot deltas. A revote overwrites the
479 slot's vector; a refresh re-blinds it; both publish the same kind of record.
4804. At the end, each participating warden decapsulates its KEM ciphertexts, recovers its
481 share of every counted ballot, and publishes its **sum-share** $S_i$: the sum of those
482 shares plus a jointly-created blinding share that vanishes at $x=0$ (§10.3), with a ZisK
483 proof that it did exactly that against on-chain-committed data. Lagrange interpolation of any $\theta$ published
484 sum-shares at $x=0$ **is** the tally. Exact field arithmetic: no decryption of any
485 aggregate, no noise, no discrete-log search.
486
487
488
489(*This section is the intuition; the full computation also handles the exclusion set and a
490tally-time blinding term, §9-§10. The slot-blinding layers of §8.4 hide updates while
491casting runs and never enter the tally.*)
492
493The ballot STARK (§6) makes steps 1-2 trustworthy, the batch proof (§8) step 3, the warden
494proofs (§10) step 4. **The zkVM proof chain replaces the homomorphic algebra**, which is the
495structural difference from academic PQ voting designs ([TEV], [PQK]) that obtain the same
496guarantee from lattice commitments. (Some public-key encryption is unavoidable for ballots
497addressed to offline wardens [IR89]; v3 confines it to KEM transport. Threshold *lattice*
498decryption, the known hard part of lattice voting [NOAH], is avoided entirely: the
499threshold lives at the plaintext layer.)
500
501Privacy in one sentence: below $\theta$ colluding wardens, shares are information-theoretically
502useless in isolation, and the computational assumptions protecting ballots are ML-KEM, the
503PRF/hash, and the zero-knowledge of the STARKs, all post-quantum (full leakage model: §12).
504
505---
506
507## 4. Roles: what changed
508
509- **Organizer, sequencers, provers, observers** — unchanged from v2.
510- **Key wardens** no longer run a DKG or hold shares of a secret key. Per *epoch*, each warden
511 generates an ML-KEM keypair **and an SLH-DSA-SHA2-128s signing keypair [FIPS 205]** and
512 calls the **WardenRegistry** contract with: `H(pk)`, **`H(pk_sig)`**, a **settlement
513 account address** (authorizing its proof-less on-chain messages, below), a URI where the
514 full public keys are served (IPFS or HTTPS), and a ZisK **well-formedness proof** (the
515 ML-KEM key pair derives from a committed seed and passes an encaps/decaps self-test). The
516 registry verifies the proof on-chain. The signing key authenticates the warden's published
517 ceremony payloads to **off-chain consumers** (join envelopes and share bundles, §10.4);
518 signatures are ~7.9 KB and verification is pure hashing. **SLH-DSA signatures are never
519 verified on-chain.** On-chain protocol messages that carry no proof (session joins and
520 scan-complete signals, §9.2/§10.4) are authorized by `msg.sender` equal to the warden's
521 registered settlement account, pinned per election by the creation-time snapshot below
522 (registry account rotation never moves an existing election's rights). Proof-carrying
523 messages (complaints §9.2, dealer bundles §10.3, contributions §10.1) are authenticated by
524 their proofs' registered-key-seed clauses and may be submitted by anyone. The classical
525 dependency this creates is bounded: forging an account signature can only move **closure
526 timing and liveness**, never ballots or confidentiality (§12.5); every
527 confidentiality-relevant payload keeps post-quantum authentication (§10.4). An election
528 pins its committee in `wardenSetHash` (config leaf `0x3`, §7): `(ν, θ, epoch, the ν
529 registered (H(pk), H(pk_sig), account) triples)`. A voter's client fetches the ν public keys (from their URIs or any
530 sequencer), recomputes each hash and the set hash, and verifies it against the on-chain
531 value before casting; it refuses to cast otherwise. The registry refuses to create an
532 election whose warden set is not fully registered.
533 **Archival is a permissionless, untrusted role, not a per-warden duty.** EIP-4844 blobs are
534 pruned after ≈18 days, so for any longer election the history must be captured while it is
535 live, including L1-blob-mode blobs from their **publication** transactions, which precede
536 settlement (§8.6). Any party may serve as an archive provider with no registration: all served data is
537 authenticated by consumers against the accepted chain commitments (the registry's
538 `archiveAcc` manifest chain plus each blob's full commitment/versioned-hash binding;
539 recomputing the manifest fold alone does not authenticate returned bytes). The liveness
540 assumption is **at least one complete, available archive** spanning the casting period,
541 the complaint window, every tally attempt, and the declared retention period, including
542 ceremony and complaint publications, not only batch blobs. A deployment profile MUST
543 obligate each warden to live-capture and retain **its own tally inputs**: its per-package
544 ciphertexts `ct_i` (the column view stores only `Blake3(ct_i)`, §8.7), its column-view
545 streams, and all batch payload envelopes, through finalization plus the declared retention
546 period, with funded retention across every tally attempt (≈1.3 GB per million casts,
547 dominated by the ciphertexts). Authenticated catch-up from any archive remains a valid
548 recovery path for a temporarily offline warden: local capture is resilience, not a
549 participation prerequisite, and it does not replace the complete-public-archive assumption
550 above (ceremony and complaint publications included). A deployment profile SHOULD
551 additionally name at least one accountable archiver (organizer or warden set) even though
552 providers are untrusted.
553 Wardens MAY process incrementally during the voting period (decapsulation and share
554 recovery don't need to wait for the end); complaints may also be filed as soon as a package
555 settles (§9.2), and at the end the participants run one tally ceremony (§9-§10).
556- **Key modes.** *Committee* (lottery over registered operators) and *council*
557 (organizer-invited set) map 1:1 from v2: they only select *which* registered warden keys
558 form the set. *Sequencer mode* is the degenerate $\nu = \theta = 1$ case (the sequencer is
559 the only warden; ~1 KB per ballot, cheaper than v2; the sole operator can reconstruct
560 every ballot, a trust label deployments must surface, and the tally ceremony collapses to
561 one contribution proof, §10.4). **Locked mode is deferred**: it
562 requires an organizer-side share column and a separately reviewed extension of the tally
563 equations; it is not part of v3.0.
564
565---
566
567## 5. The ballot package
568
569A vote is one **package**. Its public part goes into blobs; its private part exists only in
570the voter's browser. **A revote needs no reference to any earlier package**: it is a fresh
571package for the same slot (§5.3).
572
573
574
575### 5.1 Public package contents and CanonicalPackage
576
577| # | Field | Size (ν=8, nf=16, ML-KEM-768) | Description |
578|---|---|---|---|
579| 1 | `version` | 1 B (`0x04`) | package format version |
580| 2 | `processID` | 31 B | as v2 |
581| 3 | `voteID` | 8 B LE | §5.2; also the package's mask nonce (§2.2) |
582| 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 |
583| 5 | `cts` | ν·1,088 B = 8,704 B | ML-KEM ciphertexts, warden order 1..ν |
584| 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) |
585| 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) |
586| 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) |
587
588Per-package size: `72 + ν·(32 + 1088 + 8·nf)` bytes. There is no predecessor digest and no
589chain counter (both existed in drafts ≤1.3 and were removed with the nullifier machinery,
590§5.3). `CanonicalPackage` = the concatenation of fields 1-7 exactly as listed (fixed order,
591sizes derived from the authenticated election parameters, no framing).
592**`pkgDigest = Blake3(CanonicalPackage)`** is the package's identity: it is the value stored
593at the vote-ID leaf and what complaints reference.
594**`sharesDigest = Blake3(h_1 ‖ … ‖ h_ν)`**. Despite the name it
595binds the shares *through* the per-warden commitments $h_i$ (each AIR-bound to the exact
596$(s_i, K_i)$ used in masking, fixed order and count), which is equivalent binding at a
597fraction of the in-circuit hashing cost. The ballot STARK (~195 KB at the pinned profile) accompanies the package to
598the sequencer but is **not** published in blobs.
599
600### 5.2 Construction (browser, pseudocode)
601
602```text
603k = fresh random scalar (CSPRNG — always; see "Client state" below)
604voteID = N + trunc63(Blake3("v3/voteid" || processID || address || k))
605 # trunc63 = lowest 63 bits;
606 # N = 2^63 (v2's namespace offset)
607for f in 1..nf:
608 poly_f = random polynomial, degree θ-1, poly_f(0) = ballot[f] # active fields only
609s[i][f] = poly_f(i) # ν shares per active field
610for i in 1..ν:
611 (ct[i], K[i]) = MLKEM.Encaps(pk_warden[i]) # fresh randomness per package, NEVER reused
612 stream = Blake3.keyed(K[i], streamCtx(i)).xof(16·nf bytes) # ONE mask stream per warden (§2.2);
613 # UNCHANGED per-field offsets — field f
614 # always uses bytes [16(f-1),16f)
615 for f in 1..nf: e[i][f] = s[i][f] + LE128(stream[16(f-1)..16f]) mod p
616 h[i] = Blake3(hCtx(i) || s[i][1..nf] || K[i])
617salt = fresh 256-bit CSPRNG value # hiding salt, kept in the opening
618sharesDigest = Blake3(h[1] || .. || h[ν])
619pkgCommit = Blake3(commitCtx || slot || pk_voter || sharesDigest || salt)
620ctsDigest = Blake3(ct[1] || .. || ct[ν]) # binds the ciphertext bytes (§6)
621proof = BallotSTARK.prove(...) # §6
622```
623
624ML-KEM encapsulation costs ~1-2 ms per warden in browser WASM [KEMB]; the dominant client
625cost is the STARK (§6). **Freshness warning:** encapsulations are fresh per package and per
626attempt, including candidate packages that are never admitted. Reused KEM randomness yields
627identical ciphertexts (publicly linkable); actual *pad* reuse (same key AND same stream
628context) would publish the difference of two sharings, which interpolates to the ballot
629difference. Distinct voteIDs give distinct stream contexts for admitted packages, but
630clients must keep freshness across retries and rejected submissions too.
631
632**Client state: losing it costs nothing.** All package randomness (`k`, the polynomials,
633the KEM randomness, the salt) is **independent CSPRNG randomness, always**. Because a
634revote is just a fresh package for the same slot (§5.3), **no predecessor opening is ever
635needed again**: a voter who loses every bit of client state simply casts a new package from
636any device holding their census secret, and it overwrites the slot. Drafts ≤1.3 had a
637deterministic "recovery mode" (deriving randomness from `sk`) to restore revoting after
638device loss; with its only justification gone, it is **removed**, which also closes two
639coercion channels it created (an `sk` holder could enumerate the voter's voteIDs and
640reconstruct their historical ballots). This matches v2 exactly: v2's `voteID` also uses
641fresh, underivable randomness per ballot.
642
643**Cast-as-intended (Benaloh audit, a normative client flow).** Before submitting, the client
644MUST offer an *audit-or-cast* choice: the voter may demand the candidate package's **full
645opening** (ballot values, polynomials, `k`, salt, KEM coins) and verify on a second device
646that the package encodes the intended ballot. That package is then **permanently
647discarded** (its secrets are exposed; the §5.2 freshness rule already forces completely new
648randomness per attempt) and the client builds a fresh one, which the voter either audits
649again or casts *unaudited*. Any number of audit rounds is allowed; an audited package MUST
650never be submitted. This is the standard Benaloh challenge: the client cannot predict which
651candidates will be audited, so a cheating client is caught with probability growing in the
652number of audits. v2 left cast-as-intended entirely to applications; v3 makes the client
653obligation normative.
654
655### 5.3 Revoting: slot overwrites, exactly as v2
656
657v2 overwrote the voter's slot and subtracted the stored ciphertext homomorphically. v3 does
658the direct analog over Shamir shares: **a revote is an ordinary fresh package for the same
659slot**, and the batch program replaces the slot's public blinded vector, adjusting the
660accumulator by the published delta (§8.4). The voter's proof authorizes writing *their own
661slot* (identity + census binding, §6/§8.2), nothing more.
662
663
664
665- **No nullifiers, no predecessor consumption, no chain counter, no revote budget.** Drafts
666 ≤1.3 enforced a "one-live-chain" rule through published revocation nullifiers; adversarial
667 review established that ANY public, voter-derivable (or finite, demandable) spend object
668 re-creates a coercion test: a coercer holding the token, or demanding the remaining
669 posting rights, detects replacement. The slot-overwrite model has **no
670 predecessor-status spend object at all**. The only public effects of a revote are a new
671 voteID receipt and a slot-vector update that is byte-indistinguishable from a routine
672 refresh.
673- Invariants enforced by the batch program: an empty slot admits exactly one **first write**
674 per election lifetime of the slot (first writes are counted: $F \le \texttt{maxVoters}$);
675 an occupied slot admits **at most one real ballot per batch** (the structural rate limit);
676 refreshes never create occupancy; exclusions never reset occupancy (§9.2).
677- **No lifetime cast cap: a deliberate decision, as in v2** (which never bounded revotes).
678 Review rejected both alternatives. A flat global cap is capturable by an attacker with
679 enough admissions ($\min(s,b)\cdot m \ge T$), and a two-pool cap (first-votes vs
680 overwrites) is worse: exhausting the overwrite pool would permanently block every later
681 escape vote and complaint recovery while casting is still open. Deliberate cast inflation
682 is instead bounded structurally (≤1 per slot per batch ⇒ a lone voter adds at most $M$
683 casts), priced by admission (STARK proving + sequencer fees + DA per cast; sequencers
684 are free to rate-limit, v2's exact posture), and provisioned by the **adaptive
685 workload-derived deadlines** of §2.3/§9.2. If a deployment needs a hard ceiling, it
686 SHOULD be a per-block settlement rate limit in the profile, never a lifetime admission
687 budget. The cost shift is real: v2 wardens did O(1) work regardless of casts; v3 warden
688 work is linear in admitted casts, so a funded processing commitment sized by the adaptive
689 formula is a real liveness requirement (§9.3), and "admission is priced" is not a
690 substitute (an attacking sequencer pays itself).
691
692Ordering: within a slot, the **last settled overwrite wins**, v2's exact semantics,
693including its caveat that ballots sent to different sequencers have no common order (voters
694should revote through one sequencer, as v2 advises).
695
696### 5.4 Submission interface (voter → sequencer)
697
698The voter submits to one sequencer, over an encrypted channel as in v2:
699`{CanonicalPackage, hybridSig?, ballotProof, censusProof?}`. A revote is byte-identical in
700shape to a first vote. The sequencer (and its prover) still **learns which of the packages
701it seals are overwrites** (it sees slot occupancy, the same boundary as v2, where the
702sealing sequencer learns which updates are overwrites). It never learns ballots, shares,
703masks, or `sk`: those stay inside the STARK witness.
704
705**What never enters public data availability:** `hybridSig` (a recoverable signature would
706link the package to its Ethereum address), the ballot proof, and the inner proof's public
707vector all stop at the voter→sequencer→guest boundary.
708Blobs carry only `CanonicalPackage` and the batch-level data of §8.6.
709
710---
711
712## 6. The ballot proof (Plonky3 STARK)
713
714The Groth16 circuit is replaced by a STARK over Goldilocks, proven in the browser via WASM:
715the production descendant of the davinci-stark prototype [DST], minus its elliptic-curve
716section. No trusted setup.
717
718**Public inputs: the raw public vector.** There is no binding hash (v1.0's `inputsHash` is
719removed): the proof exposes the public statement **directly as a pinned, ordered vector of
720Goldilocks elements/limbs**, exactly these elements, in this order (the byte/limb layout is
721part of the complete proof profile fixed before `ballotVKHash` is pinned, end of this
722section): `version` · `processID` · `packedBallotMode` ·
723`voteID` · the identity binding (`address` limbs and `pk_PQ`) · `slot` · `authMode` ·
724`weight` · all `E` coordinates (ν·nf elements) · all `h_i` (ν × 8×32-bit limbs) ·
725`pkgCommit` limbs · `ctsDigest` limbs. There is no `isRevote` flag, no predecessor digest
726and no nullifier in the publics: the guest determines first-write vs overwrite from slot
727occupancy alone (§5.3). The vector layout is
728length-prefixed per (ν, nf) and never truncates. `ctsDigest = Blake3(cts)` is computed *outside*
729the circuit and enters as opaque limbs, which **binds** the ciphertext bytes without proving
730anything about ML-KEM.
731
732**Statement contract (normative).** The batch program **constructs the expected public
733vector itself**, from the canonical package it admits, the authenticated election
734parameters, and the authenticated census data (§8.2), and
735verifies the proof against *that* vector. It never verifies a supplied vector and then
736processes different package data. Inside the AIR, every value used by ballot validation,
737share generation, masking and commitments is constrained equal to
738these publics, so an admitted package is byte-for-byte the one the voter's proof authorized.
739`censusRoot` is **not** a ballot public input: membership is the batch program's job (§8.2).
740Privacy note: the inner proof's public inputs live at the voter→sequencer/guest boundary;
741they are **not** published in blobs beyond what the package itself already publishes.
742
743**The proof shows:**
7441. **Ballot validity** — v2's ballot protocol (ranges, uniqueness, cost sum vs
745 `maxValueSum`/weight, `ballotMode` unpacking), with three normative strengthenings over
746 the v2-era prototype: the weight bound is enforced when `maxValueSum = 0`; all comparisons
747 use sound borrow-checked integer gadgets (no Goldilocks wraparound); and the cost sum is
748 computed overflow-safe under the enforced integer-cost profile (§2.3).
7492. **Share consistency** — for every active field, the ν shares lie on one polynomial of
750 degree ≤ θ−1 whose constant term is the ballot value (inactive fields simply don't exist
751 in the package, §2 zero extension). Cost: ν·nf·(θ−1) multiplications, trivial for the
752 AIR.
7533. **Mask consistency** — $e_{i,f} = s_{i,f} + \mathrm{mask}_{i,f}$ where the nf masks of
754 warden $i$ are the LE128-mod-$p$ slices of the single keyed XOF stream
755 $\mathrm{Blake3.keyed}(K_i, \mathrm{streamCtx}(i))$ (§2.2, fixed per-field offsets), with
756 the same $(s_i, K_i)$ committed in $h_i$.
7574. **voteID derivation** from `(processID, address, k)` (Blake3, §5.2), with all of these
758 bound in the public vector.
7595. **Authentication** (§11): knowledge of `sk` with `H(sk) = pk_PQ`, where `pk_PQ` is a
760 public input that the **batch program** binds to the authenticated census leaf (§8.2);
761 census membership itself is *not* proven in the ballot AIR. For an unenrolled hybrid
762 voter (census `pk_PQ = 0`, hybrid-legacy), identity rests on `hybridSig` alone (§11).
763 **There is no revote clause**: first votes and revotes prove the identical statement
764 (drafts ≤1.3 had predecessor-opening, nullifier and counter clauses here, removed with
765 §5.3's redesign, which also removes their witnesses and hashing from the AIR; the
766 instrumented-count gate (§15) measures the net shrink, which must be confirmed, not
767 assumed, since fewer constraints need not cross a trace-padding boundary). Authentication
768 relies on the proof system's **knowledge soundness**: the proof must establish that the
769 prover *knows* the preimage/witness (bound to this entire authorized package), not merely
770 that one exists.
771
772**The in-AIR Blake3 section.** All in-circuit hashing runs in a **re-laid Blake3 section**
773(~25-32 rows per compression at the circuit's width). Compression budget under the
774§2.2 stream-masking definition: per warden ≈ 1 context block + ⌈nf/4⌉ XOF output blocks for
775the masks + ~2-4 for $h_i$ (its input is 32 + 8·nf bytes plus context fields); plus ≈ 8 for
776`pkgCommit`, `sharesDigest` and voteID (the `NULL`/counter hashing of drafts ≤1.3 is gone).
777That is **provisionally ≈ 45 compressions at ν=5/nf=16, fewer at smaller nf**, to be fixed by
778instrumented counts of the exact canonical encodings (first votes and revotes prove the
779same statement). Earlier drafts said ~45/~110 against a per-field masking rule that would
780actually have needed ≥ 80/256; the stream rule above is what makes counts this low possible.
781It MUST constrain full standard-Blake3 semantics, not merely a compression gadget:
782canonical input bytes, exact lengths and zero padding; correct IV / keyed / `derive_key`
783initialization per mode; the full 7-round schedule with both feed-forward halves; the
78464-byte-block and 1024-byte-chunk structure with correct counters and
785`CHUNK_START`/`CHUNK_END`/`ROOT` flags; correct chaining between compressions; XOF
786output-block counters (an XOF is a seekable stream, not repeated hashing); outputs
787constrained equal to the values consumed elsewhere in the AIR; and selector/phase
788constraints that cannot skip or disconnect any check. (The instrumented-count gate of §15
789re-counts the budget against the final relation.) Negative test vectors regenerate
790otherwise-correct traces with wrong flags, counters, lengths or chaining values.
791
792What the proof deliberately does **not** show: that `ct_i` decapsulates to the committed
793$K_i$. Proving ML-KEM in-circuit would drag SHAKE through the AIR. Instead, mismatched
794transport is *harmless to integrity* (no tally proof ever runs Decaps, §10.2) and *publicly
795excludable* (complaints, §9.2). Proving the encapsulation **in-AIR** (§15.1) removes this
796trade-off entirely and is the main tracked upgrade.
797
798**Indicative numbers.** Measured on the prototype [DST]: the Blake3 Merkle/challenger profile
799proves in **0.69 s native** (vs 3.2 s for the old Poseidon2 profile) with **~324 KB proofs**;
800a standalone Blake3 compression AIR costs ≈3.4 ms/compression at its wide layout. The
801full-Blake3 ballot (re-laid in-AIR section) is a **projection, not a measurement**:
802**~2-4 s native (ν-dependent; the blowup-32 profile costs ~2.7× the old blowup-8 prover time, bought back for the batch guest, §8.1)**, ~195 KB proofs, to be re-benchmarked once the
803re-laid AIR exists (equal cell counts do not guarantee equal proving cost; the degree and
804quotient profile must be recomputed). Browser proving is expected at a few × native (mobile
805slower, to be benchmarked; the proof uploads once to one sequencer and is never stored
806on-chain). Annex A.4 measures the proof-system side at the pinned profile on the prototype
807circuit: 1.7 s native single-thread, 4.5-5.2 s in WASM at 478 MiB peak, WASM ≈2.6-3.0×
808native, with the measured blowup-8 → 32 multiplier (2.45×) below the assumed ~2.7×. Benchmark provenance: all prototype figures in this document come from internal
809prototype commits; exact commits, hardware, compiler flags and proof settings will be
810published with the reference implementation. Standing adoption gates (from review): fix the
811vendored challenger's wasm32 query-sampler bug; production hiding CSPRNG; implement full
812Blake3 chunk/tree semantics over the `blake3f` precompile with boundary-length test vectors
813(0/63/64/65/1023/1024/1025 B); measure real browser and whole-batch guest costs before
814deployment guarantees. Before `ballotVKHash` is pinned, the **complete proof profile** must
815be fixed and published: the challenge extension field and its defining polynomial; trace
816shapes, maximum constraint degree and quotient construction; FRI folding and final-polynomial
817parameters; hiding dimensions and the blinding-randomness source; the complete Fiat–Shamir
818transcript (observe/sample schedule, domain-separated initialization, the Merkle-commitment (MMCS) matrix layout and shape
819checks, serialization); and the knowledge-soundness assumptions with the claimed quantum
820security model.
821
822---
823
824## 7. State tree changes
825
826Same sparse-Merkle-tree structure, depth 64, same namespaces as v2, now hashed with
827**Blake3** (leaf: `Blake3(key_LE8 ‖ value_32 ‖ 0x01)`, node: `Blake3(left ‖ right)`), plus
828four changes:
829
830
831
8321. **Vote-ID leaves carry the package digest**: `voteID → pkgDigest` (v2 stored 0). This is
833 the voter's immutable inclusion receipt, and what complaints authenticate against.
8342. **Slot leaves commit to public blinded vectors**:
835 `leaf = Blake3("davinci-slotvec-v3" ‖ slot_LE8 ‖ T_s)` where
836 $T_s \in \mathbb{F}^{\nu \times 16}$ is the slot's current **blinded vector**, whose
837 bytes are published in the batch's blobs (§8.6). The leaf is verifiable from public
838 data alone, so **any sequencer can refresh or overwrite any occupied slot without any
839 earlier sealer's secret** (permissionless sequencing preserved; a vanished sequencer
840 blocks nothing, which strictly improves on drafts ≤1.3, whose opaque chained leaves
841 required predecessor machinery). Overwrites and refreshes produce the same record type
842 (§8.4); nothing public marks the difference.
8433. **Config namespace**: `0x3` = `wardenSetHash` (§4) instead of an encryption key; `0x4` =
844 `Blake3(A)` (the accumulator value itself is published in every batch's blobs); `0x5`
845 **reserved under this version** (drafts ≤1.3 kept the revocation-nullifier SMT here,
846 removed with §5.3's redesign). **`0x8` (reserved in v2) = `viewsRoot`, the per-warden
847 column-view commitment of §8.7**, updated by every transition (`0x6` is `censusOrigin`,
848 inherited from v2 and not reusable).
8494. **Genesis predicate replaces on-chain genesis computation.** The EVM has no Blake3
850 precompile, so the registry no longer computes the genesis root itself. Instead it stores
851 the election parameters and an **initialization flag**, and the **first transition's batch
852 proof constructs the genesis tree deterministically in-guest** from the registry-supplied
853 parameters: the canonical empty tree plus *exactly* the prescribed config leaves, the
854 zero accumulator ($A = 0$: no occupied slots) in its prescribed encoding, **the pinned
855 empty-view encoding of leaf `0x8` (per-warden `viewAcc[i, genesis]` over canonical
856 empty-batch `rowsDigest`/`payloadDigest` encodings, §8.7)**, no slots, no
857 packages, correct initial counters. It then proves `oldRoot` equals that construction.
858 Membership proofs under a prover-chosen root are **never** accepted as a substitute (they
859 show presence, not absence of extra state). Registry rules: the genesis branch is
860 selected by the stored initialization flag (never caller input); parameters come from
861 registry storage, not calldata; the first transition and initialization are recorded
862 atomically; thereafter `oldRoot == storedRoot` always, and re-initialization is
863 impossible; the outer proof binds the full `(chainID, registry, processID)` (not just
864 v2's 4-byte prefix). There is **no zero-ballot transition**: an election with zero
865 accepted transitions never initializes and finalizes by the §9.1 short-circuit (the
866 canonical genesis and empty-view encodings stay pinned here; the first real transition
867 still constructs them).
868
869---
870
871## 8. The batch program (ZisK guest)
872
873In one line: the batch program is the referee. It re-checks every vote package, applies the
874state updates, and maintains the masked running total.
875
876Same role, same settlement flow, same public-output pattern (`ok`/`failMask`, old/new roots,
877counters, census root, blobs digest) as v2. The constraint groups change as follows.
878
879
880
881### 8.1 Ballot proof verification: measured cost
882Verifies the n ballot STARKs **in-guest**. This cost has now been **measured on the real
883emulator** (a ZisK guest running the Plonky3 verifier on an actual ballot proof; internal
884prototype, with exact commits/hardware/flags to be published with the reference
885implementation, §6), and it is
886the dominant cost of the v3 batch program, far above the earlier modeled figure, because
887hashing turns out to be a minor component: at the pinned profile (§2.3) one verification
888costs **≈14.5M guest steps** (22.1M at the former blowup-8/34-query profile), of which
889hashing via the `blake3f` precompile is only ~1.5M (4,681 compressions); the rest is FRI
890field arithmetic, Merkle path bookkeeping, the symbolic constraint rebuild (1.49M,
891**amortized once per batch** since all proofs share one AIR), and proof deserialization.
892Two further optimizations are **normative implementation requirements**: Goldilocks
893inversions use ZisK `fcall` hints (hint + multiply check, replacing ~1.4k-step software
894inversions, the mechanism ZisK already uses for secp256k1/BN254 inverses), and opened rows
895are hashed as words, not per-byte streams. **GPU-measured** (RTX 5090,
896cargo-zisk 1.3.0-alpha, this exact profile, after a reviewed no-precompile optimization
897pass: per-batch setup hoisting, the existing `uint256_inv_mod` fcall as the Goldilocks
898inverse hint, word-level hashing, and a differentially-tested fork of the FRI verifier
899factoring query-independent sums): per-proof cost fell from 14.45M to **2.62M steps**
900(−82%), and proving the verification of 1 / 8 / 32 proofs takes **10.4 / 12.5 / 19.8 s**,
901i.e. a ≈10 s fixed pipeline plus **≈0.30 s marginal per verification**, ≈1.6
902verifications/s at K=32 and a projected ≈2.7/s at K=128 per GPU. A 256-ballot batch's
903verification layer proves in ≈1.5-2 minutes; the fixed pipeline cost, not per-ballot work,
904now dominates.
905With the amortization and inverse hints above (and a proposed upstream Goldilocks-ext²
906precompile), ~1 verification/s/GPU is the modeled target. A **combined guest** running this
907verification plus the complete §8.2-§8.7 state machinery in one program has since been
908measured end to end (Annex A.1): ≈0.37 s per ballot at GPU saturation, 1.4-2.5 votes/s/GPU,
909with a 256-ballot batch proving in 104 s. Practical batch sizes today:
91032-128 ballots for v2-like latency, 256 where ~8-minute batches are acceptable; throughput
911scales across provers as in v2. The price of post-quantum ballots is paid in parallelizable
912sequencer GPU time, not voter experience. The guest implements Blake3's chunk/tree layout
913over the compression syscall; Merkle parents are `BLAKE3(left ‖ right)`. The ballot verifier
914configuration (AIR identity, FRI profile, transcript and hash profile) is pinned via
915`ballotVKHash` at config leaf `0x7`, as in v2, and the guest constructs each proof's expected
916public vector per the §6 statement contract.
917
918### 8.2 Census, authentication, binding
919Census membership is verified **here**, as in v2 (not in the ballot AIR): the program
920authenticates the census leaf `Blake3(address ‖ weight ‖ pk_PQ)` with a Merkle path under an
921accepted root, derives the slot by the census-origin rule, and proves the **join equality**:
922
923$$\text{ballot publics } (\text{identity key},\, weight,\, slot,\, authMode) \;=\; \text{authenticated census values and policy}$$
924
925The census root it checks is bound in the **batch statement** and must be accepted under the
926election's origin-specific registry policy, never chosen freely by the prover. `authMode` is
927derived from the immutable election auth policy plus the creation-time enrollment snapshot
928(§11) and compared against the proof's public input, never prover-chosen. Authentication
929then follows the policy: `pq-only` relies on the in-STARK preimage proof alone; `hybrid`
930*additionally* verifies `hybridSig` (ECDSA over `pkgDigest`, secp256k1 precompile, recovered
931address = census address) for every package; `hybrid-legacy` dispatches per census leaf as
932specified in §11. The program recomputes `ctsDigest` and `pkgDigest` from the package body
933and constructs the proof's full expected public vector from that body (§6 statement
934contract), so an admitted package is byte-for-byte the one the voter's proof authorized.
935
936**On-chain censuses and the PQKeyRegistry (origin 3).** Contracts cannot hash Blake3
937cheaply, so on-chain censuses maintain an incremental **keccak256 running commitment** of
938their authorized registrations (one `keccak256(prev, entry)` per registration, Solidity-
939native). A permissionless **census-root conversion proof**, a small ZisK guest, attests
940"running commitment `c` corresponds to Blake3 lean-IMT root `r`"; the registry verifies it
941and stores the accepted `(c, r)` pair, and batches then use `r` under the origin-3 root
942policy. No unauthenticated off-chain root ever enters the system.
943
944**v2 census migration (conversion proof).** A second accepted conversion statement makes
945deployed v2 censuses usable without rebuilding them: a permissionless ZisK guest proves that
946a v2 Poseidon lean-IMT root $r_2$ corresponds to a Blake3 lean-IMT root $r_3$ over the
947**identical, complete** `(address, weight)` multiset, preserving canonical ordering, index
948semantics and uniqueness, with each leaf's `pk_PQ` joined by a proven PQKeyRegistry
949**membership or non-membership** under the election's creation snapshot (`pk_PQ = 0` exactly
950for proven non-members; anything weaker would let a converter silently downgrade enrolled
951voters to legacy authentication, or omit voters). The source root must itself be accepted
952under the election's origin policy; the registry stores the accepted $(r_2, r_3)$ pair.
953Scope: legacy Merkle censuses (CSP credentials and dynamic census policies keep their own
954enrollment paths, §11). Poseidon-BN254 thereby survives only as a **conversion-only in-guest
955dependency**, never a protocol hash (§2). Combined with `hybrid-legacy` (§11), this makes
956every existing v2 census usable from day one.
957
958### 8.3 State transitions
959In fixed order, each proven against the previous root, as v2: (1) insert
960`voteID → pkgDigest` for every admitted package; (2) apply the **uniform slot updates** of
961§8.4, real writes (first votes and overwrites) and the refresh sample $\mathcal{R}$
962(sample-size rule as v2), all publishing new slot vectors; (3) update
963`0x4` with the new accumulator digest **and `0x8` with
964the new `viewsRoot` (§8.7), atomically with the rest of the batch state** (every accepted
965transition admits at least one package, §2.3).
966
967### 8.4 Uniform slot updates and the accumulator
968For every touched slot $s$ the guest publishes a new blinded vector:
969
970$$T_s^{\text{new}} = Q_s + Z_s + M_s, \qquad
971Q_s = \begin{cases} \widehat{E}_P & \text{real ballot } P \text{ (first write or overwrite;}\\[-2pt]
972& \text{zero-extended per §2)} \\ T_s^{\text{old}} & \text{refresh} \end{cases}$$
973
974where, per field $f$, $Z_s$ holds evaluations of a fresh **zero-constant polynomial**
975$z_{s,f}(x) = \sum_{j=1}^{\theta-1} a_{s,f,j} x^j$ (degree ≤ θ−1, $z_{s,f}(0)=0$, so it
976never changes the interpolation at 0), and $M_s$ holds fresh **unstructured masks**, both
977derived in-guest under the §2.2 `slotUpdCtx` contexts. **A real write and a refresh publish
978the same record type**; no public flag, length or framing difference marks the branch. Why
979both terms: $M_s$ prevents public parity-check attacks on the Shamir code (an unmasked
980codeword-shaped update would vanish under the code's parity checks); $Z_s$ prevents fewer
981than θ wardens, who know their own mask components, from equality-testing a candidate base.
982Zero shares and per-coordinate deltas are **never published or individually committed**; the
983batch proof certifies the relation. Rules: at most **one real ballot per slot per batch**;
984real-write and refresh sets disjoint; refreshes only touch occupied slots; first writes
985increment the occupancy counter ($F \le \texttt{maxVoters}$).
986
987The accumulator is the plain sum of current slot vectors:
988
989$$A = \sum_{\text{occupied } s} T_s, \qquad
990A' = A + \sum_{\text{touched } s} (T_s^{\text{new}} - T_s^{\text{old}})$$
991
992(an empty slot's $T_s^{\text{old}} = 0$). No historical package is ever subtracted: each
993occupied slot contributes exactly one current vector, so double counting is structurally
994impossible. Drafts ≤1.3 maintained the accumulator over per-package additions/subtractions
995with a secret batch pad $B$ hiding the subtracted rows; the uniform update makes the pad
996redundant and it is **removed**.
997
998### 8.5 The warden payload (KEM-DEM, proven)
999Per batch, the guest: derives a 256-bit batch key $k_b$ and the ML-KEM encapsulation
1000randomness from the secret batch seed (guest-internal derivation under the pinned program, so
1001it is as trustworthy as the proof itself); derives the slot-update blinding of §8.4 from
1002$k_b$ under the dedicated `slotUpdCtx` domains (zero-polynomial randomness and mask subkeys
1003are domain-separated from each other and from everything else; tally participants who
1004reconstruct $k_b$ use it only to decrypt the operation log, since the §10.1 contribution
1005equation re-derives no blinding layer);
1006DEM-encrypts (§2.1) the **operation log** under $k_b$, one fixed-shape entry per touched
1007slot, in the public slot-update order: `kind:u8 ‖ admissionIndex:u32` (refresh entries use a
1008fixed sentinel; real entries reference the admitted package's §8.7 ordinal exactly once;
1009fixed shape, no length or framing leak); Shamir-shares $k_b$
1010**coordinate-wise over its 32-bit limbs** θ-of-ν; and for each warden $i$: one in-guest
1011ML-KEM encapsulation to $pk_i$ → wrapping secret → DEM-encrypts share $i$, and publishes a
1012salted Blake3 **commitment to each recipient's share** (opening salts travel inside the
1013respective DEM ciphertexts; these commitments are what lets tally participants validate
1014forwarded shares in §10.4 without decapsulating each other's ciphertexts). The proof binds
1015the blinding derivations to the slot updates, the log entries to the public update sequence
1016and admitted ordinals, every
1017ciphertext to its registered recipient key and context, and the share commitments to the
1018shared $k_b$. **Unlike voter transport, a malformed
1019batch payload is unprovable, not merely complainable**: it would hide an accepted
1020transition's write/refresh history from the tally. All of it is published in
1021the batch's blobs.
1022
1023### 8.6 Blob layout v3 and DA numbers
1024Blob cells carry 31 payload bytes each (a v3 codec choice; v2 packed typed values, v3 packs
1025an opaque byte stream per section), 4096 cells per blob ⇒ 126,976 B per blob. Sections, in
1026order: header · new packages (CanonicalPackage bytes) · slot-update list
1027(slot index 8 B + the new blinded vector $T_s$, 8·ν·nf B, so a touched slot costs
1028`8 + 8·ν·nf` B, e.g. 1,032 B at ν=8/nf=16; drafts ≤1.3 published 40-B opaque leaves plus
1029nullifiers, which no longer exist) · accumulator value $A'$ (ν·nf·8 B; inactive fields are
1030identically zero and not serialized) · warden payload (§8.5, now including the encrypted
1031operation log, 5 B/entry).
1032Byte-exact cell maps live in the davinci-zkvm normative docs, as in v2. One divergence from
1033v2's blob flow: the evaluation point becomes
1034$z_b = \mathrm{keccak256}(\text{processID} \,\|\, \text{stateRoot}^{old} \,\|\, \text{blobCommitment}_b) \bmod q_{BLS}$,
1035keccak because the **registry contract** computes it (Solidity-native; the guest recomputes
1036it via the keccak precompile, one call per blob, a §2 island).
1037
1038Per-package size: `72 + ν·(32 + ct_len + 8·nf)` bytes ⇒ at nf=16: **20,040 B** at
1039ν=16/ML-KEM-768; 10,056 B at ν=8; 6,312 B at ν=5; 1,320 B at ν=1 (all ML-KEM-768, the only
1040allowed transport, §2). nf-sizing: 9,096 B at ν=8/nf=1.
1041
1042| Profile (256 first votes + 256 refreshes, nf=16) | batch bytes | blobs (126,976 B each) | vs v2 (~5 blobs) |
1043|---|---|---|---|
1044| **ν=8, ML-KEM-768 (v3.0 max)** | ≈ 3.1 MB | **≈ 25** | ~5× |
1045| ν=5, ML-KEM-768 | ≈ 2.0 MB | ≈ 16 | ~3.2× |
1046| ν=1 (sequencer mode) | ≈ 0.4 MB | ≈ 4 | ~0.8×, about v2's cost |
1047| ν=16, ML-KEM-768 (future profile) | > 32-blob cap ⇒ smaller batches, or the tracked multi-recipient-Kyber transport (§15.5: package 5,640 B; 256+256 ≈ 2.5 MB ⇒ ≈20 blobs incl. the 2,056-B slot-update vectors) | — | — |
1048
1049(Overwrite-heavy batches cost more: v2's unchanged sampling rule requires ~2w refreshes for
1050w overwrites, so 256 overwrites + 512 refreshes ≈ 2.15/3.4 MB ⇒ 17/27 blobs at ν=5/8. The
1051slot-vector bytes are the price of uniform, publicly-replayable updates, the mechanism that
1052restores v2-grade revote hiding; ≈0.3-0.5 MB per 512-touch batch over drafts ≤1.3, which is
1053bought back elsewhere by deleting nullifiers, revote metadata and the pad.)
1054
1055**Settlement modes.** **L1-blob mode** (v2's production path, the OP-Stack flow) posts
1056blobs across multiple Ethereum transactions and proves their chain inclusion on the rollup;
1057the 32-blob batch cap is inherited from v2's batch program and applies here. **Native blob
1058mode** is limited to the settlement transaction's own blobs (≤ 6 under EIP-7594), exactly
1059v2's flow: for every blob the registry reads its own transaction's versioned hashes via the
1060`blobhash` opcode (the only trustworthy on-chain binding between a versioned hash and an
1061actually-published blob) and preserves the binding chain stored versioned hash → commitment
1062via the point-evaluation precompile → $z_b$ as above → the proof-bound ordered blob digest.
1063Native deployments use correspondingly smaller batches (at ν=5/nf=16, six blobs fit ≈105
1064first votes plus their refresh cover), and L1-blob mode is not an automatic escape hatch on
1065a chain lacking the rollup inclusion-verification path: pick the mode at deployment. Drafts
1066≤1.4 specified a multi-transaction native registration subsystem (`registerBlobs` manifests
1067with freshness, merge and cleanup rules) so native mode could also reach 32 blobs; it is
1068**removed from v3.0** and tracked in §15 in a simplified fold-hash form, to be reinstated
1069only if a native deployment demonstrably needs larger batches. Ceremony and complaint
1070publications never need manifests: they ride their own transactions' blobs, `blobhash`-bound
1071like every blob here.
1072
1073**The archive manifest chain.** On every accepted transition the registry folds the batch
1074into a contract-side running accumulator,
1075`archiveAcc' = keccak256(archiveAcc ‖ batchNumber ‖ stateRoot_new ‖ blobsDigest)` (keccak: it
1076is contract-computed, the island rule), and stores `(archiveAcc, batchNumber)`. At the
1077exclusion freeze this pair is frozen with the tally snapshot. It authenticates the ordered
1078batch **manifest**; actual blob bytes are authenticated by their commitment/versioned-hash
1079bindings (§4), and the §8.7 views are bound transitively through each `stateRoot`.
1080
1081DA is v3's main cost regression and is linear in ν: size committees to the election's
1082stakes. The tracked reduction path is **multi-recipient Kyber** (§15.5): one shared 960 B
1083component plus 128 B per warden ⇒ transport 1,984 B at ν=8 (vs 8,704 B), package
108410,056 → 3,336 B, a ~3× DA cut with ML-KEM security assumptions. (v1.2 tracked Classic
1085McEliece here; withdrawn, since BSI's 2026-09 guidance advises against it in new
1086developments and 2026 cryptanalysis reduced its margins, while its 0.26-1 MB public keys
1087were a poor browser fit anyway.)
1088
1089### 8.7 Per-warden column views (normative)
1090
1091The batch guest already touches every admitted package; this section makes that work
1092reusable so warden tally proofs never re-hash full `CanonicalPackage` bytes and never re-fold
1093the full blob archive (it replaces the per-warden archive re-fold of earlier drafts and
1094satisfies what v1.2 tracked as upgrade 7). Two ordered record streams exist per warden $i$:
1095
1096**Base records** — for each admitted package $v$, in canonical admission order (each
1097package's position in this global order is its **admission ordinal**, referenced by the §8.5
1098operation log), the `(104 + 8·nf)`-byte
1099
1100```text
1101ColumnRecord(v, i) = voteID (8 B) ‖ pkgDigest (32 B) ‖ E[i][1..nf] (8·nf B, canonical LE)
1102 ‖ h[i] (32 B) ‖ Blake3(ct[i]) (32 B)
1103```
1104
1105(`pkgDigest` is load-bearing: the exclusion set $X$ identifies packages by
1106digest, so the record certifies the join between identity and row.)
1107
1108**Update records** — for each touched slot, in the public slot-update order, the 8-byte
1109`UpdateRecord(s) = slot`, one **shared** stream identical for every warden: the §10.1 tally
1110needs the touched-slot order for final-base selection, not vector coordinates (drafts ≤1.4
1111carried a per-warden row $T_s^{new}[i]$, which no consumer needs under the direct-share
1112contribution equation). Observers replay full slot vectors from the published blob bytes as
1113before.
1114
1115Per batch $b$ the guest computes the domain-separated commitments of §2.2's `viewCtx` family:
1116
1117- `rowsDigest[b,i]` — hash of the ordered ColumnRecords **and** UpdateRecords of batch $b$
1118 for warden $i$, with both counts;
1119- `payloadDigest[b]` — hash of the batch's **complete encrypted §8.5 payload envelope**
1120 (operation-log ciphertext, tag, context, per-share commitments, wrapping material).
1121 **Never a digest of the plaintext log: a deterministic plaintext fold is enumerable and
1122 would leak the write/refresh history;**
1123- `viewAcc[i,b] = Blake3(viewCtx_acc ‖ i ‖ b ‖ viewAcc[i,b−1] ‖ admittedCount[b] ‖
1124 touchedCount[b] ‖ rowsDigest[b,i] ‖ payloadDigest[b])`;
1125- `viewsRoot[b] = Blake3(viewCtx_root ‖ batchCount ‖ totalAdmitted ‖ totalTouched ‖ ν ‖
1126 ordered (i, viewAcc[i,b]))`, stored at config leaf `0x8` (§7).
1127
1128Guest obligations: every projected value is derived from the **same** `CanonicalPackage` /
1129slot update the guest admits and publishes; it computes `pkgDigest` and each ciphertext
1130digest itself; every admitted package and every touched slot appears exactly once, in
1131published order, with ordinals identical in all ν views; every accepted batch folds its
1132canonically encoded digests (every accepted batch admits ≥ 1 package, §2.3; the pinned
1133empty-view encoding exists only inside the genesis predicate, §7); the `0x8` update is
1134atomic with the rest of the batch state. Cost: ≈ ν·(18 + 3.9) Blake3 compressions per admitted package (~110 at ν=5, ~175 at
1135ν=8) plus a negligible shared touched-slot term (8 B per touch) and bounded per-batch work.
1136The ciphertext digests (18 compressions each) dominate.
1137
1138No new blob bytes are required: observers and archive providers reconstruct every
1139`ColumnRecord` deterministically from the published `CanonicalPackage` bytes, so views are a
1140*commitment layout*, not extra published data. The registry retains the per-batch
1141`(batchNumber, viewsRoot)` checkpoints it has accepted (bounded storage, one slot per batch,
1142retained until election finalization plus the complaint window, then permissionlessly
1143cleanable), because early complaints (§9.2)
1144prove against historical accepted checkpoints, not the moving current root.
1145
1146Regression tests (normative, from review): omit/duplicate/reorder/substitute one record or
1147batch (both streams); change `pkgDigest` keeping the row; substitute another warden's row
1148or ciphertext digest; replay a view across
1149elections/epochs/profiles/recipient indices; omit a payload; derive the operation history differently from the
1150authenticated payloads; verify
1151no plaintext log digest appears in any public transcript or continuation state; verify no
1152public branch flag, length or framing difference between real-write and refresh records; and
1153check, for all θ-subsets through overwrite chains and exclusions, that the §10.1 direct
1154share sum $\sum_{s:\,P_s \notin X} s_{P_s,i,f} + G_f(i)$ interpolates at 0 to the per-field
1155tally and equals the layered identity of drafts ≤1.4 minus its zero-constant terms.
1156
1157---
1158
1159## 9. End of election: freeze, complaints, exclusions
1160
1161The v2 timeline (end → grace window) gains two phases before results:
1162
1163
1164
1165### 9.1 Casting freeze
1166When the grace window closes the registry stops accepting transitions (as v2) and the
1167accumulator freezes as $A_{\text{cast}}$, bound to the frozen final root $R_{\text{cast}}$
1168(the state root at the casting freeze).
1169
1170**Zero-transition short-circuit.** If no transition was accepted by the freeze
1171(`batchNumber = 0`: the election never initialized, §7), anyone MAY call `finalizeResults`
1172after the freeze; the registry checks the freeze status and `batchNumber = 0` atomically,
1173records the zero vector as the result, and no exclusion freeze, tally session, complaint or
1174warden action ever occurs ($R_{\text{cast}}$, $A_{\text{cast}}$ and $X$ are undefined and
1175never referenced; `submitComplaint` and session opening revert at `batchNumber = 0`;
1176`archiveAcc` stays at its initial value 0). Zero accepted transitions is not the same thing
1177as zero *counted* ballots: an election whose every final base lands in $X$ still runs the
1178ordinary tally.
1179
1180### 9.2 Complaints and the exclusion set X, open from admission
1181**Complaints may be filed from the moment a package settles**, throughout the voting period
1182and until the complaint deadline after the casting freeze (the deadline's *coefficients and
1183margins* come from the named deadline profile referenced at creation, §2.3; the deadline
1184itself is computed once at the freeze, below). This is safe because $X$ is **idempotent and append-only** and complaints
1185**never touch the accumulator**: no complaint needs to know whether its package was already
1186counted, and ordering cannot matter. The payoff is voter recovery. An honest voter whose
1187package carried broken transport (a buggy client) learns while casting is still open and
1188simply **revotes**, an ordinary slot overwrite (§5.3) with no special path (the excluded base is
1189then no longer any slot's final base, and §10.1's direct sum omits a slot's share only when
1190its *final* base is excluded). In
1191v1.2 the same voter discovered the exclusion only after casting closed, unrecoverable.
1192
1193Mechanics: **registered wardens of the election** submit
1194`submitComplaint(processID, pkgDigest, publicValues, proof)` where the ZisK proof shows
1195`Decaps(sk_i, ct_i)` yields a key inconsistent with the package's admitted $h_i$ (witness:
1196the warden's registered key seed; statement bound to the admitted `pkgDigest` and a
1197**registry-retained accepted checkpoint**, §8.7, never the moving current root, so settled
1198batches cannot invalidate a complaint in flight). The decapsulation is fully constrained
1199in-guest, including implicit rejection and the full-ciphertext constant-time FO comparison
1200(§2); host-provided hints are not acceptable. A complaint proof MAY cover **many packages at
1201once** (chunkable under the §2.5 contract; chunking is for adversarial scale, and the
1202single-package complaint is the expected common case); it proves
1203that **every reported package is malformed toward the complaining warden, never that
1204unreported transports are valid** (that would force decapsulation proofs over honest
1205packages; the final contribution proof independently requires valid openings for everything
1206it counts). The submitter pays gas.
1207
1208Normative exclusion semantics: **exclusion never resets slot occupancy, never restores an
1209earlier package, and never modifies the casting
1210accumulator.** A voter whose slot's *final base* package ends up in $X$ after casting closes
1211is not counted. A deliberately malformed last cast is a
1212provable self-abstention, and a voter+warden coalition retains a bounded post-close
1213withdrawal option for that voter's own ballot. A package malformed toward warden $i$ that is
1214*not* excluded still tallies correctly from wardens that can open it (§10.2); a voter may
1215even re-supply the opening out-of-band; warden $i$ either complains in time or sits out.
1216
1217The timing channel, stated openly: early complaints **improve recoverability without
1218creating any false-exclusion capability** (a complaint against well-formed transport cannot
1219be proven), but they add observable signals. Complaint timing and the voter's reaction are
1220public, and a malicious warden can deliberately delay a valid complaint past the point of
1221recovery or use its timing as a side channel. This is documented leakage, not an integrity
1222risk (§12.3).
1223
1224**Capacity is sized to the actual workload via the adaptive deadline of §2.3**: at casting
1225freeze the registry computes $d_{\text{complaint}} = t_{\text{freeze}} + d_0 + \alpha C +
1226\beta M + \gamma U$ from the authenticated terminal counts (admitted casts $C$, batches $M$,
1227slot touches $U$), with coefficients and margins fixed by the deadline profile referenced at
1228creation (§2.3). The per-warden budget
1229it must cover: one scan/decapsulation pass over up to $C$ packages, column-view
1230authentication over both record streams, **a proven decapsulation per reported fault**
1231(worst case $q_i = C$, up to $νC$ across wardens; batching removes per-complaint
1232transaction and verification overhead, not the decapsulations), plus proof generation,
1233publication, inclusion, archive catch-up and reorg margin. Subsequent complaints never
1234extend a computed deadline. There is no per-voter cast bound (§5.3): the provisioning
1235scales with what was actually admitted, and deliberate inflation pays for its own admission
1236while linearly growing a deadline fixed by pinned coefficients. This remains an explicit
1237liveness assumption (§9.3), not an exceptional path. **Early close:** each pinned warden MAY
1238signal **scan-complete** on-chain from its snapshot-pinned settlement account (§4;
1239`msg.sender` is the authorization, and `processID` scoping makes signals inherently
1240replay-safe). A warden MUST NOT signal before completing its scan with all its complaints
1241settled (an honest-warden obligation the signal does not prove). When all ν wardens have
1242signaled, the registry atomically executes the ordinary exclusion freeze with the
1243then-current $X$. Signals assert closure authorization, never that $X$ is empty, and never
1244remove exclusions; θ signals or the tally roster are not sufficient; all complaint paths,
1245including open chunks (§2.5), reject after closure; one missing signal means no
1246acceleration, and the computed deadline stands. This is the one deliberate **classical
1247downgrade** in the warden message layer: forging a signal needs a warden's Ethereum account
1248and can only accelerate closure, a liveness and timing lever, never an integrity or
1249confidentiality one (§12.5; drafts ≤1.4 used SLH-DSA waiver certificates here, which no
1250contract could affordably verify). At the deadline (or all-ν early close) $X$
1251freezes on-chain; every tally proof binds the frozen
1252$(\text{root}, A_{\text{cast}}, X)$ snapshot.
1253
1254### 9.3 Liveness
1255The tally needs at least θ wardens (the tally threshold) that complete the scan (and any
1256complaints) inside the window, complete the ceremony (§10.3-10.4), and publish proven
1257contributions. It also needs, as in v2, timely inclusion of their transactions, **plus a funded
1258processing commitment covering the adaptive workload-derived deadlines (§2.3/§9.2: warden
1259work is linear in admitted casts, and "admission is priced" is not a substitute, since an
1260attacking sequencer pays itself)**, **plus at least one complete, available archive of the
1261election's published history** (§4). Blobs prune after ≈18 days, so the history must be
1262captured live (L1-blob-mode blobs from their publication transactions, §8.6); providers are
1263untrusted, since all
1264data is authenticated against the chain commitments, but a sole provider can halt progress by
1265withholding, so redundancy is operational prudence. Availability must span the casting
1266period, the complaint deadline, **every** tally attempt, and the declared retention period,
1267and must include ceremony and complaint publications; reorganizations and archive catch-up
1268time eat into deadlines and must be budgeted. Missing payload history means the tally cannot
1269complete. Compared with v2: v2 also requires post-pruning archival for anyone replaying
1270the election, but v2 wardens tally from one authenticated final accumulator, so **v3's
1271dependence of tally completion on the complete history is strictly stronger**.
1272Fewer ⇒ results are lost, exactly as v2's "θ of ν wardens take part in decryption".
1273
1274---
1275
1276## 10. Tally: warden sums and Lagrange
1277
1278In one line: this is where the masked running total becomes the election result, in public,
1279with proofs, and without any decryption key.
1280
1281### 10.1 What each participating warden computes
1282After the exclusion freeze, each participating warden $i$:
12831. holds its complete **column view** (§8.7) and the batch payload history, fetched from any
1284 untrusted archive provider and authenticated against the chain commitments, or retained
1285 locally (§4; work is linear in *total casts*, not final voters, and decapsulation/share
1286 recovery MAY run incrementally during the voting period);
12872. decapsulates its per-package ciphertexts (full-ciphertext constant-time FO comparison,
1288 §2), regenerates each package's mask stream
1289 ($\mathrm{Blake3.keyed}(K_{v,i}, \mathrm{streamCtx}(i))$, §2.2), recovers shares
1290 $s_{v,i,f} = e_{v,i,f} - \mathrm{mask}_{v,i,f}$, and checks each against
1291 the admitted $h_{v,i}$;
12923. joins the **tally ceremony**: the participants exchange batch-payload-key shares via
1293 **signed, encrypted bundles on the public DA path, with plaintext shares never public**
1294 (§10.4), reconstruct the per-batch payload
1295 keys (θ shares each), decrypt the payloads, obtaining the **operation log** (which slot
1296 updates were real writes vs refreshes, and which admitted package each real write
1297 installed), all verified against the batch proofs that committed them, and run the
1298 zero-blinding round producing $G_f$ (§10.3; no blinding layer is ever re-derived at
1299 tally time);
13004. reconstructs, from the authenticated operation history, each occupied slot's **final base
1301 package** $P_s$ (deterministic last-write selection), then computes the **direct share
1302 sum**:
1303
1304$$S_{i,f} = \sum_{s:\,P_s \notin X} s_{P_s,i,f} \;+\; G_f(i)$$
1305
1306In words: sum your recovered share of every counted ballot, add your blinding share, done.
1307The shares come from opening the admitted commitments $h_{P_s,i}$, each AIR-bound at
1308admission to the exact $(s_i, K_i)$ used in masking (§5.1, §6); excluded final bases are
1309simply omitted; no mask, no $Z$ or $M$ layer and no slot vector enters the computation.
1310Drafts ≤1.4 instead started from $A_{\text{cast}}$ and subtracted every blinding layer; the
1311two differ only by evaluations of zero-constant polynomials, so any θ same-equation
1312contributions interpolate to the identical tally (verified over 30,120 subset/field cases
1313through overwrites, refreshes and exclusions at ν=1..8). The direct form **replaces** the
1314layered one: exactly one contribution program is pinned per registry deployment, and no
1315profile may select the old equation (a θ-set split across different equations would
1316interpolate garbage that still verifies on-chain).
1317
1318One-line sanity check: each counted term is an evaluation of one degree-(θ−1) ballot
1319polynomial, so the sum is an evaluation of their aggregate; adding $G_f(i)$ (with
1320$G_f(0)=0$) keeps the interpolation at 0 equal to the exact tally.
1321
13225. publishes $S_i$ with a **ZisK proof** whose statement binds: the election, the frozen
1323 $(\text{root}, A_{\text{cast}}, X)$ snapshot, **the frozen terminal view checkpoint
1324 `(batchCount, viewsRoot)` of §8.7**, registry-selected and never warden-supplied
1325 (consistency with a chosen list is not completeness), its recipient index, and the
1326 accepted ceremony transcript (§10.3-§10.4); and whose witness contains its KEM key seed
1327 (authenticating it as warden $i$ against the registered commitment), the
1328 $(s, K)$ openings **for every counted slot's final base package** (each checked against
1329 its admitted $h_{v,i}$), the reconstructed payload keys and payload openings, and its
1330 dealer-delivered blinding evaluations (opening the $cm_{k,i}$ of §10.3). The program processes warden $i$'s **column records, update records and the
1331 authenticated
1332 batch payloads**, never full `CanonicalPackage` bytes, and never a re-fold of the blob
1333 archive (the chain of accepted batch proofs already certifies view completeness; the
1334 registry's `archiveAcc` binds the views transitively through each `stateRoot`). It
1335 enforces **complete, exactly-once processing** of the entire operation history (every
1336 admitted package and every slot update: final-base, superseded, or excluded, with nothing
1337 skipped), with deterministic final-base selection, reaching the
1338 frozen terminal `viewsRoot` and
1339 counts. Payload keys are authenticated by reconstruction from **θ distinct original
1340 committed share openings** (§8.5) followed by DEM verification (successful decryption
1341 under an arbitrary supplied key proves nothing); recovered key limbs must satisfy the
1342 32-bit limb encoding; and the operation history is derived from **all** authenticated
1343 payloads, never from
1344 host-supplied flags. (A tally proof opens $h_{v,i}$; it never hashes actual ciphertext
1345 bytes; only complaint proofs do.) For scale, chunked proving follows the §2.5
1346 contract. Sizing:
1347 total authentication work is $O(C + U + M\nu)$, history-linear rather than
1348 active-voter-only;
1349 the secret opening work scales with counted final bases.
13506. `submitTallyShare(processID, i, S_i, publicValues, proof)`; after θ verified shares,
1351 anyone calls `finalizeResults(processID)`: **the registry performs the Lagrange
1352 interpolation on-chain** (θ ≤ 16 points over Goldilocks, a few u64 mulmods per field),
1353 records the per-field results, and emits `ProcessResultsSet`.
1354
1355Wardens run their **own provers**: the witness contains their secrets, and a shared proving
1356service used by θ wardens would itself hold reconstruction capability. One operator MAY
1357serve wardens of *different* elections on shared infrastructure, provided its aggregate key
1358inventory stays below θ **for every election it touches**: job separation alone is not
1359enough, since epoch keys reused across elections can silently hand one operator θ keys of
1360some committee. Untrusted public
1361*preparation* is fine: anyone may pre-build columns, manifests and lookup structures, since
1362the proof authenticates their use against the frozen commitments, but nothing holding secret
1363witnesses may be outsourced. Proving cost scales with total casts. With the §8.7 column
1364views and the direct share sum, the per-package work is ≈3.9 compressions of public view
1365authentication plus **≈5-8 private compressions** (the $h_{v,i}$ opening; the mask-stream
1366regeneration of drafts ≤1.4 left the circuit with the layered equation; provisional until
1367serialization is pinned). A million-cast tally job is on the order of **9-12M compressions
1368plus payload/ceremony verification and bookkeeping**, versus the >10^8 of v1.2's
1369full-package re-hashing: **≈10× fewer compressions (compression counts, not end-to-end
1370runtime; an unvalidated projection to be benchmarked before warden hardware guidance is
1371given)**.
1372
1373### 10.2 Why malformed voter transport cannot corrupt anything
1374**Decapsulation never appears in any tally proof.** Contributions open the admitted
1375commitments $h$ instead, and under commitment binding every accepted $S_i$ lies on the same
1376aggregate polynomial. A voter publishing a bad `ct_i` only deprives warden $i$ of its opening
1377witness (warden $i$ complains or sits out; the voter could even re-supply the opening
1378out-of-band, which is safe because correctness is tied to $h$, not to the transport). Every clean
1379θ-subset interpolates the same tally, because the ballot STARK proved all ν shares lie on one
1380valid polynomial. Malformed transport is an availability lever against one warden, never an
1381integrity lever against the election.
1382
1383### 10.3 The zero-blinding ceremony
1384In plain terms: before publishing their partial sums, the participating wardens jointly add
1385noise that cancels out exactly at the finish line (x = 0), so the published sums reveal the
1386result and nothing else. Why it's needed: published raw, θ sum-shares determine the aggregate
1387polynomial $F$; any single warden, participant or not, could evaluate it at its own index,
1388compare with the sum of its decoded per-package shares, and fingerprint the write/refresh
1389history (which slots were overwritten). The
1390ceremony prevents that:
1391
13921. A `tallySession` is recorded on-chain: session id = `H(processID ‖ root ‖ X ‖ roster ‖ attempt)`, where `attempt` is a **registry-controlled monotonic nonce** incremented on every restart (the id must change even with an identical roster and snapshot); the registry tracks exactly one active attempt and rejects messages and contributions bound to stale attempts. Three sets are distinguished (§10.4): the **roster $P$** (all eligible wardens that join by the roster deadline, $|P| \ge \theta$; it MAY exceed θ, and should, because extra members are failure margin), the **accepted dealer set $D \subseteq P$** (frozen at the dealer deadline, $|D| \ge \theta$ required so at least one accepted dealer is honest under the $f < \theta$ corruption bound), and the **contributor subset $C$** (any θ roster members with valid contributions). Candidate dealers are the roster; blinding evaluations are delivered **only to the frozen roster, never pre-dealt to all ν wardens or to future replacement candidates** (pre-dealing would hand every warden its $G(i)$, letting any single non-participant strip the blinding at its own index and fingerprint the revoked set, a confirmed attack).
13932. Each dealer $k$ samples a seed and derives, per field, blinding coefficients
1394 $c_{k,f,1..\theta-1}$, defining $g_{k,f}(x) = \sum_j c_{k,f,j} x^j$. **The constant term
1395 is structurally absent, so $g_{k,f}(0) = 0$ by construction** (this is the
1396 "zero-certificate": the dealer proof's coefficient witness simply has no degree-0 entry).
13973. Dealer $k$ publishes (in a session blob): **per-recipient hiding evaluation commitments**
1398 $cm_{k,i} = \mathrm{Blake3}(g_{k,1..16}(i) \,\|\, r_{k,i})$; the KEM-DEM ciphertexts to each
1399 co-participant $i$ encrypting $(g_{k,1..16}(i), r_{k,i})$, where the dealer MUST verify
1400 each recipient's SLH-DSA join envelope before encrypting to its ephemeral key (§10.4);
1401 and a **ZisK dealer proof** over one coefficient witness showing that the degree-0 term
1402 is structurally absent and that every $cm_{k,i}$ and every ciphertext is consistent with
1403 that witness, under the recipients' **ephemeral session keys** (§10.4) and this session's
1404 context. The dealer proof also **authenticates the dealer**: its statement carries the
1405 full canonical envelope digest and the `cerCtx` tuple as public inputs, constrained
1406 in-circuit against the dealer's witnessed registered key seed (proving key possession
1407 without binding the whole message would permit envelope substitution under a replayed
1408 proof; `cerCtx` closes cross-attempt, cross-session and cross-election replay). There is
1409 no separate signature and no standalone coefficient commitment: drafts ≤1.4 had both,
1410 nothing ever opened the coefficient commitment, and the proof subsumes the signature,
1411 which also makes admission to $D$ fully objective (a valid on-chain-verified proof
1412 present by the deadline).
14134. Contributions use $G_f(i) = \sum_{k \in D} g_{k,f}(i)$ over the **accepted dealer set
1414 $D$**, fixed on-chain after the dealer deadline and **immutable thereafter: a dealer
1415 whose publication is missing or invalid before the deadline simply doesn't enter $D$
1416 (margin), and once $D$ is frozen, a member's later unresponsiveness never removes its
1417 polynomial** (removing it would put contributions on different blinded polynomials and
1418 corrupt the interpolation); every contribution proof binds the same $D$ and session id,
1419 and **opens the evaluation commitments $cm_{k,i}$** (the recipient learned the opening by
1420 decapsulating off-circuit; decapsulation still never enters any tally proof). Only if
1421 $|D| < \theta$ at the deadline does the session restart with fresh masks.
1422
1423As long as one accepted dealer is honest, no one outside the ceremony, and no
1424non-participating warden, learns anything about $F$ beyond what the public tally
1425$F(0)$ itself reveals. Under the direct share sum (§10.1), tally-time operation-history
1426hiding rests **solely** on this one-honest-accepted-dealer property, and the committee
1427bound $f < \theta$ itself implies it: $|D| \ge \theta$ and $D \subseteq P$, so an
1428all-malicious accepted dealer set would require ≥ θ corrupt roster members, and θ corrupt
1429roster members already hold θ shares of every batch key and know the complete operation
1430history without touching $F$. Whenever the blinding could matter, that adversary has
1431already crossed the θ boundary. Participants do jointly learn the
1432operation history (which slot updates were overwrites); that is the documented θ-gated
1433metadata leakage (§12.2).
1434
1435### 10.4 The batch-key exchange and the session state machine
1436
1437The batch-payload keys $k_b$ (§8.5) are θ-of-ν shared; **reconstructing them must not leak
1438them**: publicly releasing enough shares of any $k_b$ reveals that batch's operation log and
1439blinding, exactly the write/refresh metadata the uniform slot updates exist to conceal. The
1440ceremony is
1441**four one-shot publications** (join and share bundle SLH-DSA-signed; dealer bundles and
1442contributions proof-authenticated), with no pairwise request/response on the success path:
1443
14441. **Join.** Each participating warden joins the session, publishing a **fresh ephemeral
1445 ceremony ML-KEM keypair for this attempt**, signed with its registered SLH-DSA key (§4).
1446 Roster admission is the transaction itself (`msg.sender` = the snapshot-pinned settlement
1447 account, §4; nothing is verified on-chain beyond that); the SLH-DSA envelope
1448 authenticates the **ephemeral key**, and every sender (dealers before encrypting blinding
1449 evaluations, §10.3; bundle senders before wrapping bundle keys, step 3) MUST verify it
1450 off-chain before encrypting anything to that key. A roster member whose envelope fails
1451 verification is treated as absent (margin) and never encrypted to, so an account-only
1452 forgery is a one-slot denial of service, never a privacy event. (A forged ephemeral key
1453 that senders *did* encrypt to would receive $m{-}1 \ge \theta$ shares of every batch key,
1454 the complete operation history; that is why this envelope keeps post-quantum
1455 authentication while §9.2's closure signals do not.)
1456 **Long-term warden keys MUST NOT be the recipients of ceremony ciphertexts**, and the
1457 ephemeral secret MUST be destroyed once the tally finalizes (§15's key-destruction
1458 guidance applies to ceremony keys with highest priority). Why: the bundles below are
1459 published on a DA path and archived forever. If they were encrypted to lifetime keys, a
1460 *single* participant's later key compromise would reveal ≥θ shares of every $k_b$, i.e.
1461 the complete write/refresh history and all blinding, from the public archive alone
1462 (§12.2).
1463 Ephemeral keys restore "steal a key later ⇒ learn nothing" for honest-deleting
1464 participants. Roster $P$ freezes at the join deadline ($|P| \ge \theta$).
14652. **Dealer bundles** (§10.3), $D$ frozen at their deadline.
14663. **Share bundles.** Each participant publishes ONE signed, authenticated logical bundle
1467 (envelope context `cerCtx`, §2.2): its canonical vector of §8.5 shares and commitment
1468 salts for **all batches**, DEM-encrypted once under a fresh 256-bit CSPRNG **bundle key**
1469 (fresh per attempt, never reused), plus one KEM-DEM wrap of that bundle key to each
1470 co-participant's verified ephemeral key. The SLH-DSA envelope covers the body ciphertext
1471 **and the complete ordered per-recipient wraps** (stripping or substituting a wrap is
1472 only denial of service, since a wrong key fails the DEM tag, but binding them is free
1473 attribution hygiene). Every recipient receives the identical sender vector, exactly what
1474 drafts ≤1.4's per-recipient encryptions delivered, so no one learns more; bundle bytes
1475 drop from $O(m^2 M)$ to $O(mM + m^2)$ (at 1M casts in 256-cast batches: 21.1 → ≈3.1 MB
1476 for m=8, 7.5 → ≈1.9 MB for m=5). Publication is on a **publicly verifiable DA path** so
1477 missing-message timeouts are objective ("I sent it privately" proves nothing); one
1478 logical bundle may span multiple transactions/blobs. A recipient **validates every
1479 recovered share against the batch's published per-share commitments** (§8.5) before use.
1480 An invalid opening is simply ignored; any θ valid distinct shares reconstruct each $k_b$
1481 (all decapsulations follow the §2 full-ciphertext constant-time FO rule).
1482 Signatures give authorship attribution; the protocol still does **not** claim publicly
1483 verifiable fault attribution for encrypted contents (a signature proves who sent a
1484 ciphertext, not what it decrypts to; confidential ZK fault proofs are a tracked
1485 hardening, §15). Faults are absorbed by **margin**, and fault adjudication is never on
1486 the successful tally's critical path.
14874. **Contributions** (§10.1 step 5): any θ valid contributions from roster members, all
1488 bound to the same snapshot, attempt, and frozen $D$. No separate signature: the
1489 contribution proof authenticates the warden through its registered key seed, binding the
1490 full envelope digest and `cerCtx` exactly as dealer proofs do (§10.3).
1491
1492Plaintext key shares and reconstructed keys never appear on-chain or in blobs; contribution
1493proofs reference the payload *openings* (witness), not the keys.
1494
1495**Session state machine** (contract-side): any registered warden of the election may open a
1496`tallySession` after the exclusion freeze; roster accepted at the join deadline with
1497$|P| \ge \theta$; dealer deadline freezes $D$ ($|D| \ge \theta$, immutable, §10.3);
1498share-bundle deadline; contribution deadline. **Every stage closes early on completion**:
1499the join stage when all ν pinned wardens have joined; the dealer stage when every roster
1500member's bundle with a verifying proof is published; the share-bundle stage when every
1501roster member's bundle has completed authenticated DA publication (publication is the
1502observable event, never the validity of encrypted contents); the contribution stage when θ
1503valid contributions are accepted, which already finalizes. Early advancement never shortens
1504the workload-derived contribution deadline and never justifies an early restart; deadlines
1505remain the backstop for missing participants, and a fully-responsive committee goes from
1506exclusion freeze to results in minutes (the same rule gives §9.2 its early exclusion
1507freeze). **A missing or invalid participant at any
1508stage reduces margin, never forces a restart**; `finalizeResults` accepts θ distinct
1509roster members' contributions **bound to one accepted session and its frozen dealer set**.
1510**Restart** (new session id and attempt, fresh blinding and transport randomness; settled
1511batch keys and pads never change; automatic invalidation of stale-session contributions)
1512occurs only by **objective deadline rules when θ valid contributions have become
1513impossible**; no caller may trigger an arbitrary reset. To be clear about what remains:
1514**removing the
1515election-key DKG does not remove coordinated cryptographic ceremonies. v3 replaces it with
1516different (smaller, tally-time-only) coordination work**, and the exchange stays interactive
1517in substance (no PQ primitive lets θ parties privately reconstruct without communicating;
1518there is no silent-threshold shortcut; the four stages are the minimum for ν ≥ 2).
1519
1520**The ν=θ=1 fast path.** In sequencer mode the ceremony collapses entirely: no session
1521stages, no dealer bundles, no share exchange, and $G_f = 0$ (blinding only protects against
1522parties outside the ceremony, and there are none). The exclusion freeze, the authenticated
1523payload reconstruction (the single warden decapsulates its own §8.5 share, which alone
1524reconstructs each $k_b$) and the contribution proof remain, bound to a canonical
1525single-warden context and the frozen snapshot. The sole-operator privacy trust of §4
1526applies.
1527
1528---
1529
1530## 11. Census and authentication
1531
1532- **Census trees** migrate from Poseidon-BN254 to **Blake3** (a breaking format change; same
1533 lean-IMT structure; membership verified by the batch program, §8.2). Leaf encoding:
1534 `leaf = Blake3(address ‖ weight ‖ pk_PQ)` with `pk_PQ = H(sk)` for a CSPRNG-generated
1535 secret, or `pk_PQ = 0` for a not-yet-enrolled voter (hybrid-legacy censuses only).
1536- **PQ-key enrollment.** The Ethereum wallet signs an enrollment message binding
1537 `address ↔ pk_PQ`; the signature *authorizes* the binding and is never key entropy (a
1538 future ECDSA break must not reveal PQ secrets). Enrollment paths per census origin:
1539 off-chain censuses collect `pk_PQ` at census construction; on-chain/token censuses read a
1540 global **PQKeyRegistry** contract where voters register once (one transaction, reusable
1541 across all elections); CSP censuses include `pk_PQ` in the credential.
1542- **Election auth policy** (immutable registry parameter, fixed at creation):
1543 - `pq-only`: every leaf must carry `pk_PQ`; authentication is the in-STARK preimage proof
1544 alone; no ECDSA anywhere in the ballot path.
1545 - `hybrid`: every leaf must carry `pk_PQ`, and every package is verified on **both**
1546 authenticators, the in-STARK preimage proof *and* `hybridSig` (ECDSA over `pkgDigest`,
1547 verified by the batch program). No OR-downgrade exists in this mode.
1548 - `hybrid-legacy`: like `hybrid`, but leaves with `pk_PQ = 0` are admitted with identity
1549 resting on ECDSA alone: every package (first vote or revote, identical statements,
1550 §5.3) is authorized by a mandatory `hybridSig` over its `pkgDigest`, and the STARK's
1551 PQ-preimage clause is skipped for these voters. (Drafts ≤1.3 needed a self-chosen
1552 per-election package key `sk_pkg` to chain revotes; with slot-overwrite revoting there
1553 are no chains and the machinery is removed. A hybrid-legacy package-key commitment from
1554 an earlier draft is NOT PQKeyRegistry enrollment and never alters an election's
1555 creation-time authentication snapshot; durable enrollment stays a one-time
1556 transaction.) The batch program dispatches per
1557 leaf: `pk_PQ ≠ 0` ⇒ both authenticators against the census key; `pk_PQ = 0` ⇒
1558 `hybridSig` alone. Anyone can count the legacy-status census members
1559 (leaf contents are public census data), though not, of course, which *final* packages
1560 are theirs beyond what slot-participation already reveals. Ballot *privacy* is fully PQ
1561 for these voters; the election's **integrity assumptions include ECDSA security for its
1562 legacy voters** (§12.1). This mode is what makes existing token censuses usable before
1563 universal enrollment.
1564- **Enrollment snapshot rule.** A voter's authentication status and key for an election are
1565 pinned at the election's **creation snapshot**: for on-chain/token censuses the registry
1566 records the PQKeyRegistry root at the creation block, and membership proofs must present
1567 the enrollment status under that snapshot regardless of which (newer) eligibility root the
1568 census contract later accepts. Enrolling *after* an election was created affects
1569 subsequent elections only; an existing package chain never changes keys mid-election.
1570- **CSP censuses**: credentials become SLH-DSA signatures [FIPS 205] over the v2 message
1571 format extended with `pk_PQ`; verification is pure hashing via the SHA-256 precompile
1572 (SLH-DSA's internal SHA-2 is a FIPS island, §2, not an application-level hash choice).
1573- Slot derivation, participation visibility, census origins 1-4 mechanics: as v2, with the
1574 enrollment additions above. The v2 census invariants (slot uniqueness across the census;
1575 stable distinct CSP indexes) remain assumptions of integrity.
1576
1577---
1578
1579## 12. Security properties
1580
1581### 12.1 What holds, under what
1582
1583| Property | Holds if |
1584|---|---|
1585| **Tally integrity** | STARK/zkVM soundness (FRI + hashes), binding commitments, correct pinned programs, the settlement chain executes the registry, and the v2 census invariants (unique slots / stable CSP indexes). Then no coalition of voters, sequencers, provers or wardens can shift a tally, including via malformed KEM transport (§10.2). |
1586| **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). |
1587| **Revote hiding (public data)** | hiding proofs + PRF/hash security + the sealing sequencer/prover draws the batch seed *and the refresh set* from fresh randomness and keeps them secret (v2's exact trust statement; §8.4's uniform updates are the v3 analog of v2's re-encryption). **No public-data test distinguishes an overwrite from a refresh, even for a coercer holding the voter's identity key and the coerced package's complete opening (§12.3)**; this is the v2-parity property drafts ≤1.3 lacked. Public data still reveals participation per slot, update counts/timing, `numOverwrites`, complaint timing: v2's leakage surface. Sparse cover (few occupied slots) can disclose overwrites, as in v2. |
1588| **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 an unrecoverable shortfall restarts the session (§10.4). Deliberately malformed batch transport is a different thing entirely: it is unprovable (§8.5), so it cannot appear in an accepted batch. |
1589| **Liveness** | ≥1 honest sequencer with proving capacity and timely inclusion (as v2), plus ≥θ 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). |
1590
1591### 12.2 What wardens and insiders learn
1592θ colluding wardens can reconstruct **every package's ballot**, exactly v2's boundary, where
1593θ wardens can decrypt every ballot. New, and narrower: the parties that can learn the
1594**operation history** (which slot updates were overwrites; metadata, not contents) are
1595defined **cumulatively**. For each
1596batch, that set is anyone who obtains $k_b$, receives its plaintext onward, or
1597**accumulates θ distinct
1598valid original shares of $k_b$, including shares received across different session
1599attempts** (fresh blinding cannot revoke knowledge already obtained; two incomplete attempts
1600can cumulatively suffice). In a delivered share exchange to a roster of size $m$, **every
1601roster recipient**, not only the final θ contributors, gains reconstruction capability,
1602and any one of them can leak the history onward. Because share bundles are DA-published
1603(§10.4), compromise of a recipient's ceremony decryption key would reveal the complete
1604operation history and blinding from
1605the permanent public archive, which is why ceremony keys are **ephemeral per attempt and
1606destroyed after finalization** (§10.4): for honest-deleting participants, a later key theft
1607reveals nothing. Non-participating wardens and the public learn nothing about the history
1608(uniform slot updates §8.4 + blinding §10.3 close those channels; tally-time history hiding
1609rests solely on ≥1 honest accepted dealer, which the committee bound $f < \theta$ itself
1610implies, §10.3, with blinding delivered only to the frozen roster). The sequencer/prover that seals a
1611vote learns which of its own updates are overwrites (§5.4), as in v2.
1612
1613### 12.3 The coercion statement
1614v3 restores v2's informal posture (no formal receipt-freeness; revotes hidden among
1615refreshes) **at parity for public revote obfuscation**: there is **no predecessor-status
1616spend object**, no nullifier, no ticket, no counter, so no public, deterministic test
1617tells a coercer whether a coerced ballot was later replaced. Drafts ≤1.3 lacked exactly
1618this; the review history (a demandable-ticket attack blocked the first quota design) is why
1619the final rule is: *no public, finite, voter-derivable spend objects of any kind*. The
1620claims below were adversarially derived and simulation-checked; wording is deliberately
1621exact.
1622
1623| Coercer's access | Defensible claim |
1624|---|---|
1625| Public data only | No package-content equality test identifies overwrite vs refresh (hiding assumptions). Participation, counts, updated-slot sets, timing, complaints and tally leakage remain: v2's surface. Sparse cover can disclose overwrites, as in v2. |
1626| 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). |
1627| 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. **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. |
1628| 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. |
1629| 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. |
1630| 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); the nullification failsafe is tracked (§15). |
1631| Sealing insider, or an operation-log reconstruction recipient (§12.2) | **Not protected**: these parties learn the write/refresh history and can leak it. The sealing-sequencer boundary is v2's own; the θ-gated log recipients are v3's addition. |
1632
1633Also unaddressed, in v2 and v3 alike: **forced abstention** (per-slot participation is
1634public) and first-write visibility. This is **not receipt-freeness or formal coercion
1635resistance**; the claims are conditional on §12.1's hiding/PRF assumptions, honest
1636escape-vote sealing, and independent future voter randomness (which is why deterministic
1637recovery derivation was removed, §5.2).
1638
1639Additional documented leakage: complaint timing (§9.2; a malicious warden can time a valid
1640complaint as a signal or delay it past recovery) and readiness-signal timing (§9.2's early
1641close is observable metadata).
1642
1643**Operational requirements for clients and deployments**: fresh CSPRNG package randomness
1644always (§5.2); explicit warnings before exporting identity keys or package openings; **no UI
1645or API claim that any derivation proof is harmless**; private authenticated submission to a
1646sequencer the voter trusts; truthful "included" vs "finally counted" status indication (a
1647vote-ID receipt proves inclusion, not final counting).
1648
1649**Remaining roadmap** (§15 Track-2): nullification failsafes (full-extraction class →
1650cancellation), trapdoor-chain depth precedence (last-minute coercion; protected-credential
1651assumptions), fake credentials (the strongest class). The literature's structural dichotomy,
1652recorded: duplicate resolution must either be keyed inside the batch program
1653(sealing-sequencer trust, v2's own posture, which v3 now follows) or moved to the θ-warden
1654tally; no known primitive gives public exactly-once enforcement that the involved voter
1655cannot be forced to re-derive.
1656
1657### 12.4 Proof-system notes
1658The pinned ballot STARK profile targets **≈106-bit** *conjectured* FRI soundness (18 queries × log₂32 + 16 grinding bits; ethSTARK heuristic
1659[ETHS]). That is an explicit engineering dial (queries × log-blowup + grinding), to be raised for
1660high-stakes deployments, and **not** claimed as 128-bit PQ security. The Blake3
1661Merkle/challenger layer uses **full** Blake3 (7 rounds is the standard, not a reduction) with
1662256-bit digests: ~128-bit classical collision resistance, adequate for the classical target
1663above, while generic *quantum* collision bounds on any 256-bit hash are ~2^85 query bounds
1664(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
1665classical conjectured target, not claimed as ≥102-bit end-to-end quantum security (the same
1666caveat applies to a Poseidon2 profile). The ~2^85 figure concerns **collision resistance:
1667commitments and binding**. It does not mean 256-bit *keys* have 85-bit confidentiality
1668(generic quantum key search is the Grover ~2^128 regime). The v2-era prototype's
1669three known defects (weight-bound bypass at `maxValueSum=0`; wraparound-prone comparators;
1670weak hiding-PCS blinding RNG with a constant fallback seed) are normatively fixed in v3
1671(§6, statement item 1; 256-bit CSPRNG blinding seed, fail-closed).
1672
1673**Where Poseidon2 still lives.** Blake3 replaces Poseidon2 in application hashing
1674and the ballot proof system. Poseidon2 remains an **inherited ZisK proof-system dependency**:
1675a break there may compromise accepted state transitions and tally integrity, and can thereby
1676compromise privacy *during protocol execution* (e.g. forged transitions could overwrite
1677slots without authorization and mislead honest wardens into revealing a skewed aggregate).
1678Passive confidentiality of archived ballot transport and masking no longer relies on
1679application-level Poseidon2. "Repairable" means future executions can migrate to a repaired
1680verifier, not that past disclosures or finalized decisions can be undone. Why the move:
1681cryptanalysis of Poseidon2 is young and moving (round-estimate revisions [TOSC25],
1682the EF Poseidon attack-reward program [PINIT], and the FreeLunch family of algebraic attacks
1683on arithmetization-oriented primitives [FL24]), while Blake3 carries long-standing ARX
1684analysis. This is a conservatism call, not a response to any full-round break.
1685
1686**Every published proof must be hiding, not merely sound.** The ballot STARK is not the only
1687proof carrying secrets: batch proofs (the batch seed, $k_b$, the §8.4 blinding derivations
1688and the operation-log plaintext), complaint proofs,
1689**including chunked complaint proofs and their authenticated continuation states** (warden
1690key seeds, decapsulation outputs), dealer proofs (blinding coefficients), warden
1691contributions **and their chunk continuations** (KEM seeds, shares, payload keys; chunking
1692per §2.5) and
1693key-registration proofs all have sensitive witnesses. Each proof
1694profile must therefore be verified to be **zero-knowledge/hiding**, not only sound. Known
1695status: the BN254 PlonK wrapper applies explicit blinding; the hiding of ZisK's *native*
1696VADCOP-final STARK path (ZisK's last recursion stage, the proof the wrapper wraps) is **unverified**, which makes "drop the wrapper for direct STARK
1697verification" (§15) a **privacy question, not only a cost change**.
1698
1699### 12.5 Out of scope / inherited
1700EIP-4844 KZG commitments (Ethereum's own PQ roadmap), organizer/sequencer Ethereum accounts,
1701hybrid-mode ECDSA (by construction), the BN254 PlonK wrapper around ZisK proofs, and the
1702warden settlement accounts that authorize proof-less on-chain messages (§4: session joins
1703and scan-complete signals; forging one moves closure timing and liveness only, §9.2). These
1704classical dependencies are **integrity-critical, and an integrity failure during execution
1705can compromise privacy (§12.4)**. What they cannot do, provided the published proof paths
1706retain their required hiding and the KEM/PRF assumptions hold, is retroactively decrypt
1707archived ballots (breaking a proof system's *soundness* does not by itself recover
1708witnesses). The wrapper is replaceable by direct on-chain STARK verification (indicative public
1709data point: ~5-6 MGas for a WHIR/FRI verifier on the EVM [WHIR]; not a measured cost for ZisK
1710proofs; and a privacy-gated change, §12.4), tracked as the final migration phase.
1711
1712---
1713
1714## 13. Cost summary
1715
1716Annex A reports the measured proof-of-concept figures behind (and beyond) this table:
1717sequencer votes/s/GPU, warden GPU minutes, on-chain gas, and in-guest ML-KEM costs.
1718
1719| Metric | v2 | v3-PQ (estimates unless marked measured) |
1720|---|---|---|
1721| Browser proving | seconds (Groth16, 35.5 MiB key download) | projected ~2-4 s native (ν-dependent, re-laid full-Blake3 AIR at the blowup-32 profile, §6; needs recalculation/benchmark against the §2.2 stream-masking counts; no key download; the Blake3-trees prototype measured 0.69 s native at blowup 8) |
1722| Ballot upload to sequencer | ~2 KB | ~20 KB package + ~195 KB proof (proof not stored on-chain) |
1723| DA per ballot | ~2 KB | ≈1.3-20 KB depending on ν (§8.6 table; ML-KEM-768 only) |
1724| DA per slot touch (refresh OR overwrite) | ~1-2 KB | `8 + 8·ν·nf` B (1,032 B at ν=8/nf=16; 648 B at ν=5/nf=16), the price of publicly-replayable uniform updates |
1725| Batch proving | 2.3-4.0×10^8 steps | **≈0.37 s GPU per ballot measured end to end in a combined guest (verification + full state kernel; 256-ballot batch proves in 104 s; Annex A.1)**; verification alone 2.62M steps, 0.333 s at saturation (§8.1); state-tree hashing −30%/byte vs v2's SHA-256; commitment recomputations +13% vs a Poseidon2 precompile |
1726| Tally | θ partial decryptions of one accumulator + BSGS | history-linear warden jobs over column views, O(C+U+Mν) authentication + per-final-base secret work (§8.7/§10.1: ~9-12M compressions per 1M casts; unvalidated projection) + one ceremony + on-chain Lagrange |
1727| Ceremony DA | — (DKG runs pre-election) | 2 signed publications per participant (join + share bundle; dealer bundles and contributions are proof-authenticated, §10.3-10.4; ~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 (drafts ≤1.4: 7.5/21.1 MB) |
1728| Registry tally cap | 10^12 | 2^61 |
1729
1730### 13.1 Positioning against the literature
1731
1732A 21-protocol, 17-property comparison against the academic and deployed state of the art
1733(Helios, Belenios, ElectionGuard, Civitas/JCJ, VoteAgain, DeVoS, VoteXX, MACI, Kryvos,
1734PQKryvos, T-EVOLVE, CRISP, Swiss Post, Estonia IVXV, and others; maintained with the research
1735artifacts) supports this positioning: **v3-PQ is the most complete post-quantum-private
1736design for permissionless on-chain voting**. As of late 2026 it is the only specified protocol
1737combining PQ ballot privacy, permissionless proof-enforced execution, multi-field ballots,
1738hidden revoting, and no shared decryption key; each near rival misses at least one pillar
1739(CRISP: no permissionless entry; FHE-based designs: operator consensus instead of proofs;
1740PQKryvos/T-EVOLVE: no revoting, trusted bulletin board; MACI: not PQ, trusted coordinator).
1741What the comparison does NOT support is an unqualified "top protocol" claim: the field
1742weights formal analysis, cast-as-intended deployment experience and audits, where v3-PQ is a
1743draft. Those are precisely the Phase-0 gates (§15), plus the §5.2 Benaloh flow. Known
1744property gaps vs specific systems, named explicitly: participation privacy (DeVoS's dummy
1745updates), everlasting privacy (open for the whole PQ complaint-based line), hidden tallies /
1746non-additive methods (PQKryvos; out of scope by design here), and formal machine-checked
1747analysis (Belenios, Swiss Post).
1748
1749---
1750
1751## 14. Errors and edge cases (normative)
1752
1753- **voteID collision** (admission finds the leaf occupied): resample `k` and re-cast, as
1754 v2.
1755- **Slot-write race** (two sequencers hold packages for the same slot): the first settles;
1756 the loser **rebases**. It re-targets the same package at the slot's new public vector
1757 (no predecessor opening exists to invalidate) and seals it in a later batch, subject to
1758 the ≤1-real-ballot-per-slot-per-batch rule. Last settled write wins (§5.3). Voters who
1759 revote rapidly should use one sequencer, as v2 advises. **v2's coverage-history rule
1760 carries over unchanged and is normative here**: a batch that re-seals a package whose
1761 earlier batch was published but not settled MUST also refresh every slot that the earlier
1762 batch touched and this batch does not write (the sequencer keeps the same coverage history
1763 as v2). Otherwise, intersecting the two published touch sets singles out the real-write
1764 slots, defeating §8.4's uniformity.
1765- **Slot's final base excluded** ($P_s \in X$): the client detects it (public $X$, watchable
1766 from the moment of casting, §9.2) and informs the voter. **While casting is open,
1767 recovery is an ordinary overwrite** (§5.3, no special path). After the casting freeze, no
1768 recovery within the election.
1769- **Warden key unavailable at cast time**: the client refuses to cast (it cannot build a
1770 complete package); election creation already requires all ν keys registered (§4).
1771- **Ceremony participant failure**: absorbed by margin. A missing/invalid dealer before the
1772 dealer deadline simply doesn't enter $D$; after $D$ freezes, failures reduce the
1773 contributor margin (§10.4). Restart (fresh masks, new attempt) only when θ valid
1774 contributions become impossible; if no attempt can reach θ, the tally is lost, counted
1775 under liveness (§9.3).
1776
1777---
1778
1779## 15. Tracked upgrades
1780
17811. **In-AIR verifiable encapsulation** — prove **FIPS 203 ML-KEM-768 `Encaps` inside the
1782 ballot STARK**, retiring the complaint mechanism entirely (transport correctness becomes
1783 part of admission). Estimated [est]: FIPS-exact ≈ +4M trace cells, +1.5-4 s native prover;
1784 fallback: K-PKE-768 with Blake3-derived coins (≈ +1.2M cells, +0.5-1 s) **plus a written
1785 IND-CCA argument** (FIPS 203 §3.3 forbids bare K-PKE; the FO-binding lemma of
1786 Takahashi–Zaverucha supplies the key step). **Never prove encryption with non-FO-derived
1787 coins** (decryption-failure oracles). Batch-guest verification deltas must be recomputed
1788 against the measured 2.62M-step baseline (§8.1) before choosing the variant. (v1.2
1789 tracked "RLWE-LPR" here; withdrawn, since Ring-LWE over Goldilocks needs n ≥ 4096 and
1790 ≥6 KB ciphertexts, and dedicated lattice-VE schemes carry 19 KB proofs or relaxed
1791 decryption.)
17922. **PQ coercion-hardening ladder** (§12.3) — what remains AFTER the blinded-slot mainline
1793 (adopted in v1.4 as §5.3/§8.4; design history: a Merkle-cast-ticket quota was proposed
1794 and then **rejected by adversarial review**, because a coercer demands the remaining
1795 ticket tags and watches the public spend tree, so any public finite per-voter posting
1796 right is itself a coercion test; the quota-free design replaced it):
1797 a. **Nullification failsafe** (VoteXX-style Shamir-shared flags): converts full key
1798 extraction from total loss into vote cancellation, the best achievable outcome for
1799 that class (Hirt–Sako).
1800 b. **Trapdoor-chain depth precedence** (deepest-position-wins at tally): adds
1801 last-minute-coercion resistance but admits a "cast at maximum depth" adaptive demand,
1802 presumes a protected credential store, and forces tally-time winner selection.
1803 Separate, deeper research.
1804 c. **Fake credentials** (JCJ lineage) with warden-held rosters: strongest target,
1805 heaviest machinery (deniable enrollment + a reviewed filtering trust model: insider
1806 secrecy, a PQ verifiable mix, or malicious-secure MPC; a zkVM proof alone does not
1807 hide filtering from its prover).
1808 d. **Compositional hiding argument for the blinded-slot layer** (formalization work, not
1809 a mechanism): a written game-based argument covering disclosed old openings, repeated
1810 updates, public proofs/continuations, and the final tally, feeding the ePrint
1811 submission (gate 7 below).
18123. **Locked mode** as a separately specified and reviewed extension (§4).
18134. Direct on-chain STARK verification (drop the PlonK wrapper) once rollup gas permits,
1814 **gated on establishing the native proof path's hiding, not only its cost** (§12.4).
18155. **Multi-recipient Kyber transport** (KKPP20-style FO-mKEM [MMK]): one shared 960 B
1816 component + 128 B per warden ⇒ package 10,056 → 3,336 B at ν=8 (~3× DA cut) and 5,640 B
1817 at ν=16 (a 256-vote + 256-refresh batch ≈ 2.5 MB ⇒ ≈20 blobs; package bytes alone are
1818 ≈12, but slot-update vectors cost 2,056 B per touch at ν=16, bringing the 16-warden
1819 profile inside the 32-blob cap, §8.6); also the cheapest
1820 in-AIR circuit for item 1. **Gated on**: (i) warden-key well-formedness/distinctness
1821 proofs covering the pinned scheme's honest-key requirements (malicious keys break lattice
1822 multi-recipient schemes; a 2025 proof-free fix was broken within a year; §4's
1823 seed-derived keygen proof is the intended vehicle), and (ii) verified **per-recipient
1824 shared-secret independence** (a common secret across wardens would let a single warden
1825 unmask every column, which is fatal). The gate review SHOULD be scheduled alongside
1826 Phase 0, since this transport is also the cheapest circuit for item 1. (v1.2 tracked
1827 Classic McEliece here; withdrawn, §8.6.)
18286. **Proof-certified per-warden exclusion bitsets** for adversarial-extreme elections: each
1829 admission carries a public immutable **ordinal** (position = (settled batch number,
1830 in-batch admission index), assigned at settlement, bound to `pkgDigest` identically in
1831 every §8.7 column view; a bit never denotes different packages in different bitsets);
1832 per-warden bitset commitments $X_i$ updated only by their own warden's complaint proofs
1833 (monotone: set bits are preserved; every new bit justified), published as authenticated
1834 delta bitmaps; the election's $X$ = the union. Collapses 1M exclusions from a 32 MB
1835 digest list (≈512M gas of calldata) to a 125 KB bitmap. Deferred from v3.0: typical
1836 elections see ~0 exclusions, the per-package and chunked-batch complaint paths (§9.2)
1837 already exist, and item 1 retires the whole mechanism; adopt only if the Phase-0
1838 prototype shows complaint gas/DA is binding. "Normally zero complaints" never waives
1839 gate 8's all-malformed throughput test: if the digest representation fails it, adopt
1840 this item or shrink the supported workload envelope.
18417. **Confidential ceremony fault proofs**: ZK proofs binding a signed ceremony ciphertext,
1842 the recipient's ephemeral key, correct decapsulation/DEM processing and the §8.5 share
1843 commitment, outputting *which envelope entry is faulty* without revealing plaintext:
1844 publicly attributable misbehavior for slashing/eligibility policy. Deferred from v3.0:
1845 margin (§10.4) already keeps faults off the tally's critical path; this is
1846 accountability, not liveness.
18478. **Per-election warden keys** as an operational-lifecycle option: the §12.1 *lifetime*
1848 key-compromise assumption means rotating epochs does not protect old ballots if old
1849 secrets survive; per-election keys plus specified destruction (including backups) make the
1850 retention story auditable. (Ceremony keys are already ephemeral per attempt, §10.4.)
18519. **Fold-hash native blob registration**, if a native deployment ever needs > 6-blob
1852 batches (§8.6): constant registry storage per `(process, sender)`, with each registering
1853 transaction reading its own `blobhash` values and appending
1854 `h' = keccak256(h ‖ index ‖ versionedHash)`; settlement re-supplies the ordered hashes as
1855 calldata (≤ 1 KB) and re-folds. Recorded hazards from review: the maximum-registration-age
1856 window anchors to the **first** registration block (appends never renew availability); any
1857 state-root change still kills the whole fold; indices are bound inside the fold, so gaps
1858 or reordering fail the settlement re-fold; a mistaken append is uncorrectable except by
1859 reset (sender-anytime, permissionless after expiry); `blobhash` is still read in the
1860 registering transaction itself, so the versioned-hash binding adds no new KZG assumption.
1861 This replaces drafts ≤1.4's 32-slot indexed manifests (~640k gas of fresh SSTOREs) with
1862 constant storage.
186310. **Multi-election settlement** (`settleMany`): one batch-guest invocation proving an
1864 ordered table of independent transitions (unique process IDs, per-entry registry checks,
1865 stale entries skipped rather than poisoning the group), amortizing the measured ≈10 s
1866 proving pipeline and one wrapper verification across many small elections. Deferred from
1867 v3.0: 50 concurrent small elections need only 1-2 sustained GPUs, so the pipeline is not
1868 a fleet cliff; adopt if gate 8's synchronized closing-burst test shows otherwise.
1869
1870### Phase-0 gates (normative; pass before `ballotVKHash` is pinned)
1871
18721. Re-laid full-Blake3 ballot AIR: instrumented compression counts (first votes and revotes
1873 prove one statement; the net AIR shrink from removing the predecessor/nullifier clauses
1874 must be **measured, not assumed**, since fewer constraints need not cross a trace-padding
1875 boundary); measured native + browser proving (desktop and
1876 a 2023 mid-range phone; pass: browser p50 ≤ 10 s AND p95 peak prover memory ≤ 1.5 GB on
1877 that phone, since the wasm32 address space and mobile tab limits bind before time does;
1878 else adopt the fallback FRI profile, whose batch-guest verification cost is pre-computed
1879 now so a late profile flip cannot invalidate GPU economics or deadline profiles);
1880 **per-nf test vectors** (packages, h_i, digests, views) for all nf = 1..16, incl.
1881 mask-prefix equality at nf boundaries and rejection of trailing inactive bytes.
18822. wasm32 challenger query-sampler fix + production hiding CSPRNG, with negative tests.
18833. **Byte-exact pinned encodings + negative test vectors** for every new structure:
1884 ColumnRecord + UpdateRecord, `viewAcc`/`viewsRoot`, slot vectors and the §8.4 blinding
1885 KDFs, the operation-log envelope, the ceremony bundle envelope (body + ordered
1886 per-recipient bundle-key wraps, §10.4), scan-complete signal semantics (§9.2), chunk
1887 continuation states (§2.5; the §8.7, §9.2 and §10.4 test lists are normative), **the Blake3
1888 census leaf encoding (`address ‖ weight ‖ pk_PQ` field widths and endianness, incl. the
1889 `pk_PQ = 0` legacy case)**, **and the §5.3
1890 slot-update vectors**: no public branch flag or length difference between real writes and
1891 refreshes; fresh blinding across retries/forks; zero-constant sharing checks; replay
1892 rejection without predecessor state; overwrite after total client-state loss; duplicate
1893 real-write atomic rejection; whole-lineage exclusion with no occupancy reset; θ-subset
1894 tally invariance through overwrite chains.
18954. **Hiding/zero-knowledge verification for every new published proof path**: chunked
1896 complaint proofs and warden-contribution chunks added to the §12.4 list; every statement
1897 branch and continuation path of the merged warden guest audited separately (one VK is
1898 not one hiding analysis); the VADCOP-final
1899 hiding question filed upstream with ZisK (feeds item 4 above); plus the §15.2d
1900 compositional hiding argument for the blinded-slot layer (eased by the direct share sum:
1901 published contributions no longer depend on any $k_b$-derived value, §10.1).
19025. DEM security-argument appendix published (§2.1).
19036. The named high-stakes FRI profile (§2.3) documented alongside the default; the versioned
1904 deadline profiles (§2.3) calibrated once from measured scan/proving rates, never per
1905 election, with deadline-overflow, maximum-refresh and synchronized closing-burst
1906 workload tests; early-close tests (scan-complete signals and stage completion, §9.2 and
1907 §10.4, including θ-subset insufficiency); scaled ceremony deadlines.
19087. **ePrint submission of the MSA construction** (masked-share accumulator + blinded slot
1909 state + zero-blinding tally) for public peer review, the protocol's main novelty
1910 debt.
19118. Prototype-derived deployment limits: full batch proving cost, warden tally throughput,
1912 complaint throughput under adversarial all-malformed load (worst case remains linear in
1913 reported faults, §9.2), last-minute malformed floods, synchronized closing bursts across
1914 many concurrent elections, ceremony wall-clock,
1915 electorate/committee/deadline/hardware
1916 envelopes, measured under funded adversarial load, not modeled. The deployment profile
1917 publishes a **ν-sizing table** (ν=1 ≈ v2 cost with sole-operator trust; ν=3-5 for
1918 routine elections; ν=8 for genuinely high stakes): DA, ceremony and warden costs are all
1919 linear or worse in ν, and defaulting to ν=8 triples a fleet's DA bill for no threat-model
1920 reason.
19219. **The census conversion guest** (§8.2): completeness (no omitted or added leaves),
1922 canonical ordering and index preservation, uniqueness, and PQKeyRegistry membership or
1923 non-membership under the creation snapshot, with negative vectors for omitted voters,
1924 duplicated leaves, and enrollment downgrades (`pk_PQ` zeroed for an enrolled voter).
1925
1926**First implementation target (from the external design review).** The atomic cost PoCs of
1927Annex A are done (per-component measurements, real proofs); what follows is the
1928*integration* target. A complete, reproducible
1929**3-of-5, ML-KEM-768 end-to-end election prototype**: browser casting through settlement,
1930complaints, exclusions, the ceremony, warden proofs, and on-chain finalization,
1931with these measured gates: the complete 16-field ballot relation including overwrites,
1932production hiding randomness, the exact pinned proof profile verified inside ZisK, full
1933batch proving cost, complaint throughput under adversarial load, and the complete warden
1934tally job (archive authentication included). Browser latency/memory and deployment limits
1935(electorate sizes, committee sizes, deadlines, hardware) are derived from those measurements,
1936not from component benchmarks. Warden-side statements (key well-formedness §4, complaints
1937§9.2, dealer §10.3, contributions §10.1) SHOULD compile into **one guest binary** with a
1938leading statement-type tag in the public outputs; every contract entry point checks its
1939exact expected tag, version, output schema and registry-derived context (a valid
1940low-obligation statement must never substitute for a complaint or contribution). That gives
1941one VK to pin and one audit target, while gate 4 still audits every branch separately.
1942
1943---
1944
1945## 16. References
1946
1947- [DAV2] Vocdoni, *DAVINCI protocol specification v2*. https://spec.davinci.vote
1948- [FIPS 203] NIST, *Module-Lattice-Based Key-Encapsulation Mechanism Standard (ML-KEM)*, 2024. https://doi.org/10.6028/NIST.FIPS.203
1949- [FIPS 205] NIST, *Stateless Hash-Based Digital Signature Standard (SLH-DSA)*, 2024. https://doi.org/10.6028/NIST.FIPS.205
1950- [Sha79] A. Shamir, *How to Share a Secret*, CACM 22(11), 1979.
1951- [DST] Vocdoni, *davinci-stark: Plonky3 ballot proof prototype*. https://github.com/vocdoni/davinci-stark
1952- [P3] Polygon Zero, *Plonky3*. https://github.com/Plonky3/Plonky3
1953- [ZISK] Polygon, *ZisK zkVM*. https://github.com/0xPolygonHermez/zisk
1954- [POS2] L. Grassi et al., *Poseidon2: A Faster Version of the Poseidon Hash Function*, ePrint 2023/323.
1955- [TOSC25] *Poseidon and Neptune: Gröbner Basis Cryptanalysis Exploiting Subspace Trails*, IACR ToSC. https://tosc.iacr.org/index.php/ToSC/article/view/12244
1956- [FL24] A. Bariant et al., *The Algebraic FreeLunch: Efficient Gröbner Basis Attacks Against Arithmetization-Oriented Primitives*, CRYPTO 2024 (ePrint 2024/347).
1957- [PINIT] Ethereum Foundation, *Poseidon Initiative — cryptanalysis attack reward program*. https://www.poseidon-initiative.info
1958- [B3] J. O'Connor, J.-P. Aumasson, S. Neves, Z. Wilcox-O'Hearn, *BLAKE3: one function, fast everywhere*. https://blake3.io
1959- [ETHS] StarkWare, *ethSTARK Documentation*, ePrint 2021/582.
1960- [EIP4844] V. Buterin et al., *EIP-4844: Shard Blob Transactions*, 2022.
1961- [IR89] R. Impagliazzo, S. Rudich, *Limits on the Provable Consequences of One-Way Permutations*, STOC 1989.
1962- [NOAH] M. Dahl et al., *Noah's Ark: Efficient Threshold-FHE Using Noise Flooding*, WAHC/CCS 2023.
1963- [TEV] J. Alizadeh, *Threshold Post-Quantum E-Voting from Lattice Commitments*, ePrint 2026/2500.
1964- [PQK] N. Huber et al., *PQKryvos: Post-Quantum Secure E-Voting With Flexible Ballot Formats and Public Tally-Hiding*, PoPETs 2026.
1965- [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.
1966- [FOCT] *Careless to Compare: ML-KEM Key Recovery from Partial Fujisaki–Okamoto Re-encryption Comparison*, ePrint 2026/1682.
1967- [TZ21] A. Takahashi, G. Zaverucha, *Verifiable Encryption from MPC-in-the-Head*, ePrint 2021/1704 (App. B: FO binding).
1968- [HS00] M. Hirt, K. Sako, *Efficient Receipt-Free Voting Based on Homomorphic Encryption*, EUROCRYPT 2000 (the cancellation axiom for full extraction).
1969- [JCJ] A. Juels, D. Catalano, M. Jakobsson, *Coercion-Resistant Electronic Elections*, WPES 2005.
1970- [VXX] D. Chaum et al., *VoteXX: Extreme Coercion Resistance*, ePrint 2022/1212 (nullification).
1971- [TDC] J. Erdmanis, *Trapdoor-Chain Vote Precedence*, E-Vote-ID 2026 (depth-based precedence; smartcard-assisted).
1972- [KTV] R. Küsters, T. Truderung, A. Vogt, *A Game-Based Definition of Coercion-Resistance and its Applications*, CSF 2010 (the δ-CR framework used in §12.3).
1973- [KEMB] *ML-KEM WebAssembly implementations and benchmarks*. https://github.com/dchest/mlkem-wasm
1974- [WHIR] *EVM Verification of WHIR over a 31-bit Field*, ethresear.ch, 2025.
1975
1976---
1977
1978## Annex A: measured feasibility (proof-of-concept results)
1979
1980*This annex exists to answer one question: can this specification be implemented, at
1981production scale, with today's tools? Every load-bearing cost in the protocol was
1982implemented as a small, self-contained proof of concept and **measured**, with real GPU
1983proving, on 2026 commodity hardware. Nothing in this annex is a simulation of a proof: every
1984quoted proving time is a generated, verified ZisK proof. A reader of this annex alone should
1985come away knowing what each actor pays, on what hardware, at what election sizes.*
1986
1987**Method.** Seven PoCs (Rust ZisK guests, a WASM prover build, Solidity under Foundry),
1988each atomic: in-guest ML-KEM-768 (encapsulation and decapsulation with the full §2 FO
1989rule); the batch guest's per-package state kernel (digests, census verification, depth-64
1990SMT writes, §8.4 slot-update derivation, §8.7 column views, §8.5 payload); a **combined
1991batch guest** running proof verification and the state kernel in one program; the §10.1
1992warden tally kernel (view authentication, $h_i$ openings, direct share sum); the voter's
1993ballot prover at the pinned profile, native and in WASM; the on-chain contracts (Lagrange
1994finalization, signals, settlement bookkeeping, the point-evaluation precompile); and the
1995wrapper proof's on-chain verification with a real wrapped ZisK proof.
1996Hardware: one NVIDIA RTX 5090 (32 GB), cargo-zisk 1.3.0-alpha (GPU), ziskemu for exact step
1997counts, Node/V8 for WASM, Foundry for gas. Parameters: ν=8, nf=16, θ=5 unless stated (the heaviest v3.0
1998profile). Guest outputs are checked byte-for-byte against independent native recomputation,
1999and every kernel ships negative tests (a corrupted witness share aborts the tally guest; 14
2000tampered batch inputs are rejected; a tampered ciphertext is rejected by the FO check at
2001identical step count). Every GPU proof passed `cargo-zisk verify`. The PoC sources,
2002exact reproduction commands and raw logs will be published with the reference
2003implementation; prototype commits, flags and hardware are pinned there (§6's provenance
2004rule applies).
2005
2006### A.1 Sequencer: throughput and hardware
2007
2008Measured per-package proving cost of the complete batch guest workload:
2009
2010| Component | ZisK steps / package | GPU s / package |
2011|---|---|---|
2012| Ballot-proof verification (§8.1; at GPU saturation, K ≥ 64) | 2.62M | 0.333 |
2013| State kernel (everything else per package: digests, census, SMT, slot updates, views) | 0.161M | 0.036 |
2014| ML-KEM payload (§8.5: ν encapsulations **per batch**, 3.7M steps ≈ 0.4 s) | ≈0.014M amortized at K=256 | ≈0.002 |
2015| **Total (measured in ONE combined guest, not added)** | **2.71M** | **≈0.37** |
2016
2017
2018
2019Proof verification is 94% of the per-vote cost; the entire state machinery of §8.2-§8.7
2020adds 6%. The state kernel's predicted Blake3 precompile count (1,084 compressions per
2021package) matched the measured count exactly, so the §8 obligations are fully priced, none
2022skipped. The components were then integrated: a **combined guest** runs the verification
2023and the state kernel in one program, and composition is additive (+0.4% over the parts,
2024fully accounted for by the output-binding digest). A full 256-ballot combined batch (695M
2025steps, 42 proof segments) proves in **104 s at 46 GB host RAM**, or 111 s at 26 GB with the
2026prover's low-memory flag; 26 of 26 combined proofs verified, and 18 tampered inputs
2027(including corrupted ballot proofs) are rejected.
2028
2029
2030
2031One consumer GPU sustains **1.4-2.5 votes/second, measured end to end in the combined
2032guest** (K = 32 → 256, asymptote ≈2.7, ML-KEM payload included), which is **≈120k-210k
2033votes per day per GPU**. A 100k-voter election (≈120k casts with revotes)
2034costs ≈13-14 GPU-hours of sequencer proving in total, parallelizable across sequencers
2035exactly as in v2; at 2026 rental prices that is a few tens of dollars, or roughly
2036**$0.0001-0.0002 of proving per vote**. Fifty concurrent small elections are a 1-2
2037sustained-GPU workload. Two measurement caveats that generalize: GPU seconds per step vary
2038≈1.8× between FRI-heavy and hash-heavy workloads, and small-batch measurements understate
2039saturated per-proof cost (0.304 s at K ≤ 32 became 0.333 s at K ≥ 64), so capacity planning
2040must carry measured seconds-per-package per workload at saturation, never a single
2041steps-per-second constant (Phase-0 gate 8).
2042
2043### A.2 Wardens: a light role, measured
2044
2045The v1.5 direct share sum (§10.1) was implemented as specified: ColumnRecord folding,
2046$h_i$ openings against witnessed $(s, K)$, per-batch payload-key commitment checks, DEM
2047operation-log decryption, share accumulation. Measured: **1,988 steps and 9.37 Blake3
2048compressions per counted package**, flat from 1k to 102k packages, which lands at the low
2049end of §10.1's projected 9-12M compressions per million casts: the projection is now a
2050measurement.
2051
2052
2053
2054A warden's **entire tally contribution for a million-cast election proves in ≈6-7 minutes**
2055on one consumer GPU (≈10 chunks of ≈100k packages, 44 s each, ≤28 GiB host RAM per chunk).
2056For the fleet's typical elections the job is seconds. The only path to GPU-*hours* is the
2057funded adversarial worst case, a complaint proof against every single package (0.064 s GPU
2058per proven decapsulation, ≈2.1 GPU-hours at 120k casts), which is exactly the workload the
2059adaptive deadline profiles (§2.3) provision for. Decapsulation and share recovery outside
2060proofs run at native speed and are CPU-noise by comparison.
2061
2062### A.3 Ethereum: gas and fees
2063
2064Measured with Foundry (the Lagrange test reconstructs known tallies from Shamir sum-shares
2065and must match exactly; the point-evaluation precompile was exercised live with a valid KZG
2066vector):
2067
2068| Item | Gas (total transaction unless noted) |
2069|---|---|
2070| `finalizeResults`: the on-chain tally, θ = 1 / 3 / 5 / 8 | 162k / 217k / 278k / 387k |
2071| `scanComplete` signal (middle / freeze-triggering, ν=5) | 75k / 97k |
2072| Settlement bookkeeping ($z_b$ keccaks, `archiveAcc` fold, root, checkpoint; execution only) | 57k |
2073| Point-evaluation precompile, per blob (measured live) | 50,461 |
2074| Wrapper proof verification: a **real wrapped ZisK proof** (final stage: PLONK over BN254, 768-B proof, one public input, batch-size-independent; tamper-rejecting) | **268,540 measured** |
2075| Per-batch settlement, all in (bookkeeping + 6 point-evals + measured wrapper verification + calldata + base) | ≈665k + 786k blob gas |
2076| Per-election fixed (creation *estimated* ≈300k + ν signals + finalize, ν=θ=5) | ≈991k |
2077
2078Interpolating the final result on-chain, the step that replaces v2's threshold decryption,
2079costs about as much as one DEX trade. There is no expensive cryptography in any contract:
2080no pairing beyond the inherited wrapper, no SLH-DSA (§4), no Blake3. As an independent
2081cross-check, v2's production settlement with the same wrapper (`submitTransition`) is
2082benchmarked at 498-667k gas for 1-4 blobs, consistent with the figures above.
2083
2084
2085
2086The chart prices blob gas at the full execution gas price; real blob base fees run far
2087lower, so these totals are deliberately pessimistic. Even so: a 500-voter election costs
2088≈0.008-0.4 ETH across the 1-50 gwei range, and a 100k-voter election ≈0.7-34 ETH, i.e.
2089**≈$0.02-0.21 per vote at 10 gwei and $3k/ETH**, dominated by execution gas at realistic
2090blob fees. The ν-sizing table of gate 8 matters here: DA is linear in ν, and these figures
2091are for ν=8-grade packages settled at ν=5-sized batching; sequencer mode prices at roughly
2092v2 cost.
2093
2094### A.4 The voter: proving a ballot in the browser
2095
2096The pinned proof profile (§2.3: blowup 32, 18 FRI queries, 16-bit grinding, hiding PCS,
2097Blake3 transcript) was measured on the existing ballot-circuit prototype, natively and
2098compiled to WASM under Node's V8 (Chrome's engine), with the known wasm32 challenger defect
2099patched (a one-line u64 comparison; unpatched, wasm32 proving panics at **every** profile,
2100so the fix is a prerequisite for any browser proving, §6). Every WASM proof verifies under
2101the native verifier and is rejected after a one-byte flip or under the wrong profile.
2102
2103| Profile | Native, 1 thread | WASM, warm (cold first proof) | Proof size | Peak WASM memory |
2104|---|---|---|---|---|
2105| blowup 8 / 34 queries (baseline) | 0.70 s | 2.3 s (2.5 s) | 324 KB | 122 MiB |
2106| fallback: blowup 16 / 26 queries | 1.05 s | 3.0 s (3.4 s) | 264 KB | 240 MiB |
2107| **pinned: blowup 32 / 18 queries** | **1.71 s** | **4.5 s (5.2 s)** | **196 KB** | **478 MiB** |
2108
2109
2110
2111Against the Phase-0 gate (p50 ≤ 10 s and ≤ 1.5 GB on a 2023 mid-range phone): **time
2112passes with ≈2× headroom on desktop hardware** (a phone more than ≈2× slower than this
2113desktop, or a final circuit more than ≈2× heavier, consumes it), and **memory passes at
2114under a third of the budget**; memory does not depend on CPU speed, so that verdict carries
2115to phones for this circuit, with room for one doubling of the final circuit's rows but not
2116two. Proof size came in 39% below the blowup-8 baseline, exactly as §2.3 states, and the
2117measured blowup-8 → 32 cost multiplier (2.45× single-threaded, 2.0× in WASM) is below the
2118~2.7× the cost model assumes. The essential caveat: this is the prototype circuit
2119(2,048 × 379 trace), not the final §6 ballot AIR with the re-laid in-AIR Blake3 section;
2120these numbers are floors and scaling factors, and gate 1's phone benchmark remains the
2121decisive test. The fallback profile buys ≈35% of the time and half the memory for 34%
2122larger proofs: a real safety valve if the final circuit runs heavy.
2123
2124### A.5 ML-KEM-768 inside the zkVM
2125
2126The one post-quantum primitive the protocol runs inside guests was measured end to end
2127(RustCrypto `ml-kem`, 24 verified proofs):
2128
2129| Operation | Steps (Keccak precompile) | Steps (pure software) | GPU marginal |
2130|---|---|---|---|
2131| Encapsulation | 462K | 1.04M | 0.049 s |
2132| Decapsulation + full constant-time FO comparison | 608K | 1.24M | 0.064 s |
2133
2134The §8.5 batch payload (ν=8 encapsulations) is a per-batch cost of ≈0.4 s GPU, invisible
2135per vote. The §2 normative FO rule is precisely what the measured implementation does: the
2136re-encrypted ciphertext is compared over all 1,088 bytes with no early exit, verified in
2137source and by a tamper test that completes in the identical step count on the rejection
2138path.
2139
2140### A.6 What this annex establishes, and what remains
2141
2142Established by measurement: the batch guest's full obligation set is priced, linear, and
2143**integrated** (one combined guest verifying proofs and executing the state machinery,
2144proven at 256 ballots per proof on one consumer GPU); sequencer throughput supports fleet
2145operation on single-digit GPUs; the warden role is minutes of commodity GPU even at a
2146million casts, validating the §10.1 projection; the voter's proof fits the latency and
2147memory gates on desktop with headroom at the pinned profile, with a measured fallback that
2148halves memory; the entire on-chain footprint is cheap, standard Solidity, with the wrapper
2149verification now **measured** against a real wrapped proof (268.5k gas) and corroborated by
2150v2's production settlement benchmarks; and the in-guest KEM, the one exotic ingredient,
2151costs half a million steps per operation. Three encoding-level optimizations were
2152identified for Phase-0 gate 3 (a pre-digested payload-envelope layout, a constant-prefix
2153$hCtx$ alignment, and 8-byte-aligned guest input layouts), each worth 5-35% of its kernel's
2154hashing cost; none is load-bearing for feasibility.
2155
2156Honestly open, and owned by the §15 Phase-0 gates: the **final ballot AIR** (the re-laid
2157in-AIR Blake3 section of §6 does not exist yet; A.4's figures are floors and scaling
2158factors, and gate 1's instrumented counts plus a real 2023-phone benchmark remain the
2159decisive voter-side test); real browser engines beyond V8 and WASM threading; the §2.5
2160chunk-linking overhead on the million-cast tally (chunks are measured individually); the
2161dealer-proof guest (a composition of measured primitives, expected trivial); and
2162election-creation gas (estimated, not built). Nothing measured in this annex contradicts a
2163cost claim in this specification; two projections (§8.1 economics, §10.1 tally work) came
2164in at or better than stated, and the one number that moved against us is small (saturated
2165verification costs 0.333 s per proof, not 0.304 s, a 2-6% throughput haircut captured in
2166A.1's table).