arnaucube
arnaucube/davinci-paperPublic Self-hosted repository
wip
bellesmarta belles.mm@gmail.com
Sat, 12 Jul 2025 19:37:43 +0200
commit

c0a032fe359234d41b5efb2187acb8768cefa868

parent

cab554c81a1f8356fcde2f13cf3544248cadb2b1

M v2/build/main.tex → v2/build/main.tex

@@ -31,7 +31,7 @@ \end{abstract}

\martai{Separate the roles of the sequencers from key generators?} -\setcounter{tocdepth}{3} +\setcounter{tocdepth}{2} \makeatletter \renewcommand*\l@author[2]{} \renewcommand*\l@title[2]{}
M v2/build/preamble-packages.tex → v2/build/preamble-packages.tex

@@ -15,6 +15,7 @@ \usepackage{hyperref}

\hypersetup{final} \usepackage{footmisc} %footnotes handling +\usepackage{pdflscape} %package needed to set an horizontal pdf page \usepackage{amsmath, amssymb, mathtools} \usepackage{listings}
M v2/figures/circuits.drawio → v2/figures/circuits.drawio

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

-<mxfile host="app.diagrams.net" agent="Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:140.0) Gecko/20100101 Firefox/140.0" version="27.2.0" pages="5"> +<mxfile host="app.diagrams.net" agent="Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:140.0) Gecko/20100101 Firefox/140.0" version="28.0.4" pages="5"> <diagram name="1. voter-circuit" id="-BY3RIMELlOST2Ke_Soi"> - <mxGraphModel dx="1321" dy="780" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1100" pageHeight="850" math="1" shadow="0"> + <mxGraphModel dx="945" dy="471" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1100" pageHeight="850" math="1" shadow="0"> <root> <mxCell id="9w8_UW6vJWkl_njZVMp4-0" /> <mxCell id="9w8_UW6vJWkl_njZVMp4-1" parent="9w8_UW6vJWkl_njZVMp4-0" />

@@ -108,10 +108,10 @@ <mxPoint x="1079.58" y="230" as="sourcePoint" />

<mxPoint x="1080" y="710" as="targetPoint" /> </mxGeometry> </mxCell> - <mxCell id="OdLuYHqov1AF89vjBi5t-4" value="&lt;div style=&quot;font-size: 11px;&quot;&gt;$$\text{address}$$&lt;/div&gt;" style="rounded=0;whiteSpace=wrap;html=1;fontSize=11;fillColor=#d5e8d4;strokeColor=#82b366;fontFamily=Courier New;" parent="9w8_UW6vJWkl_njZVMp4-1" vertex="1"> + <mxCell id="OdLuYHqov1AF89vjBi5t-4" value="$$\text{processID}$$" style="rounded=0;whiteSpace=wrap;html=1;fontSize=11;fillColor=#d5e8d4;strokeColor=#82b366;fontFamily=Courier New;" parent="9w8_UW6vJWkl_njZVMp4-1" vertex="1"> <mxGeometry x="1050" y="80" width="60" height="40" as="geometry" /> </mxCell> - <mxCell id="OdLuYHqov1AF89vjBi5t-5" value="$$\text{processID}$$" style="rounded=0;whiteSpace=wrap;html=1;fontSize=11;fillColor=#d5e8d4;strokeColor=#82b366;fontFamily=Courier New;" parent="9w8_UW6vJWkl_njZVMp4-1" vertex="1"> + <mxCell id="OdLuYHqov1AF89vjBi5t-5" value="$$\text{address}$$" style="rounded=0;whiteSpace=wrap;html=1;fontSize=11;fillColor=#d5e8d4;strokeColor=#82b366;fontFamily=Courier New;" parent="9w8_UW6vJWkl_njZVMp4-1" vertex="1"> <mxGeometry x="1120" y="80" width="60" height="40" as="geometry" /> </mxCell> <mxCell id="OdLuYHqov1AF89vjBi5t-6" value="$$\text{voteID}$$" style="rounded=0;whiteSpace=wrap;html=1;fontSize=11;fillColor=#d5e8d4;strokeColor=#82b366;fontFamily=Courier New;" parent="9w8_UW6vJWkl_njZVMp4-1" vertex="1">
M v2/sections/cryptographic-primitives.tex → v2/sections/cryptographic-primitives.tex

