davinci-paper/v2/sections/analysis.tex
v2/sections/analysis.texRaw
1% !TeX root = ../build/main.tex
2
3\subsection{Security discussion}
4\label{sec:analysis:security}
5
6Based on the above principles, the protocol provides a number of concrete security properties that ensure the integrity, confidentiality, and verifiability of voting events. In what follows we discuss how \davinci achieves these properties, with particular emphasis on integrity, receipt-freeness, and ballot privacy, before turning to data availability, liveness, end-to-end verifiability, and robustness against quantum threats. Table~\ref{tab:trust} summarizes the parties that each property relies on.
7
8\paragraph{Integrity and soundness.} The integrity of the election rests on the soundness of the proofs rather than on trust in any operator: the knowledge soundness of Groth16 for ballot proofs, and the soundness of the ZisK \acp{STARK} and of the PlonK wrapper for the batch and results programs. No party (including a malicious sequencer) can advance the state from $S_i$ to $S_{i+1}$ without supplying a valid batch proof, since the registry rejects any update not accompanied by such a proof. Because a \ac{zkVM} proves the execution of a program, the statement that is proven is exactly what the program checks, and the registry pins the program through its verification key: an update proven by any other program, under any other setup, or with a failed verdict ($\okflag \ne 1$) is rejected. The registry also binds every proof to the election: the old root must be the latest root, the census root must be one the election accepts, the count of occupied slots must match, and the blob openings must match the published blobs. Consequently, every counted ballot originates from an eligible census member and every accumulator update follows the protocol rules. Double voting is prevented \emph{without} nullifiers: each voter is bound to a unique, census-authenticated slot in the state tree, so a second submission by the same voter overwrites their previous ballot at that slot rather than adding a new contribution to the tally. Vote identifiers, by contrast, are derived per ballot and therefore differ across submissions, which is precisely what enables individual verifiability without linking a voter to their ciphertext. The guest programs are built reproducibly, so anyone can recompile the published source, recompute the program keys, and compare them with the keys pinned by the registry.
9
10\paragraph{Receipt-freeness.} Receipt-freeness prevents voters from proving to others how they voted, thereby mitigating coercion and vote-buying. In \davinci this is achieved through re-encryption, ballot overwrites, and randomized state updates.
11\begin{itemize}
12 \item \textit{Ballot re-encryption}: since our encryption scheme supports re-randomization, that is, a ciphertext can be refreshed with new randomness without changing the underlying message, sequencers re-encrypt the received ballots before committing them to the state Merkle tree. Under the decisional Diffie--Hellman (DDH) assumption on BabyJubjub, a re-randomized ciphertext is indistinguishable from a fresh encryption, so linking a submitted ciphertext to its stored counterpart is as hard as solving DDH. The re-encryption scalars are derived inside the batch program from a single secret seed per batch and the old state root, and every scalar is consumed exactly once, so no scalar can repeat within or across batches.
13 \item \textit{Handling receipts}: because ballots are re-randomized, voters cannot generate a receipt by revealing the randomness $k$ used in encryption, since the ciphertext on-chain no longer corresponds to their $k$. This blocks vote-selling and coercion.
14 \item \textit{Overwrites}: voters may cast a new ballot at any time, replacing their earlier submission. This ensures that even if coercion occurs, a voter can subsequently change their vote as many times as desired, preserving their ability to express their true choice. When an overwrite occurs, the batch subtracts the previous ballot and adds the new one to the results accumulator, and re-encrypts the updated ballot before storing it in the state tree.
15 \item \textit{Concealing overwrites (silent revoting)}: to prevent observers from distinguishing overwrites from routine re-randomizations, every batch also re-encrypts a uniformly random sample of the occupied slots it does not write, with a size that the batch program enforces, $\min(2048, \max(16, 2w, n))$ slots when available. The blobs list every updated slot in a single sorted list, so an overwrite is indistinguishable from a refresh. Sequencers keep a history of the batches that carried each vote, so that a vote sealed again after a lost race or a failed settlement refreshes every slot of its earlier batches and cannot be singled out by comparing them.
16\end{itemize}
17Receipt-freeness holds against observers of the public data, under two conditions. First, the sequencer that builds a batch, and its prover, learn which slots of the batch are overwrites and which are refreshes, and must not reveal the seed or the refresh selection; a voter who fears coercion should overwrite through a sequencer they trust. Second, the first write to a slot is distinguishable, since refreshes only touch occupied slots, so participation is not hidden (see the privacy paragraph). A further, minor limitation is that re-encryption scalars are 256-bit SHA-256 digests reduced modulo the 254-bit order $s$ of the BN254 scalar field, which leaves them at statistical distance about $2^{-4.7}$ from uniform in $[0, s)$; after the implicit reduction modulo the subgroup order $t \approx s/8$, the scalars actually applied are at statistical distance about $2^{-7.6}$ from uniform. Removing this gap requires reducing a wider digest, and hence a new program key.
18
19\paragraph{Privacy.} Ballots remain secret even though encrypted ballots are publicly stored and processed. Ballot secrecy is preserved through ElGamal encryption, which allows votes to be aggregated without decryption. When the encryption key is generated through a \ac{DKG} (or a council ceremony) and its secret counterpart is never reconstructed, no single party can decrypt individual ballots: the protocol only invokes threshold decryption on the final aggregate, never on each ballot separately. Under the assumption that at most $\theta-1$ of the $\nu$ \keywardens are compromised, the shared secret key cannot be reconstructed and no individual ballot ciphertext can be decrypted. A coalition of $\theta$ \keywardens, however, could decrypt every ballot published in the blobs, so the threshold must be chosen to reflect the trust placed in the committee; in the locked \ac{DKG} mode, the coalition would also need the organizer's secret. In the sequencer mode, the sequencer that holds the key can decrypt every ballot, which is why this mode is reserved for elections that accept that trust. Note that, while the content of a ballot stays hidden, the protocol does reveal whether a given voter has cast a vote, that is, turnout is public, but the choice is not. With a Merkle census, the slot of a voter is a public function of their address, so the participation of each census member can be read from the state.
20
21\paragraph{Data availability.} Ballots and state updates are published in Ethereum blobs, and the registry checks, at settlement, that the published blobs open to the values the batch program derived from the verified state. A sequencer therefore cannot settle a transition whose data it withholds. In L1-blob mode, the guarantee is the same: the blobs live on Ethereum, and the registry on the rollup verifies their inclusion in the Ethereum chain from block headers anchored at the rollup's view of Ethereum, so it relies, in addition, on the rollup deriving its L1 origin correctly, an assumption the rollup itself already makes. Since blobs are pruned after about 18 days, long-term availability requires archival: every sequencer stores and serves the blobs of the transitions it has seen, and observers can rebuild any election from them, but a node that starts after the blobs have been pruned depends on such an archive. Since EIP-7594, only nodes that custody full blobs can serve them, so sequencers should rely on such nodes or on archivers.
22
23\paragraph{Liveness and censorship resistance.} Sequencing is permissionless, so a voter whose ballot is ignored by one sequencer can submit it to another, and anyone can run a sequencer for any election. Settlement is a race in which the first valid transition wins; a sequencer that loses only wastes its own work. The grace window lets ballots received before the end of the voting period settle after it, and its extension is capped by Eq.~\eqref{eq:grace-end}, so the results cannot be delayed indefinitely. Once results are requested from the \keywardens, the process leaves the organizer's control and can no longer be canceled. The liveness of threshold decryption depends on the \keywardens: if more than $\nu - \theta$ members of the committee that holds an election's key become unavailable before the tally is decrypted, the results are lost, since keys are not reshared to later committees. In the sequencer mode, the results depend on the availability of the single key holder.
24
25\paragraph{Quantum resistance.} Quantum computers threaten discrete-logarithm-based cryptography such as ECDSA and ElGamal, and pairing-based proof systems such as Groth16 and PlonK. The \acp{STARK} that prove the batch and results programs rely only on hash functions and are plausibly post-quantum, but their PlonK wrapper, the ballot proofs, the voters' signatures, and the encryption of ballots are not. For this reason, \davinci is designed in a modular way that would allow migration to post-quantum primitives in the longer term. Candidate replacements include lattice-based signature schemes such as CRYSTALS-Dilithium (ML-DSA) and Falcon, and the hash-based SPHINCS+ (SLH-DSA); lattice-based homomorphic encryption such as BGV or BFV; and the direct on-chain verification of \acp{STARK}.
26
27\paragraph{End-to-end verifiability.} Voters can check that their own ballot was included correctly, while anyone can audit the entire process to verify the final tally. Every voter can check, with an inclusion proof of their vote identifier against a state root recorded on-chain, that their ballot was recorded as cast (individual verifiability). Additionally, any third party can replay every state transition from the published blobs, check that it reproduces the roots recorded on-chain, and verify the proofs, which confirms the results (universal verifiability) and that each counted ballot comes from a registered voter (eligibility verifiability). The protocol does not provide, by itself, a mechanism for a voter to verify that their device encrypted the intended choice (cast-as-intended verifiability); this property can be added by the client application, for instance with a second device that audits a ballot before it is cast.
28
29\begin{table}[h]
30 \centering
31 \caption{Trust assumptions of the main properties.}
32 \label{tab:trust}
33 \small
34 \begin{tabular}{p{0.25\textwidth} p{0.68\textwidth}}
35 \toprule
36 \textbf{Property} & \textbf{Holds if} \\
37 \midrule
38 Integrity of the tally & The proof systems are sound, the pinned programs and circuits are correct, and the settlement chain executes the registry correctly. No sequencer, prover, or \keywarden is trusted. \\
39 Ballot secrecy & Fewer than $\theta$ \keywardens collude (\ac{DKG} and council modes), or the key-holding sequencer is honest (sequencer mode); DDH holds on BabyJubjub. \\
40 Receipt-freeness & As ballot secrecy, and the sequencer that seals an overwrite does not reveal its seed and refresh selection. \\
41 Data availability & Ethereum makes the blobs available at settlement; archivers retain them after pruning. L1-blob mode also relies on the rollup's L1 origin. \\
42 Liveness & At least one honest sequencer serves the election; at least $\theta$ \keywardens are available for decryption (or the key-holding sequencer, in sequencer mode). \\
43 \bottomrule
44 \end{tabular}
45\end{table}
46
47\subsection{Implementation}
48\label{sec:analysis:implementation}
49
50\Davinci is implemented as a modular, fully open-source system: the ballot circuit~\cite{davinci-circom}, the \ac{zkVM} programs~\cite{davinci-zkvm}, the smart contracts~\cite{davinci-contracts}, the sequencer node and its client library~\cite{davinci-sequencer}, and the key-management systems~\cite{davinci-dkg,davinci-council} are all publicly available at \url{https://github.com/vocdoni}. Its components can be recombined or integrated with external services through adaptable interfaces, enabling redundancy and integration with third-party applications such as our voting-as-a-service APIs.
51
52\paragraph{Technological stack.}
53The ballot circuit is implemented with Circom~\cite{belles2023circom} over BN254 and proven with Groth16~\cite{groth2016size} for its minimal proof size and cheap verification; its ElGamal operations run over BabyJubjub, whose base field matches the BN254 scalar field. The batch and results programs are \texttt{no\_std} Rust programs compiled for the RISC-V target of ZisK~1.3.2 and proven by a GPU prover service, which wraps every proof in PlonK over BN254 for on-chain verification. Inside the programs, SHA-256, Keccak, BN254 pairings and scalar multiplications, SECP256K1 key recovery, BabyJubjub point additions, and 256-bit modular arithmetic run on ZisK precompiles; Poseidon is implemented in software over the BN254 field. The smart contracts are written in Solidity, and the sequencer node and its client library in Rust.
54
55\paragraph{Circuit and program sizes.} The ballot circuit has $64{,}816$ constraints for 16 fields; its proving key is 35.5~MiB and its witness generator 6.5~MiB, which a browser downloads before proving. A \ac{zkVM} program has no fixed size: its cost is the number of executed steps, which grows with the batch. A batch program execution with 512 votes and 512 refreshes takes about $2.3 \cdot 10^8$ steps at $n_f = 2$ and $4.0 \cdot 10^8$ steps at $n_f = 16$. The program accepts batches of up to 1024 votes, 2048 refreshes, and 32 blobs; sequencers currently seal at most 512 votes per batch.
56
57\paragraph{Trusted setup.} Groth16 relies on a circuit-specific common reference string (\ac{CRS}, see Appendix~\ref{sec:cryptographic-primitives:zkp}). The parameters of the ballot circuit must be generated through an \ac{MPC} ceremony in two phases: a universal powers-of-tau phase, for which a public ceremony of $2^{18}$ constraints can be reused, followed by a per-circuit phase that binds the parameters to the constraint system and introduces the secret $\delta$. As long as at least one participant in each phase discards their secret contribution, the resulting \ac{CRS} is secure. The \ac{zkVM} \acp{STARK} need no setup, and their PlonK wrapper uses the universal setup distributed with the ZisK release. The circuits of the \ac{DKG} network and of the council have setups of their own.
58
59\paragraph{Release pins.} A release of the protocol is identified by the values in Table~\ref{tab:pins}, which the registry stores as immutable parameters and sequencers check at startup. A sequencer refuses a registry, a verifier contract, or a prover whose values differ.
60
61\begin{table}[h]
62 \centering
63 \caption{Release pins of the protocol version described in this paper (davinci-zkvm v0.3.0, ZisK 1.3.2).}
64 \label{tab:pins}
65 \small
66 \begin{tabular}{p{0.27\textwidth} p{0.66\textwidth}}
67 \toprule
68 \textbf{Value} & \textbf{Hash} \\
69 \midrule
70 Batch program key & {\scriptsize\texttt{0xe39e460085ecddecf365649a61183a71c0fe778aa9c06fd2aa1a6c43cddb988b}} \\
71 Results program key & {\scriptsize\texttt{0x394694558f39d0b2da0bbb09322333a0f567ee8d16bea2f354543a086587d167}} \\
72 \rootc & {\scriptsize\texttt{0x6b2490fba336fb00f0c8719a961de309a8db6f43a9bfb7575ca5f014d609b265}} \\
73 \ballotvkhash & {\scriptsize\texttt{0xbf1e6590bb1ba883d601c4d7d1c6fa2722a78590716874019db6d68fc776bb0e}} \\
74 \ziskverifier code hash & {\scriptsize\texttt{0xadab570d3e3a4c172d0c75e5aef5d06098b94d70a9c8ff76af239a90fdcadcc1}} \\
75 \bottomrule
76 \end{tabular}
77\end{table}
78
79\paragraph{Implementation status.} The current implementation includes the ballot circuit, the batch and results programs, the smart contracts, the sequencer node, and both key-management systems, and it runs in production on OP Mainnet in L1-blob mode, with all four key modes enabled. The registry is deployed at \texttt{0x64d41aD49009204E8dAcc153Fc98a5Ee14cB6916}, with a default grace window of 300~s (organizers may choose between 240~s and 600~s), a maximum extension of 1800~s, and a minimum notice of 60~s. The council circuits currently use a development setup produced by a single party, which is acceptable for a beta but must be replaced by a multi-party ceremony. No complete independent security audit of the system has been published yet.
80
81\subsection{Performance evaluation}
82\label{sec:analysis:performance-evaluation}
83
84We evaluate \davinci along four axes: voter-side proving, sequencer proving, on-chain verification, and data availability, together with the end-to-end throughput of the system. Unless stated otherwise, sequencer measurements use one NVIDIA RTX 5090 GPU (32~GB) on a host with an AMD Ryzen 9 9950X3D CPU.
85
86\paragraph{Voter proving.} A ballot proof is generated with snarkjs; natively, one 16-core CPU produces about six proofs per second, and a single proof takes about $0.16$~s. In a browser, proving is slower and is dominated by the download of the proving artifacts, but it requires no specialized hardware and remains within the latency a voter tolerates at casting time.
87
88\paragraph{Sequencer proving.} Table~\ref{tab:proving} and Fig.~\ref{fig:proving-time} report the time to prove one batch, including witness generation, the \ac{STARK} proof, its recursion, and the PlonK wrapper. The \emph{first} batch of an election has nothing to refresh; a \emph{steady} batch refreshes as many slots as it writes, which is the regime that determines throughput. The fixed cost per batch is about $15.5$~s, and each additional refresh costs about 13~ms at $n_f = 2$ and 40~ms at $n_f = 16$. Throughput peaks around 512 votes per batch at $n_f = 2$ and 256 at $n_f = 16$; beyond that, the batch size is bounded by the host memory of the prover (about 54~GB for a steady batch of 1024 votes), not by the GPU. The proof is 768 bytes, plus 512 bytes of public values, at every batch size. These figures were measured on ZisK~1.3.0, the predecessor of the release in Table~\ref{tab:pins}, with the same batch program logic.
89
90\begin{table}[h]
91 \centering
92 \caption{Proving time of the batch program on one RTX 5090 (seconds), and blobs needed by a steady batch.}
93 \label{tab:proving}
94 \small
95 \begin{tabular}{r rrr rrr}
96 \toprule
97 & \multicolumn{3}{c}{$n_f = 2$} & \multicolumn{3}{c}{$n_f = 16$} \\
98 \cmidrule(lr){2-4} \cmidrule(lr){5-7}
99 Votes & First & Steady & Blobs & First & Steady & Blobs \\
100 \midrule
101 64 & 22.0 & 22.5 & 1 & 27.4 & 30.3 & 2 \\
102 128 & 28.5 & 30.1 & 1 & 40.7 & 45.7 & 3 \\
103 256 & 42.6 & 46.2 & 1 & 66.3 & 76.7 & 5 \\
104 512 & 76.6 & 84.3 & 2 & 139.4 & 164.3 & 9 \\
105 1024 & 154.5 & 171.2 & 3 & 311.0 & 363.9 & 17 \\
106 \bottomrule
107 \end{tabular}
108\end{table}
109
110\begin{figure}[h]
111 \centerline{\includegraphics[width=0.9\textwidth,draft=false]{\figs/proving-time.pdf}}
112 \setlength{\abovecaptionskip}{5pt}
113 \caption{Proving time of a steady batch (votes plus as many refreshes) and the resulting proving throughput, on one RTX 5090.}
114 \label{fig:proving-time}
115\end{figure}
116
117\paragraph{End-to-end throughput.} With two provers, each serving one sequencer that runs two elections of 2048 voters at $n_f = 2$ in batches of 512, the system proved and settled 8192 votes in $678.7$~s, a sustained throughput of $12.07$ votes per second ($724$ per minute), on a local chain with one-second blocks. Each prover was busy for the whole run, so throughput scales with the number of provers: one RTX 5090 settles about six votes per second at $n_f = 2$.
118
119\paragraph{On-chain verification.} Thanks to the succinctness of PlonK, verifying a batch proof costs an essentially constant amount of gas, independent of the number of ballots in the batch; the cost of a settlement grows only with the number of blobs, by one point evaluation each. In blob mode, measured with the same contracts on Gnosis Chain, which supports blobs, a settlement with one blob costs 0.40--0.44M gas and one with two blobs 0.46--0.50M gas. On OP Mainnet in L1-blob mode, verifying the L1 proof with three Ethereum headers costs 430K--460K gas, and a whole settlement 800K--860K gas.
120
121\paragraph{Data availability.} \Davinci publishes the data needed to reconstruct each state transition through EIP-4844 blobs. Compared with calldata, blobs substantially reduce data-availability costs by separating large protocol data from permanent Ethereum state. A blob holds 4096 cells; a steady batch needs $1 + \lceil 3n/4 \rceil + 4 n_f n$ cells for $n$ new votes and $n$ refreshes, so a batch of 128 votes at $n_f = 2$ fits in a single 128~KiB blob, while 512 votes at $n_f = 16$ need nine. In the measurements on OP Mainnet in L1-blob mode, in October 2026, posting the blobs of a batch cost 1.9--3.7~$\mu$ETH on Ethereum and settling it 0.04--0.05~$\mu$ETH on OP Mainnet, and batches settled 85--115~s after being sealed, a delay dominated by the time the rollup takes to adopt a new Ethereum block as its L1 origin.\\
122
123Together, these results indicate that \davinci scales to large elections at predictable settlement costs and practical proving times. Since proving dominates and parallelizes across provers and elections, throughput grows with the proving capacity of the sequencers, while the settlement chain only verifies one constant-size proof per batch.