davinci-paper/v2/sections/background.tex
v2/sections/background.texRaw
1% !TeX root = ../build/main.tex
2
3The \davinci protocol builds on several decentralized technologies and advanced cryptographic tools. In this section, we give a high-level overview of these components and their role in the system. We first introduce the \ac{IPFS}, which serves as a decentralized storage layer for distributing large datasets off-chain. We then describe Ethereum, the settlement layer where commitments are published, rules are enforced through smart contracts, and state data is managed using recent mechanisms such as data blobs. Finally, we present the \ac{ZK} proof systems that underpin the protocol’s integrity and security, focusing on \acp{ZK-SNARK} and arithmetic circuits, which allow participants to prove compliance with protocol rules without revealing sensitive information.
4
5\subsection{Interplanetary file system}
6\label{sec:background:ipfs}
7
8The \acf{IPFS} is a peer-to-peer distributed storage network designed to make the web more resilient, permanent, and decentralized. Unlike traditional client-server architectures that retrieve data from a specific location (e.g., a URL pointing to a server), \ac{IPFS} retrieves data based on its content. Every file stored in \ac{IPFS} is split into blocks, each block is hashed, and the resulting cryptographic hash is used as its unique identifier. This property, known as content addressing, ensures that data is tamper-evident: if the file changes, so does its hash.
9\ac{IPFS} also provides deduplication (the same content is only stored once across the network), versioning (content identifiers can point to immutable snapshots of data), and distributed availability (data can be fetched from any node that stores it). Together, these features allow IPFS to function as a decentralized content delivery network.
10
11In the context of the \davinci voting protocol, \ac{IPFS} is particularly useful for off-chain data distribution. Large datasets such as the full census (eligible voters and their weights) and election metadata (which may include questions, options, images, etc.) do not need to be stored directly on Ethereum. Instead, they are stored in \ac{IPFS}, and only their content hashes are published on-chain. This approach ensures transparency and verifiability, as anyone can fetch the dataset from \ac{IPFS} and recompute the hash to confirm its integrity, while keeping on-chain storage costs low. That is, election participants can therefore rely on \ac{IPFS} to access the data without burdening the blockchain with large amounts of data.
12
13\subsection{Ethereum}
14\label{sec:background:ethereum}
15
16Ethereum is a decentralized blockchain platform that supports programmable transactions through its built-in execution environment, the \acf{EVM}. All interactions with the Ethereum network take the form of transactions, which must be broadcast to the network, validated by consensus, and permanently recorded on-chain. Every transaction requires the payment of a fee (gas), denominated in ETH, to compensate validators for computation and storage. This fee model ensures that resources are used efficiently and prevents denial-of-service attacks by making large or complex operations costly. In the context of \davinci, Ethereum serves as the settlement layer where critical commitments are published, ensuring transparency and immutability.
17
18\paragraph{Smart contracts.} Smart contracts are programs deployed on the Ethereum blockchain that execute deterministically in response to transactions. Once deployed, they cannot be altered, and their execution is guaranteed by the consensus of the network. In \davinci, smart contracts orchestrate the election by managing state transitions and storing critical data such as the current state root and the encryption public key. They enforce the protocol rules in a trustless environment, ensuring that no single participant can manipulate the election. By anchoring these rules in Ethereum smart contracts, \davinci guarantees that the election logic is applied consistently and verifiably across all participants.
19
20\paragraph{Data blobs.} Data availability is a key requirement for decentralized protocols. Ethereum’s recent EIP-4844~\cite{eip4844} introduces data blobs as a mechanism for publishing large volumes of off-chain data alongside transactions at a lower cost than traditional storage. These blobs are kept on-chain for 4096 epochs, approximately 18 days, after which they are pruned. For longer election periods, third-party solutions based on EIP-4844 can be used to extend data availability~\cite{todocitation}. In \davinci, sequencers use data blobs to share state transition data efficiently. By publishing state updates in blobs, sequencers allow other participants to reconstruct and verify the evolution of the election without overloading Ethereum’s permanent storage. This ensures scalable, decentralized data availability while retaining verifiability.
21
22
23\subsection{Merkle trees}
24\label{sec:background:mt}
25
26Merkle trees~\cite{merkle1987digital} are cryptographic hash trees that enable compact proofs of data inclusion. Formally, a Merkle tree is a binary tree structure where each leaf node represents the cryptographic hash of a set of data and every non-leaf node is derived from the hash of its children. The apex of the tree, the \textit{Merkle root}, acts as a succinct cryptographic commitment to the entire dataset.
27%This structure allows for efficient membership verification.
28To prove that a specific element $x$ exists within the set, a prover provides a Merkle path consisting of the sibling nodes along the path from the leaf to the root. A verifier can reconstruct the root in logarithmic time $O(\log n)$ and check it against the committed state, without requiring access to the full dataset. In \davinci, we use two specialized variants of this structure to commit critical data: a sparse Merkle tree for the voting state and an incremental Merkle tree for the voter registry (census).
29
30\paragraph{Sparse Merkle trees.}
31
32A \ac{SMT} represents a key-value map where each leaf is the hash of a (key, value) pair and each parent node is the hash of its two children. In an \ac{SMT}, every possible key maps to a unique leaf position (with empty slots defaulting to a zero value), yielding a fixed-height binary tree. This property is circuit-friendly, since the proof of a leaf’s membership or non-membership has a consistent length and can be efficiently verified inside a \ac{ZK-SNARK} circuit using a SNARK-optimized hash. In \davinci, the state tree is implemented as an \ac{SMT} of fixed depth. In particular, configuration parameters occupy reserved leaf addresses, each voter’s encrypted ballot is stored at a leaf indexed by their unique identifier, and each one-time vote identifier is recorded at a dedicated leaf path. Because the \ac{SMT} covers a vast key space, a user or sequencer can prove that a given key is present in the state (or conversely, that it remains empty) by providing a short Merkle proof against the tree’s root, rather than revealing the entire state. This enables compact proofs of state correctness. For instance, showing in ZK that a vote identifier has not appeared before or that a new ballot’s ciphertext is correctly inserted into the state. The \ac{SMT} used in \davinci follows the circomlib Merkle tree specification (Poseidon-based)~\cite{todocitation}, ensuring that state updates can be verified succinctly on-chain via the Merkle root and proof.
33
34\paragraph{Incremental Merkle trees.}
35
36The census (voter registry) is maintained with an \ac{IMT}, a binary Merkle tree designed for efficient sequential updates~\cite{todocitation}. Unlike a sparse tree, the \ac{IMT} grows in height only as needed with the number of leaves and eliminates the overhead of hashing dummy ``zero'' siblings. In this scheme, voters are assigned sequential leaf indices in a continuously evolving tree, rather than being placed at cryptographic key-derived positions. In \davinci, the census Merkle tree is built as an \ac{IMT}: each eligible voter’s identifier (or a commitment to it) and voting weight are stored in the next available leaf, and only the Merkle root of this tree (the \censusroot) is published on-chain. This design makes membership updates and proof generation extremely low-cost for the census. Appending a new voter requires recomputing hashes only along the single path from the new leaf to the root, and the tree’s depth adjusts optimally (e.g. a tree of N voters has height $\approx \log_2{N}$, instead of a fixed large height). Consequently, proving one’s inclusion in the voter list is more efficient than it would be with an SMT: the Merkle proof is shorter and involves no unnecessary default nodes. A voter can thus obtain a small proof of their membership in the census (their leaf’s existence under the known root) without revealing their index or identity, and include this in a \ac{ZK-SNARK} to demonstrate eligibility. In summary, the \ac{IMT}’s focus on sequential insertion and minimal hashing overhead makes it well-suited for the frequently-updated census tree, offering better update performance and smaller circuits for verification than a traditional \ac{SMT} structure in this context.
37
38\subsection{Zero-knowledge proofs}
39\label{sec:background:zkp}
40
41Zero-knowledge (ZK) proofs are cryptographic protocols that allow one party (the prover) to convince another (the verifier) that a certain statement is true, without revealing any information beyond the validity of the statement itself. In the context of voting, this enables participants to prove that their encrypted ballot is well-formed and complies with the election rules, without disclosing their actual choice.
42
43\paragraph{\Acp{ZK-SNARK}.}
44We focus on a specific type of proof system called zero-knowledge succinct non-interactive arguments of knowledge (\acsp{ZK-SNARK}).
45%, which are particularly suited for blockchain settings.
46Informally, while a \ac{ZK} proof convinces the verifier that a valid witness exists, an argument of knowledge additionally ensures that the prover actually knows such a witness, except with negligible probability. \acsp{ZK-SNARK} extend this notion with two crucial properties: they are non-interactive, requiring only a single message from prover to verifier, and succinct, meaning that proof size and verification cost remain small regardless of the size of the underlying statement. For instance, Groth16 proofs~\cite{groth2016size}, which rely on pairing-based cryptography over elliptic curves, %to achieve short proofs and fast verification [Gro16, GWC19].
47are only about 200 bytes long and can be verified in a few milliseconds. These properties make \acsp{ZK-SNARK} particularly well-suited for blockchain applications, where verification cost and data size are critical. In \davinci, \acsp{ZK-SNARK} are used at multiple stages of the protocol: voters generate proofs to show that their encrypted ballots are correct and sequencers use recursive \acsp{ZK-SNARK} to allow multiple proofs to be aggregated efficiently and generate proofs to attest to valid state transitions. In essence, \acsp{ZK-SNARK} enable both voters and sequencers to produce compact proofs that can be checked on-chain, ensuring that all protocol rules are followed without requiring trust in any party.
48
49\paragraph{Trusted setup.}
50A limitation of some \ac{ZK-SNARK} protocols is their reliance on a \ac{CRS} generated during a so-called trusted setup. The \ac{CRS} is built from random values that must not be known to either the prover or the verifier. To achieve this, the \ac{CRS} can be created by a trusted third party or, more robustly, via a secure \ac{MPC} protocol \cite{canetti2001universally}. In an MPC setup, it suffices that at least one participant discards their secret contribution to ensure the integrity of the whole ceremony. {\color{blue}For \davinci, we run an \ac{MPC} for each of the circuits, see Section~\ref{sec:analysis:implementation} and Appendix~\ref{sec:cryptographic-primitives:zkp}.}
51% By anchoring these proofs on Ethereum, the protocol ensures that every step of the voting process is publicly verifiable, while preserving voter privacy.
52
53%In general, zk-SNARKs for circuit satisfiability (CSAT) require arithmetic circuits to be expressed in a more algebraic form. A common representation is the rank-1 constraint system (R1CS) [GGPR13], which encodes computations as a set of quadratic constraints. A zk-SNARK proof then demonstrates, without revealing any private values, that the prover knows an assignment to all wires of the circuit that satisfies the R1CS. Tooling such as circom provides a high-level language to write arithmetic circuits while still exposing full control over the signals and constraints of the resulting R1CS.
54
55\paragraph{Arithmetic circuits.} In general, \acsp{ZK-SNARK} operate by proving the satisfiability of an arithmetic circuit.
56An arithmetic circuit (from now on also called circuit or \ac{ZK} circuit) is a directed acyclic graph where nodes represent addition or multiplication gates over a finite field. The inputs and outputs of the circuit correspond to the public inputs and private witnesses of the computation, while the intermediate wires carry intermediate values. Any deterministic computation, from verifying an encryption to checking Merkle proofs, can be compiled into an arithmetic circuit \cite{gennaro2013quadratic}.
57%The most widely studied language in the context of ZK-SNARK proofs is the NP-complete language of circuit satisfiability [BCC+ 16, PHGR13, BSCTV14b].
58%zk-SNARKs prove statements about the satisfiability of arithmetic circuits. An arithmetic circuit is a directed acyclic graph consisting of addition and multiplication gates defined over a finite field. Such circuits are a convenient model for computation: any program or verification logic can be compiled into an arithmetic circuit, with its inputs, outputs, and intermediate constraints expressed as field operations.
59In practice, proving with \acsp{ZK-SNARK} means showing knowledge of a secret witness (e.g., a plaintext ballot or encryption randomness) that satisfies all the equations encoded in the circuit. For example, the ballot circuit in \davinci encodes the constraints that a ciphertext is well-formed, that the vote identifier is correctly derived, and that the ballot complies with the rules of the voting mode. The prover generates a proof of satisfiability, while the verifier only checks the proof against the public inputs, without learning the secret witness.
60By building complex protocol logic from arithmetic circuits, and using \acsp{ZK-SNARK} to prove their satisfiability, \davinci ensures that every step of the election process, from ballot submission to state transitions, is enforced cryptographically and publicly verifiable. % is verifiable in zero-knowledge.
61
62%In \davinci, arithmetic circuits form the backbone of all zk-SNARK proofs: voters use them to generate ballot proofs, sequencers use them to prove state transitions, and aggregation circuits recursively combine multiple proofs. Together, these circuits ensure that every step of the protocol is enforced cryptographically and can be verified succinctly on-chain.
63
64%The gates of an arithmetic circuit consist on additions and multiplications modulo p, where p is typically a large prime number of approximately 254 bits [WBB20]. The wires of an arithmetic circuit, often called signals, can carry any value from the prime finite field Fp. As with electronic circuits, depending on how signals are connected to the gates, we can distinguish between input, intermediate, and output signals. Usually, there is a set of public signals known both to prover and verifier, and the prover proves that, with that public information, he knows a valid assignment to the rest of signals that makes the circuit satisfiable. From now on, we extend the meaning of the word witness to an assignment to all signals of a the circuit, both public and private.
65
66%High-level languages such as Circom compile developer-written code into R1CS constraints, giving developers both expressiveness and fine-grained control. In \davinci, arithmetic circuits form the backbone of all zk-SNARK proofs: voters use them to generate ballot proofs, sequencers use them to prove state transitions, and aggregation circuits recursively combine multiple proofs. Together, these circuits ensure that every step of the protocol is enforced cryptographically and can be verified succinctly on-chain.