@@ -196,7 +196,7 @@ \begin{itemize}

\item[$\bullet$] $\hlset{\Enc}_{\pk}(\msg \in \{0,1\}^\star; k\in\F_t)$: \vspace{0.1cm} \begin{enumerate} \item Map $\msg$ to $\BJ{\G}$ via $M = m \hlget{\BJ{G}}$. - \item Compute $C_1 = k \cdot \BJ{G} \in \BJ{\G}$. + \item Compute $C_1 = k \cdot \hlget{\BJ{G}} \in \BJ{\G}$. \item Compute $C_2 = k \cdot \pk + M \in \BJ{\G}$. \item Output $\enc = (C_1, C_2) \in {(\BJ{\G})}^2$. \end{enumerate}

@@ -216,8 +216,6 @@ \end{enumerate}

\end{itemize} \end{minipage} \end{mdframed} - -\martai{Link $\BJ{G}$ to element from Section~\ref{sec:cryptographic-primitives:elliptic-curves}.} \martai{It remains to explain how to recover $m$ from $M$. I propose to define a function $P_m$ that maps $m$ to $\J$, and then say that although it is generally not invertible, in this case the message space is small, and therefore, it can be done via brute-force search or using the baby-step giant-step algorithm [CITE].}

@@ -263,13 +261,13 @@ %

Verification of ECDSA signatures is \textit{performed inside} zero-knowledge proofs using a specialized circuit that emulates SECP256K1 arithmetic. This approach is necessary because SECP256K1 is defined over a 256-bit prime field that differs from the native field used in the ZK-SNARK circuit (see Section\ref{sec:vocdoni-protocol:circuits} for more details). Below, we describe the algorithms, which follow the standard ECDSA protocol. \begin{mdframed} - \begin{minipage}[t]{0.45\textwidth} + \begin{minipage}[t]{0.46\textwidth} \begin{itemize} \item[$\bullet$] $\hlset{\SSign}_{\sk}(\msg \in \{0,1\}^\star)$: \vspace{0.1cm} \begin{enumerate} \item Compute $h = \hlget{\Keccak}(\msg) \bmod q$. \item\label{item:ssign-step} Select a random scalar $k \sample \Z_q^{*}$. - \item Compute $R = k \cdot G = (x_R, y_R) \in \SEC{\G}$. + \item Compute $R = k \cdot \hlget{\SEC{G}} = (x_R, y_R) \in \SEC{\G}$. \item Set $r = x_R \bmod q$. If $r = 0$, go back to step~\ref{item:ssign-step}. \item Compute $s = k^{-1} \cdot (h + r \cdot \sk) \bmod q.$ If $s = 0$, go back to step~\ref{item:ssign-step}. \item Output $\sigma = (r, s)$.

@@ -284,13 +282,14 @@ \item Check that $\pk \in \SEC{\G}$.

\item Compute $h = \hlget{\Keccak}(\msg) \bmod q$. \item Compute $w = s^{-1} \bmod q$. \item Compute $u_1 = h \cdot w \bmod q$ and $u_2 = r \cdot w \bmod q$. - \item Compute $$X = u_1 \cdot G + u_2 \cdot \pk = (x_X, y_X) \in \SEC{\G}.$$ + \item Compute $$X = u_1 \cdot \hlget{\SEC{G}} + u_2 \cdot \pk = (x_X, y_X) \in \SEC{\G}.$$ \item Accept if $r = x_X \bmod q$; otherwise, reject. \end{enumerate} \end{itemize} \end{minipage} \end{mdframed} +\martai{The output of the hash does not match, CHECK!} \subsection{Key generation schemes} \label{sec:cryptographic-primitives:dkg}
M v2/sections/introduction.tex → v2/sections/introduction.tex

@@ -4,11 +4,11 @@ Online voting remains one of the most studied yet elusive applications in applied cryptography. As digital services expand across both public and private sectors, secure and universally verifiable online voting systems have become an increasingly desirable goal. Remote electronic voting promises scalability, accessibility, and administrative efficiency; yet the design of systems that simultaneously ensure privacy, integrity, coercion resistance, and transparency under realistic adversarial models remains a formidable challenge. Numerous deployments—including iVote, Helios, and the Estonian I‑voting system—have revealed deep-rooted usability flaws and security gaps, particularly when verifiability mechanisms are either poorly understood by users or reliant on centralized infrastructure.

