arnaucube
arnaucube/davinci-paperPublic Self-hosted repository
minor fixes
bellesmarta belles.mm@gmail.com
Mon, 15 Dec 2025 11:16:18 +0100
commit

9c4db2b1edd52bee3b57a1106caf260f33829160

parent

774d3b87ee7095ee8dbced42054843f5be2e10fa

M v2/build/preamble-macros.tex → v2/build/preamble-macros.tex

@@ -113,6 +113,7 @@ \newcommand{\ballotcircuit}{\circuitstyle{BallotCircuit}}

\newcommand{\verifiercircuit}{\circuitstyle{VerifierCircuit}} \newcommand{\aggregationcircuit}{\circuitstyle{AggregationCircuit}} \newcommand{\statetransitioncircuit}{\circuitstyle{StateTransitionCircuit}} +\newcommand{\resultscircuit}{\circuitstyle{ResultsCircuit}} \newcommand{\publicinputs}{\circuitstyle{PI}} \newcommand{\witness}{\circuitstyle{witness}}

@@ -151,6 +152,7 @@ \newcommand{\ballotproof}{\variablestyle{ballotProof}}

\newcommand{\censusproof}{\variablestyle{censusProof}} \newcommand{\authenticationproof}{\variablestyle{authenticationProof}} \newcommand{\aggregationproof}{\variablestyle{aggregationProof}} +\newcommand{\resultsproof}{\variablestyle{resultsProof}} \newcommand{\voteid}{\variablestyle{voteID}} \newcommand{\ballot}{\variablestyle{ballot}} \newcommand{\vote}{\variablestyle{vote}}

@@ -173,6 +175,7 @@ %\newcommand{\path}{\variablestyle{path}}

\newcommand{\state}{\variablestyle{state}} \newcommand{\ballotmode}{\variablestyle{ballotMode}} \newcommand{\epk}{\variablestyle{encryptionKey}} +\newcommand{\decryptionkey}{\variablestyle{decryptionKey}} \newcommand{\addaccumulator}{\variablestyle{resultsAdd}} \newcommand{\substractaccumulator}{\variablestyle{resultsSub}} \newcommand{\addresses}{\variablestyle{addresses}}

@@ -208,9 +211,9 @@ \newcommand{\openproof}{\blobstyle{openingProof}}

