update smart contracts + election terminology
jump to
@@ -41,12 +41,10 @@ \thispagestyle{plain}
%\addcontentsline{toc}{section}{\protect\numberline{}Abstract} \begin{abstract} - \Davinci is the evolution of the Vocdoni voting protocol, designed to empower civil society by providing essential tools for secure, verifiable, and anonymous digital voting. Using recent advancements in \ac{ZK} proof systems and blockchain technology, \davinci transitions to a specialized \ac{ZK} roll-up system that inherits network security from settlement layers such as the Ethereum mainnet. The system relies on cryptographic proofs to ensure integrity and security, eliminating the need for centralized authorities. By integrating \acsp{ZK-SNARK} and threshold homomorphic encryption, \davinci enables end-to-end verifiability, privacy, and trustlessness in the voting process. The protocol employs distributed key generation among sequencers, coordinated through Ethereum smart contracts, and uses Ethereum data blobs for data availability. With a focus on accessibility, scalability, receipt-freeness, and automation, \davinci aims to facilitate high-frequency and low-cost voting, fostering mass adoption of voting and simplifying civil participation. Moreover, the introduction of the Vocdoni token aligns incentives among participants, ensuring the system's sustainability and enabling decentralized governance. + \Davinci is the evolution of the Vocdoni voting protocol, designed to empower civil society by providing essential tools for secure, verifiable, and anonymous digital voting. Using recent advancements in \ac{ZK} proof systems and blockchain technology, \davinci transitions to a specialized \ac{ZK} roll-up system that inherits network security from settlement layers such as the Ethereum mainnet. The system relies on cryptographic proofs to ensure integrity and security, eliminating the need for centralized authorities. By integrating \acsp{ZK-SNARK} and threshold homomorphic encryption, \davinci enables end-to-end verifiability, privacy, and trustlessness in election processes. The protocol employs distributed key generation among sequencers, coordinated through Ethereum smart contracts, and uses Ethereum data blobs for data availability. With a focus on accessibility, scalability, receipt-freeness, and automation, \davinci aims to facilitate high-frequency and low-cost voting, fostering mass adoption of voting and simplifying civil participation. Moreover, the introduction of the Vocdoni token aligns incentives among participants, ensuring the system's sustainability and enabling decentralized governance. % Finally, the design of \davinci is grounded in practicality; All components are implemented using current technologies and have undergone proof-of-concept testing. %This ensures that In sum, the proposed architecture is not merely theoretical, but a viable solution ready for short-term deployment. The source code has been made open source, allowing practitioners and researchers to further investigate its details and potential for future uses. - -% \freefootnote{\scriptsize{Authors are listed in alphabetical order (\url{https://www.ams.org/profession/leaders/CultureStatement04.pdf}).}} \end{abstract} {\color{blue}\fbox{\parbox{0.93\textwidth}{
@@ -179,6 +179,14 @@ % Hyperlinks
\newcommand{\hlset}[1]{\hypertarget{\detokenize{#1}}{#1}} \newcommand{\hlget}[1]{\hyperlink{\detokenize{#1}}{#1}} +% Smart contracts +\newcommand{\smartcontractstyle}[1]{{\sf{#1}}\xspace} +\newcommand{\orgregistry}{\smartcontractstyle{OrganizationRegistry}} +\newcommand{\electionregistry}{\smartcontractstyle{ElectionRegistry}} +\newcommand{\dkgmanagement}{\smartcontractstyle{KeyManagement}} +\newcommand{\statetransitionverifier}{\smartcontractstyle{StateTransitionVerifier}} +\newcommand{\resultsverifier}{\smartcontractstyle{ResultsVerifier}} + % Cryptographic primitives \newcommand{\methodstyle}[1]{{\sf{#1}}\xspace} \newcommand{\Keccak}{\methodstyle{Hash_1}}
@@ -15,9 +15,9 @@ \label{sec:background:ethereum}
Ethereum 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. -\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 voting process 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 process. By anchoring these rules in Ethereum smart contracts, \davinci guarantees that the election logic is applied consistently and verifiably across all participants. +\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. -\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 voting process without overloading Ethereum’s permanent storage. This ensures scalable, decentralized data availability while retaining verifiability. +\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. \subsection{Zero-knowledge proofs} \label{sec:background:zkp}
@@ -1,8 +1,6 @@
% !TeX root = ../build/main.tex -\rogeri{consider using paragraph as in S5.3 "Smart contracts" for readability} - -At the core of \davinci lie a set of arithmetic circuits that enforce the correctness of every step of the voting process. 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}. +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}. \begin{figure}[h] \centerline{\includegraphics[width=\linewidth,draft=false]{\figs/circuits-flow-v2}}@@ -24,7 +22,7 @@ \begin{spacing}{1.25}
\vspace{0.3cm} \noi \textbf{Public inputs} \begin{itemize} - \item $\public$ $\processid$: voting process identifier. + \item $\public$ $\processid$: election identifier. \item $\public$ $\ballotmode$: ballot protocol configuration. \item $\public$ $\epk$ ($EPK$): encryption public key. \item $\public$ $\address$: voter's address.@@ -61,7 +59,7 @@ \begin{spacing}{1.25}
\vspace{0.3cm} \noi \textbf{Public inputs} \begin{itemize} - \item \public $\processid$: process identifier. + \item \public $\processid$: election identifier. \item \public $\ballotmode$: ballot protocol configuration. \item \public $\epk$ ($EPK$): encryption public key. \item \public $(C_1, C_2)$: encrypted ballot.@@ -97,7 +95,7 @@
\subsubsection{Aggregation circuit} \label{sec:vocdoni-protocol:circuits:aggregation} -The aggregation circuit, illustrated in Figure~\ref{fig:circuit-aggregate}, is generated by the sequencer to combine multiple authenticated votes into a single proof. Its purpose is to reduce verification overhead by recursively aggregating individual authentication proofs, while ensuring that all aggregated votes belong to the same voting process. The batch size, i.e., the maximum number of proofs aggregated in a single execution, is a fixed parameter (currently set to 60). If fewer proofs are available, the sequencer pads the batch with dummy proofs so that the circuit always operates on a fixed-size input. The correctness of this circuit is attested by a ZK proof generated using the \ac{ZK-SNARK} protocol described in Section~\ref{sec:cryptographic-primitives:zkp}, instantiated over the BW6-761 curve. We call the resulting proof the \textit{aggregation proof} and denote it as $\hlset{\aggregationproof}$. We detail below the inputs and constraints of the aggregation circuit. +The aggregation circuit, illustrated in Figure~\ref{fig:circuit-aggregate}, is generated by the sequencer to combine multiple authenticated votes into a single proof. Its purpose is to reduce verification overhead by recursively aggregating individual authentication proofs, while ensuring that all aggregated votes belong to the same election. The batch size, i.e., the maximum number of proofs aggregated in a single execution, is a fixed parameter (currently set to 60). If fewer proofs are available, the sequencer pads the batch with dummy proofs so that the circuit always operates on a fixed-size input. The correctness of this circuit is attested by a ZK proof generated using the \ac{ZK-SNARK} protocol described in Section~\ref{sec:cryptographic-primitives:zkp}, instantiated over the BW6-761 curve. We call the resulting proof the \textit{aggregation proof} and denote it as $\hlset{\aggregationproof}$. We detail below the inputs and constraints of the aggregation circuit. \begin{spacing}{1.25} \vspace{0.3cm}@@ -106,7 +104,7 @@ \begin{itemize}
\item \public $(C_1, C_2)_i$: list of voters' encrypted ballots. \item \public $\voteid_i$: set of vote's identifiers. \item \public $\pk_i$: list of voters' public keys. - \item \public $\processid$: process identifier. + \item \public $\processid$: election identifier. \item \public $\ballotmode$: ballot protocol configuration. \item \public $EPK$: encryption public key. \item \public $\censusroot$: census Merkle tree root.@@ -133,7 +131,7 @@
\subsubsection{State transition circuit} \label{sec:vocdoni-protocol:circuits:state-transition} -The state transition circuit, illustrated in Figure~\ref{fig:circuit-state-transition-v2}, is generated by the sequencer to update the global state of the voting process. Its purpose is to verify that a batch of aggregated votes has been correctly incorporated into the state Merkle tree, that overwrites and vote identifiers are handled consistently, and that the accumulators of encrypted results are updated accordingly. The correctness of this circuit is attested by a \ac{ZK} proof generated using the \ac{ZK-SNARK} protocol described in Section~\ref{sec:cryptographic-primitives:zkp}, instantiated over the BN254 curve, which is supported by Ethereum’s native precompiles for proof verification. We call the resulting proof the \textit{state proof} and denote it as $\hlset{\stateproof}$. This proof is submitted on-chain and verified by the process management smart contract, ensuring that every accepted state transition complies with the protocol rules. +The state transition circuit, illustrated in Figure~\ref{fig:circuit-state-transition-v2}, is generated by the sequencer to update the global state of the election. Its purpose is to verify that a batch of aggregated votes has been correctly incorporated into the state Merkle tree, that overwrites and vote identifiers are handled consistently, and that the accumulators of encrypted results are updated accordingly. The correctness of this circuit is attested by a \ac{ZK} proof generated using the \ac{ZK-SNARK} protocol described in Section~\ref{sec:cryptographic-primitives:zkp}, instantiated over the BN254 curve, which is supported by Ethereum’s native precompiles for proof verification. We call the resulting proof the \textit{state proof} and denote it as $\hlset{\stateproof}$. This proof is submitted on-chain and verified by the process management smart contract, ensuring that every accepted state transition complies with the protocol rules. To formalize the setting, let the sequencer collect a batch of $N$ votes ($N<60$), of which $n$ are new submissions and $m = N-n$ are overwrites of previously cast ballots. In the following, we describe the inputs and constraints of the state transition circuit in detail.@@ -156,7 +154,7 @@ \item \private $\{\aggregationproof_i\}_{i= 1}^{N}$: set of aggregation proofs.
\item \private $\censusroot$: census Merkle tree root. \item \private $\ballotmode$: ballot protocol configuration. \item \private $EPK$: encryption public key. - \item \private $\processid$: process identifier. + \item \private $\processid$: election identifier. \item \private $\{\voteid_i\}_{i= 1}^{N}$: set of vote's identifiers. \item \private $\{(C_1, C_2)_i\}_{i= 1}^{N}$: set of voters' encrypted ballots. \item \private $\{\pk_i\}_{i= 1}^{N}$: list of voters' public keys.
@@ -388,7 +388,7 @@
\subsection{Zero-knowledge proof systems} \label{sec:cryptographic-primitives:zkp} -{Zero-knowledge succinct non-interactive arguments of knowledge (ZK-SNARKs)} are a crucial component in ensuring the integrity of the voting process. Voters generate ZK-SNARK proofs to demonstrate that their encrypted ballots comply with the rules and constraints defined by the election parameters, without revealing any information about their choices. Similarly, sequencers produce proofs to certify the correctness of vote aggregation and state transitions throughout the protocol. {\color{blue}\hlset{\PProve}(), \hlset{\PVerify}(proof, PI) -- pkey, vkey.} +{Zero-knowledge succinct non-interactive arguments of knowledge (ZK-SNARKs)} are a crucial component in ensuring the integrity of the election. Voters generate ZK-SNARK proofs to demonstrate that their encrypted ballots comply with the rules and constraints defined by the election parameters, without revealing any information about their choices. Similarly, sequencers produce proofs to certify the correctness of vote aggregation and state transitions throughout the protocol. {\color{blue}\hlset{\PProve}(), \hlset{\PVerify}(proof, PI) -- pkey, vkey.} All ZK circuits in \davinci are compiled using the Groth16 proof system~\cite{groth2016size}, a widely adopted ZK-SNARK construction known for its succinctness, efficient verification, and minimal proof size. Although all circuits rely on the same proving system, they are instantiated with different elliptic curves depending on the cryptographic requirements of each phase. Specifically, the vote validity circuit is compiled over the BN254 curve, the census-related circuit uses BLS12-377, and the aggregation circuit is instantiated over BW6-761. Finally, the last circuit used by the sequencer—responsible for generating the final proof of correct tallying and result—is compiled over BN254 as well, since this is the proof that is verified on-chain by the smart contract using Ethereum’s native precompiles. Further details on the circuits are provided in Section~\ref{sec:vocdoni-protocol:circuits} and a summary of the instantiations can be found in Figure~\ref{fig:circuits-flow}.
@@ -12,7 +12,7 @@
\subsubsection{Census tree} \label{sec:vocdoni-protocol:merkle-trees:census} -The census Merkle tree, denoted by $\hlget{\censusTree}$ encodes the list of eligible voters and their associated voting weights. Formally, it is implemented as a sparse Merkle tree (SMT) of fixed depth\footnote{In the present work, all circuits are instantiated using sparse Merkle trees as described above. However, the protocol does not strictly depend on this structure: any authenticated data structure that supports efficient commitments and membership proofs verifiable inside zero-knowledge circuits could be employed. Adapting the protocol to such alternatives would only require modifying the corresponding circuits, while the overall flow of the voting process would remain unchanged.}, as described in Section~\ref{sec:cryptographic-primitives:merkle-trees}. Each voter is mapped to a unique path in the tree, typically derived from their Ethereum address or another unique identifier, and the corresponding leaf stores the voting weight of that address. While the default weight is usually one, the system also supports weighted voting, where different participants may have different levels of influence. +The census Merkle tree, denoted by $\hlget{\censusTree}$ encodes the list of eligible voters and their associated voting weights. Formally, it is implemented as a sparse Merkle tree (SMT) of fixed depth\footnote{In the present work, all circuits are instantiated using sparse Merkle trees as described above. However, the protocol does not strictly depend on this structure: any authenticated data structure that supports efficient commitments and membership proofs verifiable inside zero-knowledge circuits could be employed. Adapting the protocol to such alternatives would only require modifying the corresponding circuits, while the overall flow of the election process would remain unchanged.}, as described in Section~\ref{sec:cryptographic-primitives:merkle-trees}. Each voter is mapped to a unique path in the tree, typically derived from their Ethereum address or another unique identifier, and the corresponding leaf stores the voting weight of that address. While the default weight is usually one, the system also supports weighted voting, where different participants may have different levels of influence. To construct the census, the organizer collects the dataset of eligible voters and their weights, computes the corresponding tree, and publishes its root (\censusroot) on-chain. The full dataset does not need to be stored on-chain; instead, it is distributed off-chain (e.g., via IPFS or another content-addressed storage system), enabling verifiers and sequencers to independently reconstruct the tree and produce membership proofs when needed. This design ensures transparency and verifiability while minimizing on-chain storage requirements.@@ -32,9 +32,9 @@
\subsubsection{State tree} \label{sec:vocdoni-protocol:merkle-trees:state} -The state Merkle tree, denoted by $\hlget{\stateTree}$, represents the evolving state of the voting process. Like the census tree, it is implemented as a SMT of fixed depth, as described in Section~\ref{sec:cryptographic-primitives:merkle-trees}. In contrast to the census tree, which remains static once the election begins, the state tree is dynamic: it is updated throughout the process as new votes are cast, validated, and incorporated by the sequencers. +The state Merkle tree, denoted by $\hlget{\stateTree}$, represents the evolving state of the election. Like the census tree, it is implemented as a SMT of fixed depth, as described in Section~\ref{sec:cryptographic-primitives:merkle-trees}. In contrast to the census tree, which remains static once the election begins, the state tree is dynamic: it is updated throughout the election as new votes are cast, validated, and incorporated by the sequencers. -The leaves of the state tree store the global process parameters, the encrypted ballots, and the set of vote identifiers, as illustrated in Figure~\ref{fig:mt-state}. More specifically: +The leaves of the state tree store the global election parameters, the encrypted ballots, and the set of vote identifiers, as illustrated in Figure~\ref{fig:mt-state}. More specifically: \paragraph{Reserved addresses for metadata.} The first six addresses are reserved for the process parameters as follows:@@ -55,12 +55,12 @@ %Figure~\ref{fig:mt-state} illustrates the structure of the state tree, showing the reserved slots for process parameters as well as the leaves used for ballots and vote identifiers.
\begin{figure}[h] \centerline{\includegraphics[width=400pt,draft=false]{\figs/mt-state-mermaid}} - \caption{Structure of the state Merkle tree. The first leaves are reserved for global process parameters while subsequent leaves store encrypted ballots indexed by voter addresses and vote identifiers.} + \caption{Structure of the state Merkle tree. The first leaves are reserved for global election parameters while subsequent leaves store encrypted ballots indexed by voter addresses and vote identifiers.} \label{fig:mt-state} \end{figure} -\paragraph{Initial state.} At the beginning of the election, the state tree is initialized with the process parameters and empty accumulators, and its root ($\stateroot$) is published on-chain. +\paragraph{Initial state.} At the beginning of the election, the state tree is initialized with the election parameters and empty accumulators, and its root ($\stateroot$) is published on-chain. \paragraph{State transitions.} As the voting progresses, sequencers update the tree whenever new votes are received, producing a new root for each transition. To guarantee correctness, each update is accompanied by a \ac{ZK-SNARK} proof attesting that the transition from the previous root to the new root respects all protocol constraints: ballots are well-formed and comply with the voting rules, voters are eligible according to the census, the \voteid non-membership condition prevents double voting (or overwrites are handled correctly), and encrypted results are aggregated consistently. In addition, sequencers reencrypt stored ciphertexts, including both newly submitted and already included ballots. This mechanism refreshes the randomness of the encrypted votes without altering their underlying content, ensuring receipt-freeness and concealing whether a particular ballot has been overwritten or simply re-randomized. -In this way, the state tree provides a compact and tamper-proof commitment to the current status of the election. At the end of the process, the final state root together with the on-chain verification of all transitions serves as a complete cryptographic record of the election, encapsulating both the tally and the integrity of the entire voting procedure.+In this way, the state tree provides a compact and tamper-proof commitment to the current status of the election. At the end of the election, the final state root together with the on-chain verification of all transitions serves as a complete cryptographic record of the election, encapsulating both the tally and the integrity of the entire voting procedure.
@@ -2,7 +2,7 @@ % !TeX root = ../build/main.tex
An election involves four types of participants: the organizer, the \keywardens, the voters, and the sequencers. -\paragraph{Organizer.} The organizer is the entity responsible for defining and setting up the voting process. Its key responsibilities include defining the voting parameters and gathering the census data. The organizer ensures that the election is structured correctly but does not participate in vote collection or tallying. +\paragraph{Organizer.} The organizer is the entity responsible for defining and setting up the election. Its key responsibilities include defining the voting parameters and gathering the census data. The organizer ensures that the election is structured correctly but does not participate in vote collection or tallying. \paragraph{\Keywardens.} \Keywardens are a set of decentralized parties that collaboratively generate a public encryption key that voters use to encrypt their votes.
@@ -1,6 +1,6 @@
% !TeX root = ../build/main.tex -In this section we describe the overall flow of the \davinci voting protocol. The process is structured into five main phases: election setup, encryption key generation, voting period, decryption key generation, and tally finalization. Each phase specifies the interactions between the organizer, \keywardens, voters, sequencers, and the smart contracts that coordinate the election. An overview of the complete process is shown in Figure~\ref{fig:protocol-flow}. +In this section we describe the overall flow of the \davinci voting protocol. An election is structured into five main phases: election setup, encryption key generation, voting period, decryption key generation, and tally finalization. Each phase specifies the interactions between the organizer, \keywardens, voters, sequencers, and the smart contracts that coordinate the election. An overview of the complete process is shown in Figure~\ref{fig:protocol-flow}. \subsubsection{Election setup} \label{sec:vocdoni-protocol:setup}@@ -105,10 +105,10 @@
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 voting process. + \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 process 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.} +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.} \begin{figure}%[H] \centerline{\includegraphics[width=370pt,draft=false]{\figs/protocol-flow}}
@@ -1,6 +1,6 @@
% !TeX root = ../build/main.tex -The following section provides an overview of the DAVINCI protocol, describing its main phases and actors without delving into technical details. The voting process is governed by smart contracts deployed on Ethereum, which ensure transparency, enforce rules, and verify proofs. As shown in Figure~\ref{fig:protocol-intuition}, the protocol consists of five main phases, from the setup of the election to the publication and verification of final results. +The following section provides an overview of the DAVINCI protocol, describing its main phases and actors without delving into technical details. The election process is governed by smart contracts deployed on Ethereum, which ensure transparency, enforce rules, and verify proofs. As shown in Figure~\ref{fig:protocol-intuition}, the protocol consists of five main phases, from the setup of the election to the publication and verification of final results. %All the voting process is governed by the rules encoded in three smart contracts: the \textit{process management}, the \textit{sequencer registry}, and the \textit{results verification} smart contract. All these three contracts are deployed on the Ethereum blockchain, and ensure that the execution of all steps is transparent and unalterable. The protocol consists of five phases, as illustrated in Figure~\ref{fig:protocol-intuition} and described below. The first two occur during the preparation period, the subsequent two during the voting period, and the final one takes place in the tally period. \rogeri{a rough explanation about how double-spending (i.e. double vote-count) is prevented should be included somewhere in this section (as it is explained how coercion and vote-buying is mitigated).}
@@ -1,17 +1,40 @@
% !TeX root = ../build/main.tex -An Ethereum compatible network is used as the source of truth for the voting system. By leveraging an Ethereum virutal machine (EVM) blockchain, the voting process management ensures that all transitions are immutable and verifiable by all participants. To this end, we implement the following three smart contracts.\\ +The \davinci protocol operates on an Ethereum-compatible network, which serves as the source of truth for the election. By leveraging an Ethereum virtual machine (EVM) blockchain, all election transitions become immutable and publicly verifiable. To coordinate and validate each phase of the process, DAVINCI deploys a set of smart contracts that enforce protocol rules, verify zero-knowledge proofs, and maintain on-chain commitments such as state roots, encryption keys, and final results. Together, these contracts provide a trustless execution environment that guarantees the correct and transparent progression of the election without relying on any centralized authority. +\noi {\color{blue}\textbf{TODO}: add methods and state variables.} -\noi {\color{blue}\textbf{TODO}: add methods and state variables. Smart contracts are outdated.} +\subsubsection{Organization registry} -\subsubsection{Process management} +The \orgregistry smart contract is used to create and manage organizations within the system. Each organization is identified by the Ethereum address of its creator and is associated with a name and a URL pointing to its metadata. At this stage, the contract serves only as a registration mechanism, but it lays the foundation for future extensions, such as managing multiple elections under the same organization. -It is responsible for the life-cycle management of voting processes. It includes the initiation, monitoring, execution, and closure of voting events. +\subsubsection{Key management} -\subsubsection{Sequencer registry} +The \hlset{\dkgmanagement} smart contract coordinates the DKG process among the \keywardens. It records their contributions, verifies proofs of correct participation, and ensures that a valid encryption public key is produced once the DKG round is complete. + +\subsubsection{Election (process) registry} + +The \hlset{\electionregistry} manages the lifecycle of each election, from its creation to the registration of final results. It maintains the election’s current state and ensures that all transitions follow the protocol. + +\subsubsection{State transition verifier} + +The \hlset{\statetransitionverifier} is responsible for validating the proofs that attest to correct updates of the election state. It stores the verification key corresponding to the state transition circuit (see Section~\ref{sec:vocdoni-protocol:circuits:state-transition}) and checks that each submitted proof correctly links the previous and new state roots. Only transitions verified through this contract are accepted as valid updates by the process registry. + +\subsubsection{Results verifier} -It keeps track of the existing available sequencers, stores the collateral of the sequencers to ensure (that incentivizes) good behaviour, and is used to coordinate the distributed key generation when a new voting process is created. +The \hlset{\resultsverifier} contract validates the proof of correct tally computation. It contains the verification key for the results circuit (see Section~\ref{sec:vocdoni-protocol:circuits:results}) and ensures that the final results submitted by the organizer match the commitments from the final state. Once verified, the results and their proof are permanently recorded on-chain, providing a tamper-proof reference for the election outcome.\\ -\subsubsection{Results verification} +\martai{\\ + 1. \orgregistry only for transparency purposes, right? Any EOW can call \electionregistry?\\ + 2. Once EPK is created, does a kew warden uploaded it to \dkgmanagement and that triggers a call to \electionregistry that records it?\\ + 3. What is the relation with \electionregistry and \dkgmanagement, because the organizer sets the security parameters for the DKG, what is the interaction between contracts?\\ + 4. Does \electionregistry call the other two verifier contracts? Or the sequencers need to call the other two?} -For each voting process, this smart contract maintains the integrity of the cast votes and process life cycle. It verifies that each state transition committed by a sequencer adheres to the predefined rules. +% +%1. OrganizationRegistry: se utiliza para crear una organización (que asocia la address del creador con un nombre y una URL a sus metadatos). No tiene ningún otro rol de momento. +%2. ProcessRegistry: registra como dices todo el proceso de una election, desde su creación hasta registrar los resultados (incluyendo el stateroot en cada momento). En resumen: +%Genera el state root inicial (aun no, pero lo hará). +%Controla el status de la election (ready, pause, ...). +%Verifica las state transitions y actualiza el state de la election. +%Verifica los resultados una vez que son calculados. +%3. (Encara no): Coordinación DKG +%4. Verifier: Realmente son 2 verifiers, el de las statetransitions y el de los results (uno por cada circuito porque cada uno contiene la verification key que debe).
@@ -10,18 +10,18 @@
\begin{itemize} \item \emph{Collateral for sequencers.} Sequencers must stake \token tokens as collateral to participate. This serves as a safeguard to ensure responsible participation. Misbehavior or failure to meet obligations can result in penalties, including partial or total loss of the stake. \item \emph{Incentive mechanism.} Sequencers earn rewards in \token tokens based on their contribution to processing valid votes and maintaining the network. Rewards are proportional to the number of valid votes successfully added to the shared state. - \item \emph{Payment for voting processes.} Organizers pay fees in \token tokens to create and manage voting events. These fees depend on factors such as registry size, voting duration, and desired security level. + \item \emph{Payment for elections.} Organizers pay fees in \token tokens to create and manage elections. These fees depend on factors such as registry size, voting duration, and desired security level. \item \emph{Governance.} Token holders can participate in the decentralized governance of the project, influencing protocol upgrades, ecosystem development, and other initiatives. This ensures that the project evolves in a transparent, community-driven manner. \end{itemize} \subsection{Economics for organizers} -Organizers cover the costs of voting processes in \token tokens. The total cost combines four components: +Organizers cover the costs of elections in \token tokens. The total cost combines four components: \[ \totalCost = \baseCost + \capacityCost + \durationCost + \securityCost, \] where % \begin{itemize} - \item $\baseCost$ is a fixed setup fee, independent of process duration or security level. It is calculated as + \item $\baseCost$ is a fixed setup fee, independent of the election duration or security level. It is calculated as \[ \baseCost = \fixedCost + \maxVotes \cdot p, \]@@ -31,7 +31,7 @@ \item $\capacityCost$ accounts for limited sequencer capacity. That is, is models the cost of reserving space for voting events relative to the number of available sequencers, number of voting events running, and the maximum number of voters. Costs rise non-linearly as available capacity decreases as
\[ k_1 \cdot \left( \frac{\totalVotingProcesses}{\totalSequencers - \usedSequencers + \epsilon} \cdot \maxVotes \right)^a \] - with $k_1$ a scaling factor, $\totalVotingProcesses$ the number of voting processes running, $\totalSequencers$ the number of registered sequencers, $\usedSequencers$ the number of sequencers handling other voting events, $\epsilon$ a small constant to avoid division by zero, and $a$ an exponent controlling non-linearity. + with $k_1$ a scaling factor, $\totalVotingProcesses$ the number of elections running, $\totalSequencers$ the number of registered sequencers, $\usedSequencers$ the number of sequencers handling other elections, $\epsilon$ a small constant to avoid division by zero, and $a$ an exponent controlling non-linearity. \item $\durationCost$ grows with the length of the voting period, scaled non-linearly with the formula \[@@ -43,7 +43,7 @@ \item $\securityCost$ models the number of sequencers used, growing exponentially with diminishing returns:
\[ k_3 \cdot e^{c \left( \frac{\numSequencers}{\totalSequencers} \right)^d}, \] - where $k_3$ is a scaling factor, $c$ controls the steepness, $\numSequencers$ is the number of sequencers needed in the process, $\totalSequencers$ the number of available sequencers, and $d$ adjusts the non-linearity as the number of sequencers increases.\\ + where $k_3$ is a scaling factor, $c$ controls the steepness, $\numSequencers$ is the number of sequencers needed in the election, $\totalSequencers$ the number of available sequencers, and $d$ adjusts the non-linearity as the number of sequencers increases.\\ {\color{blue}Before $\totalSequencers$ was defined as the number of \textit{registered} sequencers and here it means the number of \textit{available} sequencers. Is it assumed to always be the same?} \end{itemize}@@ -87,4 +87,4 @@ where $0 \leq s \leq 1$ is a slashing coefficient. This ensures accountability and discourages free-riding.
\subsection{Summary and remarks} -The cost model combines four components: base, capacity, duration, and security. It ensures small processes are cost-efficient, large or resource-intensive processes incur higher costs, and impractical setups are excluded. Organizers aim to minimize costs, while sequencers seek to maximize rewards — a natural tension that can be modeled as a strategic game. Analyzing this equilibrium is left for future work. {\color{blue}Move this to Section~\ref{sec:token}?}+The cost model combines four components: base, capacity, duration, and security. It ensures small elections are cost-efficient, large or resource-intensive elections incur higher costs, and impractical setups are excluded. Organizers aim to minimize costs, while sequencers seek to maximize rewards — a natural tension that can be modeled as a strategic game. Analyzing this equilibrium is left for future work. {\color{blue}Move this to Section~\ref{sec:token}?}
@@ -20,4 +20,4 @@ \input{\secs/circuits.tex}
\subsection{Protocol flow} \label{sec:vocdoni-protocol:flow} -\input{\secs/protocol-flow.tex} +\input{\secs/protocol-flow.tex}