Against this backdrop, the Vocdoni project was initiated in 2018 with the aim of rethinking online voting from first principles. The name Voĉdoni, meaning “to give voice” in Esperanto, reflects the project’s foundational goal: to empower collectives—from small associations to millions of citizens—to engage in secure and verifiable decision-making, regardless of technological or institutional barriers. Central to this vision was the idea that voting is not limited to formal governmental elections but serves as a more general-purpose mechanism for collective signaling. Vocdoni introduced a fully anonymous, end-to-end verifiable voting system designed to operate efficiently across a range of devices, including smartphones. To support these goals, the team deployed a custom infrastructure emphasizing resilience, neutrality, and transparency. -Technically, the architecture of Vocdoni was grounded on a bespoke \textit{Byzantine fault tolerant} (BFT) layer-1 blockchain, named Vochain. At the time, \textit{zero-knowledge} (ZK) proof systems such as ZK-SNARKs were emerging but not yet practical for most deployments. Vochain provided a performant and low-cost environment (achieving approximately 700 transactions per second) where advanced cryptographic tools could be used without the constraints imposed by blockchains based on the \textit{Ethereum virtual machine} (EVM). The ability to issue voting transactions without requiring user fees enabled broader accessibility. Over several years of development and deployment, this architecture proved both viable and valuable in practice. However, broader adoption as a universal voting protocol highlighted the need for further architectural refinements and stronger formal guarantees. +Technically, the architecture of Vocdoni was grounded on a bespoke {Byzantine fault tolerant} (BFT) layer-1 blockchain, named Vochain. At the time, {zero-knowledge} (ZK) proof systems such as ZK-SNARKs were emerging but not yet practical for most deployments. Vochain provided a performant and low-cost environment (achieving approximately 700 transactions per second) where advanced cryptographic tools could be used without the constraints imposed by blockchains based on the {Ethereum virtual machine} (EVM). The ability to issue voting transactions without requiring user fees enabled broader accessibility. Over several years of development and deployment, this architecture proved both viable and valuable in practice. However, broader adoption as a universal voting protocol highlighted the need for further architectural refinements and stronger formal guarantees. In this work, we introduce \davinci, a new protocol that builds upon the lessons and conceptual groundwork laid by Vocdoni. \Davinci adopts a modular design and integrates state-of-the-art cryptographic tools—including succinct ZK proofs, improved bulletin board constructions, and robust coercion resistance mechanisms—reflecting the most recent advances in academic research. Unlike monolithic designs, \davinci is conceived as a composable primitive: a foundational layer intended to support secure and verifiable voting in diverse contexts, from blockchain governance to institutional elections. This shift in design philosophy aims to address long-standing challenges in the field, offering a cleaner abstraction with clearer security boundaries and formal underpinnings.\\ -\martai{Mention the Vocdoni token.} +\martai{TODO -- introduce the Vocdoni token.} \subsection{Contributions} \label{sec:introduction:contributions}

@@ -43,4 +43,4 @@ \item Section~\ref{sec:analysis}: analysis of the proposed protocols. It includes a security discussion of the properties of the protocol, implementation details, and a performance evaluation.

\item Section~\ref{sec:conclusions}: we finish with some last remarks. \end{itemize} -\martai{Mention that the spec can be tailored to the needs of the specific vote. So, here we present some default configuration, but some of the pieces can be changed (specially the cryptographic schemes or curves). For this reason, we tried to make this document modular (like the code), to facilitate the changes and the analysis of the consequences.} +\martai{Mention that the spec can be tailored to the needs of the specific vote. So, here we present some default configuration, but some of the pieces can be changed (specially the cryptographic schemes or curves). For this reason, we tried to make this document modular (like the code), to facilitate the changes and analysis.}
M v2/sections/protocol-intuition.tex → v2/sections/protocol-intuition.tex

@@ -31,5 +31,4 @@ %they compress multiple individual verification into one.