% Cryptographic primitives \newcommand{\methodstyle}[1]{{\sf{#1}}\xspace} -\newcommand{\Keccak}{\methodstyle{Hash_1}} -\newcommand{\Poseidon}{\methodstyle{Hash_2}} -\newcommand{\Mimc}{\methodstyle{Hash_3}} +\newcommand{\Keccak}{\methodstyle{Keccak}} +\newcommand{\Poseidon}{\methodstyle{Poseidon}} +\newcommand{\Mimc}{\methodstyle{MiMC}} \newcommand{\Multimimc}{\methodstyle{MultiMiMC7}} \newcommand{\Enc}{\methodstyle{Enc}} \newcommand{\Dec}{\methodstyle{Dec}}
M v2/sections/background.tex → v2/sections/background.tex

@@ -8,7 +8,7 @@

The \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. \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)\roger{doesn't this clash with deduplication?}. Together, these features allow IPFS to function as a decentralized content delivery network. -In the context of the \davinci voting protocol, \ac{IPFS} is particularly useful for off-chain data distribution\pau{Mencionar IPFS està bé, es una peça important. Però potser caldria especificar que no es part del protocol. Que es una cosa de l'implementació i que en qualsevol moment es pot canviar a un altre storage layer.}. 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—anyone can fetch the dataset from \ac{IPFS} and recompute the hash to confirm its integrity—while keeping on-chain storage costs low. Sequencers\pau{We mention Sequencers here but they have not yet been introduced.} and voters can therefore rely on \ac{IPFS} to access the data required for generating and verifying Merkle proofs, without burdening the blockchain with large amounts of data. +In the context of the \davinci voting protocol, \ac{IPFS} is particularly useful for off-chain data distribution\pau{Consider removing IPFS}. 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—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. \subsection{Ethereum} \label{sec:background:ethereum}
M v2/sections/circuits.tex → v2/sections/circuits.tex

@@ -1,7 +1,6 @@

% !TeX root = ../build/main.tex -At the core of \davinci lie a set of arithmetic circuits that enforce the correctness of every step of the election. Each circuit corresponds to a distinct task and, taken together, they guarantee that all protocol rules are satisfied without revealing any private information. Specifically, the \emph{ballot circuit} (Section~\ref{sec:vocdoni-protocol:circuits:ballot}) ensures that encrypted votes are valid and well-formed, the \emph{verifier circuit} (Section~\ref{sec:vocdoni-protocol:circuits:verifier}) verifies the voter's census membership; the \emph{aggregation circuit} (Section~\ref{sec:vocdoni-protocol:circuits:aggregation}) combines multiple authenticated votes into a single proof; and the \emph{state transition circuit} (Section~\ref{sec:vocdoni-protocol:circuits:state-transition}) updates the global state root and produces the \ac{ZK-SNARK} proof that is verified on-chain. The flow of these circuits and their interactions is shown in Figure~\ref{fig:circuits-flow}. {\color{blue}Add \textit{results} circuit.} - +At the core of \davinci lie a set of arithmetic circuits that enforce the correctness of every step of the election. Each circuit corresponds to a distinct task and, taken together, they guarantee that all protocol rules are satisfied without revealing any private information. Specifically, the \emph{ballot circuit} (Section~\ref{sec:vocdoni-protocol:circuits:ballot}) ensures that encrypted votes are valid and well-formed, the \emph{verifier circuit} (Section~\ref{sec:vocdoni-protocol:circuits:verifier}) verifies the voter's census membership; the \emph{aggregation circuit} (Section~\ref{sec:vocdoni-protocol:circuits:aggregation}) combines multiple authenticated votes into a single proof; the \emph{state transition circuit} (Section~\ref{sec:vocdoni-protocol:circuits:state-transition}) updates the global state root and produces the \ac{ZK-SNARK} proof that is verified on-chain; and the \textit{results circuit} (Section~\ref{sec:vocdoni-protocol:circuits:results}) proves that the election results were computed correctly. The flow of these circuits and their interactions is shown in Figure~\ref{fig:circuits-flow}. \begin{figure}[h] \centerline{\includegraphics[width=\linewidth,draft=false]{\figs/circuits-flow.pdf}} \caption{

@@ -9,7 +8,7 @@ Overview of the circuit flow in \davinci.}

\label{fig:circuits-flow} \end{figure} -For clarity, the circuits are described in this section with their full set of public inputs explicitly listed. In the actual implementation, however, we apply an optimization: rather than exposing all public inputs $PI$ individually, we compute a single commitment $h = Hash(PI)$ and use $h$ as the only public input. The proof verifier then checks that $Hash(PI) = h$, ensuring that the original public inputs are consistent while reducing both proof size and verification cost. In \davinci, this commitment is computed using the MiMC-7 hash function {\color{blue}(use hlget to point "Hash" to MiMC-7)}. Note that this optimization does not alter the semantics of the circuits but significantly reduces verifier complexity and on-chain verification costs. Other implementation aspects such as the exact number of constraints and the proving frameworks used are deferred to Section~\ref{sec:analysis:implementation}. +For clarity, the circuits are described in this section with their full set of public inputs explicitly listed. In the actual implementation, however, we apply an optimization: rather than exposing all public inputs $\publicinputs$ individually, we compute a single commitment $h = \hlget{\Mimc}(\publicinputs)$ and use $h$ as the only public input. The proof verifier then checks that $\hlget{\Mimc}(\publicinputs) = h$, ensuring that the original public inputs are consistent while reducing both proof size and verification cost. Note that this optimization does not alter the semantics of the circuits but significantly reduces verifier complexity and on-chain verification costs. Other implementation aspects such as the exact number of constraints and the proving frameworks used are deferred to Section~\ref{sec:analysis:implementation}. % Old text: By structuring the process this way, we ensure that voting can be performed from any device-including smartphones and web browsers-while keeping the sequencer's computational requirements within the capabilities of accessible, CPU-based machines with 64 GiB of memory.

@@ -37,9 +36,11 @@ \item \private $k$: random scalar.

\end{itemize} \textbf{Constraints} \begin{itemize} - \item \emph{Vote encryption}. Correct encryption of the ballot: $\encryptedballot = \hlget{\Enc}_{\epk}(\ballot; k).$ - \item \emph{Protocol rules compliance}. The ballot meets the protocol rules (number of valid choices, etc.): $... + \weight$. - \item \emph{Vote identifier}. The vote's identifier is correctly computed: $\voteid = \text{Hash} (\processid \conc \address \conc k).$ + \item \emph{Vote encryption}. Correct encryption of the ballot: \[\encryptedballot = \hlget{\Enc}_{\epk}(\ballot; k).\] + \item \emph{Protocol rules compliance}. The ballot meets the protocol rules (number of valid choices, etc.): + \[\text{protocolRulesCompliance}(\ballotmode, \weight, \ballot) = \true.\] + \item \emph{Vote identifier}. The vote's identifier is correctly computed: + \[\voteid = \text{Hash} (\processid \conc \address \conc k).\] \end{itemize} \vspace{-0.3cm} \end{spacing}

@@ -234,6 +235,8 @@ \end{landscape}

\subsubsection{Results circuit} \label{sec:vocdoni-protocol:circuits:results} + +The results circuit (\hlset{\resultscircuit}) proves that... . \begin{figure}[h] \centerline{\includegraphics[width=400pt,draft=false]{\figs/circuit5.pdf}}
M v2/sections/introduction.tex → v2/sections/introduction.tex

@@ -12,12 +12,10 @@

\subsection{Contributions} \label{sec:introduction:contributions} -This work introduces \davinci, a modular and verifiable protocol for digital voting, designed to support privacy-preserving, auditable, and adaptable election processes across diverse governance contexts\roger{consider adding "meeting the most demanding democratic standards"}. The protocol models voting as a constrained state machine, in which each valid operation is expressed as a formally defined state transition, enforced through succinct \ac{ZK} proofs\pau{Molt bona aquesta definició! Tindria sentit fer algun tipus de highlighting? negreta o similar?}. That is, at the core of the system lies a set of reusable arithmetic circuits that implement voter authentication, encrypted ballot validation, state transitions, and tally finalization. These circuits are optimized for off-chain proving and are compatible with modern \ac{ZK-SNARK} protocols. Application-layer state is maintained off-chain and committed on-chain using cryptographic accumulators, specifically Merkle trees. +This work introduces \davinci, a modular and verifiable protocol for digital voting, designed to support privacy-preserving, auditable, and adaptable election processes across diverse governance contexts. The protocol \textit{models voting as a constrained state machine}, in which each valid operation is expressed as a formally defined state transition, enforced through succinct \ac{ZK} proofs. That is, at the core of the system lies a set of reusable arithmetic circuits that implement voter authentication, encrypted ballot validation, state transitions, and tally finalization. These circuits are optimized for off-chain proving and are compatible with modern \ac{ZK-SNARK} protocols. Application-layer state is maintained off-chain and committed on-chain using Merkle trees as cryptographic accumulators. %The protocol defines two such trees: one for the voter registry (the census) and one for the voting state. These trees enable voters and verifiers to produce efficient inclusion and transition proofs, while minimizing on-chain storage and computation. -\paui{Potser es pot fer un rephrasing aquí pq no es repeteixi tant amb el paràgraf anterior.} - -To coordinate protocol execution over a decentralized network of nodes, \davinci includes a set of Ethereum smart contracts that mediate the setup of elections, manage finalization procedures, and verify submitted proofs of correctness. A standardized transaction and data encoding format supports all stages of the process, including vote casting, aggregation\roger{consider specifying what is aggregated: "ballots aggregation", "votes aggregation", etc.}, and result publication. This approach ensures that protocol interactions remain deterministic and interoperable across clients and backends. The system also introduces the Vocdoni token, which is used to align incentives between participants. Altogether, the design aims to balance auditability and privacy while reducing trust assumptions on infrastructure providers. By cleanly separating functionalities and providing modular interfaces, the protocol is intended to serve as a foundation for both practical deployments and future extensions, such as integration with alternative identity systems, off-chain data availability layers, or other consensus backends. +To coordinate protocol execution over a decentralized network of nodes, \davinci includes a set of Ethereum smart contracts that mediate the setup of elections, manage finalization procedures, and verify submitted proofs of correctness. A standardized transaction and data encoding format supports all stages of the process, including vote casting, ballots aggregation, and result publication. This approach ensures that protocol interactions remain deterministic and interoperable across clients and backends. The system also introduces the Vocdoni token, which is used to align incentives between participants. Altogether, the design aims to balance auditability and privacy while reducing trust assumptions on infrastructure providers. By cleanly separating functionalities and providing modular interfaces, the protocol is intended to serve as a foundation for both practical deployments and future extensions, such as integration with alternative identity systems, off-chain data availability layers, or other consensus backends. \begin{itemize} \item The Vocdoni voting protocol.
M v2/sections/protocol-flow.tex → v2/sections/protocol-flow.tex

@@ -42,8 +42,7 @@

\noi \textbf{(a) Vote casting.} To cast a ballot, a voter does the following: \begin{enumerate} - {\color{red} - \item Select a sequencer from the sequencer registry smart contract.} + \item Select a sequencer. \item Retrieve their census membership proof $\censusproof$ to prove eligibility. \item Fetch parameters $\epk$, $\ballotmode$, and $\processid$ from the \hlget{\electionregistry} smart contract. \item Select their ballot choice $\ballot$ according to the rules of $\ballotmode$.

@@ -144,20 +143,30 @@

\subsubsection{Decryption key generation} \label{sec:vocdoni-protocol:deckey-gen} +{\color{blue} After the voting period expires, $t$ out of $n$ sequencers publish their decryption shares of the election private key. Once the threshold is reached, the election secret key can be reconstructed (on-chain or off-chain), enabling the decryption of the aggregated tally. + +Rewards and penalties for sequencers are managed according to their correct participation: sequencers are rewarded proportionally to the number of votes sequenced, and may be slashed for failing to provide a valid decryption share (see Seciton~\ref{sec:token} for details on incentivation mechanisms.)} + + \subsubsection{Tally finalization} \label{sec:vocdoni-protocol:results} -{\color{blue} After the voting period expires, $t$ out of $n$ sequencers publish their decryption shares of the election private key. Once the threshold is reached, the election secret key can be reconstructed (on-chain or off-chain), enabling the decryption of the aggregated tally. +In this final phase, the organizer/a sequencer computes the tally and publishes the result, together with a proof of its correct computation, on-chain. -Rewards and penalties for sequencers are managed according to their correct participation: sequencers are rewarded proportionally to the number of votes sequenced, and may be slashed for failing to provide a valid decryption share (INCENTIVATION MECHANISM). +\begin{enumerate} + \item Retrieve $\decryptionkey$ from \dots. + \item ... + \item Use \resultscircuit from Section~\ref{sec:vocdoni-protocol:circuits:results} to generate a proof + \begin{align*} + \resultsproof = \hlget{\PProve}(\hlget{\resultscircuit}, + \witness = (...), + \publicinputs = (...)). + \end{align*} +\end{enumerate} -At this point: -\begin{itemize} - \item Anyone can verify the correctness of the final results by checking the \ac{ZK-SNARK} state proofs and on-chain commitments. - \item The combination of the final state root, the decryption of the accumulators, and the publicly verifiable \ac{ZK-SNARK} proofs guarantees the integrity of the entire election. -\end{itemize} +The election is considered finalized once the decrypted tally is available on-chain. At this stage, both the election results and the complete integrity of the process are permanently recorded and publicly auditable. -The election is considered finalized once the decrypted tally is available and all state transition proofs have been verified on-chain. At this stage, both the election results and the complete integrity of the process are permanently recorded and publicly auditable.} +{\color{blue} Note that, anyone can verify the correctness of the final results by checking the \ac{ZK-SNARK} state proofs and on-chain commitments. Moreover, the combination of the final state root, the decryption of the accumulators, and the publicly verifiable \ac{ZK-SNARK} proofs guarantees the integrity of the entire election.} \begin{figure}%[H] \centerline{\includegraphics[width=370pt,draft=false]{\figs/protocol-flow.pdf}}