Additionally, the sequencers reencrypt the votes and generate a proof of the correct reencryption computation. While this process does not alter the final tally, it prevents voters from decrypting their original vote. This step mitigates vote selling or coercion, as voters are no longer able to prove their choice to third parties. Finally, the sequencers submit the reencrypted votes along with their verification and reencryption proofs to the process management smart contract. The smart contract verifies all the proofs provided by the sequencers to check that they complied with the protocol. \paragraph{$\boxed{5}$ Results verification.} -\textit{At the conclusion of the voting period, the smart contract ceases to accept new state updates, effectively finalizing the process. The final state is then available on-chain for verification, providing an immutable record of the voting outcome.} -\marta{I did not look into the results decryption/verification part yet. A short description should be given here.}+{\color{blue}At the conclusion of the voting period, the smart contract ceases to accept new state updates, effectively finalizing the process. The final state is then available on-chain for verification, providing an immutable record of the voting outcome.}
M v2/sections/vocdoni-protocol.tex → v2/sections/vocdoni-protocol.tex

@@ -114,39 +114,6 @@ \label{fig:circuit-inputs}

\end{figure} -\subsubsection{Votes [I don't think this is the right place]} - -In the \davinci system, a vote comprises several components that work together to ensure secure, private, and verifiable voting. These components are: -\begin{align*} - \vote = [ \processid, \voteid, \encryptedballot, \censuspf, \zkproof, \signature ]. -\end{align*} -\martai{In the code, the struct is just: address, commitment, nullifier and ballot. Check!} - -\martai{Actually, the address could be recomputed by the sequencer (add it as a footnote).} - -\martai{In the code, they call it vote, verifierVote. Alternative: envelope.} - -Below, we detail each component and its role in the voting process: -\begin{itemize} - \item \processid: the process identifier is a unique 32-byte number that uniquely identifies a specific voting process. This variable encapsulates essential information about the voting, such as the rules and constraints for ballots and the unique identifier of the \davinci blockchain instance. - \martai{the identifier is computed from the organization address, the Eth nonce, chain ID (e.g. mainnet), formatejat in a certain way.} - % - \item \encryptedballot: it contains the voter's selections encoded according to the ballot protocol rules. To ensure privacy, the ballot is encrypted using an homomorphic encryption scheme, which allows homomorphic combination of encrypted votes. More specifically, given the voter's choice $m$ and a random element $k$, the vote is encoded as follows: - \[ \encryptedballot = \hlget{\Enc}(m; k). \] - % - \item \voteid: vote identifier, tied to balbla, computed this way. - \[ \voteid = .\] - % - \item \censuspf: the census proof serves as the voter's identity verification mechanism, ensuring that only eligible voters can participate. Depending on the process configuration, the voter provides either a Merkle tree-based proof showing inclusion in the census true, or a credential issued by a trusted third party (e.g. from a credential service provider). - % - \item \zkproof: the voter generates a ZK proof to prove the correctness of the ballot and encryption process: - \[ \zkproof = \text{Prove(), Circuit()}. \] - This proof proves the correct computation of the vote encryption, the nullifier, the commitment, and the compliance with the ballot protocol rules. - % - \item \signature: the signature authenticates the vote and ensure that was cast by a legitimate voter. The voter signs necessary components using their private key, depending on the census configuration (e.g., ECDSA, EdDSA, RSA). - \[ \signature = \text{Sign(xxx)}. \] -\end{itemize} - \subsection{Circuits} \label{sec:vocdoni-protocol:circuits}

@@ -198,7 +165,7 @@ \textbf{Constraints}

\begin{itemize} \item \emph{Vote encryption}. Correct encryption of the ballot: $(C_1, C_2) = \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} (\address \conc \processid \conc k)$. + \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}

@@ -404,15 +371,15 @@

\subsubsection{Prior to voting (only once)} \label{sec:vocdoni-protocol:prior-steps} -\martai{Remove the first step, we assume contracts are already deployed or at least, the logic is available.} - -This is done only once. Then every voting will start its process from step in Section~\ref{sec:vocdoni-protocol:start}. - -Vocdoni: -\begin{enumerate} - \item Deployment of the 3 smart contracts. - \item Sequencers registry starts (it doesn't end). -\end{enumerate} +%\martai{Remove the first step, we assume contracts are already deployed or at least, the logic is available.} +% +%This is done only once. Then every voting will start its process from step in Section~\ref{sec:vocdoni-protocol:start}. +% +%Vocdoni: +%\begin{enumerate} +% \item Deployment of the 3 smart contracts. +% \item Sequencers registry starts (it doesn't end). +%\end{enumerate} Sequencers (nodes validadors) -- this process is always open: \begin{enumerate}

@@ -434,6 +401,8 @@ \item Generates the census commitment \texttt{MT\_census.root = Com(census\_data)}.

\martai{In general, make use (link) to the functions defined in Section~\ref{sec:cryptographic-primitives}. For example, here the \texttt{MT.root()}.} \martai{Additionally, after this step, the organizer should make a Merkle proof available to all eligible voters.} \item Set voting details: duration, options, type, etc. + CENSUS MT ROOT. + \item \processid: the process identifier is a unique 32-byte number that uniquely identifies a specific voting process. This variable encapsulates essential information about the voting, such as the rules and constraints for ballots and the unique identifier of the \davinci blockchain instance. + \martai{the identifier is computed from the organization address, the Eth nonce, chain ID (e.g. mainnet), formatejat in a certain way.} \item Also a timeout for the DKG ceremony + minimum number of sequencers. \item Send transaction to the Ethereum process management smart contract with all data. Note this transaction has a cost (Eth tx fees) that needs to be covered by the organizer. \end{enumerate}

@@ -466,7 +435,7 @@ \begin{itemize}

\item Choose any of the available sequencers (from?? -- from the SR SC). \item Fetch their census \textbf{Merkle proof} to prove eligibility (from the census registry). \item Collect the process data $\epk$, $\ballotmode$, $\processid$ from the process management smart contract. - \item Sample a fresh random $k\in\F$ and use the $\epk$ to encrypt the voting choice: + \item Sample a fresh random $k\in\F$ and use the $\epk$ to encrypt the voting choice $\ballot$: \begin{equation} \label{eq-ciphertext} (C_1, C_2) = \hlget{\Enc}_{\epk}(\ballot; k).

@@ -475,14 +444,28 @@ \martai{Actually, I would not write $(C_1, C_2)$ but rather \texttt{ciphertext}.}

\item Use the user's own Ethereum address $\address$ and the previous $k$ to compute the $\voteid$: \begin{equation} \label{eq-voteid} - \voteid = Hash(\address \conc \processid \conc k). + \voteid = Hash(\processid \conc \address \conc k). \end{equation} - \martai{Is this the right order?} + \martai{The hash used in votID is MultiMiMC7.} \item Generate ZK-SNARK of satisfiability of circuit from Fig.~\ref{fig:circuit-voter} with the proof system from Section~\ref{sec:cryptographic-primitives:zkp} to prove that Eqs.~\labelcref{eq-ciphertext,eq-voteid} are correctly computed, and that $\ballot$ satisfies ballot protocol rules according to $\ballotmode$. We call this proof \textbf{vote proof}. - \item Sign $\voteid$ using the user's secret key $\sk$: + \item Sign $\voteid$ using the user's secret key $\sk$ to authenticates the vote and ensure that was cast by a legitimate voter: \[ \signature = \hlget{\SSign}_{\sk}(\voteid).\] - \item Send the encrypted vote, Merkle proof, validity proof, and identity proof to the sequencer. - \martai{I understand Validity proof refers to ``voter circuit"? Merkle proof is for inclusion, right? And identity proof is for example a signature??} + \item Send the encrypted vote, Merkle proof, validity proof, and identity proof to the sequencer: + \[ \vote = [ \processid, \voteid, \encryptedballot, \censuspf, \zkproof, \signature ]. \] +\end{itemize} + +\martai{In the code, the struct is just: address, commitment, nullifier and ballot. Check!} + +\martai{Actually, the address could be recomputed by the sequencer (add it as a footnote).} + +\martai{In the code, they call it vote, verifierVote. Alternative: envelope.} + +\begin{itemize} + \item \censuspf: the census proof serves as the voter's identity verification mechanism, ensuring that only eligible voters can participate. Depending on the process configuration, the voter provides either a Merkle tree-based proof showing inclusion in the census true, or a credential issued by a trusted third party (e.g. from a credential service provider). + % + \item \zkproof: the voter generates a ZK proof to prove the correctness of the ballot and encryption process: + \[ \zkproof = \text{Prove(), Circuit()}. \] + This proof proves the correct computation of the vote encryption, the nullifier, the commitment, and the compliance with the ballot protocol rules. \end{itemize} Sequencer: