arnaucube
arnaucube/davinci-paperPublic Self-hosted repository
add feedback from meeting with Pau
bellesmarta belles.mm@gmail.com
Sun, 25 May 2025 15:29:09 +0200
commit

7e0d3d031c80321f1a67132c67a501aeee0c5e18

parent

ac3f26a76b24369c51895bc4a0f22babc3569e64

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

@@ -60,7 +60,7 @@ \section{Protocol intuition}

\label{sec:protocol-intuition} \input{\secs/protocol-intuition} -\section{Crytographic primitives} %building blocks +\section{Cryptographic primitives} %building blocks \label{sec:cryptographic-primitives} \input{\secs/cryptographic-primitives}

@@ -83,6 +83,10 @@

\section{Conclusions} \label{sec:conclusions} \input{\secs/conclusions} + +\section{Future work} +\label{sec:future-work} +\input{\secs/future-work} \section*{Acknowledgments} \addcontentsline{toc}{section}{\protect\numberline{}Acknowledgments}
M v2/sections/analysis.tex → v2/sections/analysis.tex

@@ -1,5 +1,8 @@

% !TeX root = ../build/main.tex +\martai{THE PROTOCOL (does note reveal the vote but it) REVEALS IF SOMEONE HAS VOTED OR NOT.} + +\martai{Check EthResearch post: \tiny\url{https://ethresear.ch/t/vocdoni-protocol-enabling-decentralized-voting-for-the-masses-with-zk-technology/21036}.} \martai{This section is old text, it needs to be reviewed.}

@@ -91,7 +94,7 @@ \begin{itemize}

\item Circuit 1: circom/snarkJS, $\sim 53.000$ constraints. \item Circuit 2: gnark, $\sim 3.1$ million constraints. \item Circuit 3: gnark, 40.000 $\times$ (number of votes) constraints. - \item Circuit 4: gnark, $\sim 4$ million constraints. + \item Circuit 4: gnark, $\sim 16$ million constraints. \end{itemize} \subsection{Performance evaluation}
M v2/sections/cryptographic-primitives.tex → v2/sections/cryptographic-primitives.tex

@@ -11,6 +11,8 @@

\subsection{Elliptic curves} \label{sec:cryptographic-primitives:elliptic-curves} +\martai{Include the motivation for the use of each of the curves (e.g. native arithmetic, regular Eth addresses...).} + \davinci uses BW6-761~\cite{elhousni20optimized}, BLS12-377~\cite{bowe20zexe}, BN254~\cite{jancar20bn256}, BabyJubjub~\cite{belles21twisted}, and Secp256k1~\cite{brown10sec} elliptic curves. Below, we give the details of these curves. \paragraph{Parameters.}

@@ -139,6 +141,7 @@ Note that this scheme is additively homomorphic. That is, given two ciphertexts $(C_1, C_2)$ and $(C_1', C_2')$, their component-wise addition yields: $(C_1^{sum}, C_2^{sum}) = (C_1 + C_1', C_2, C_2)$. The aggregated ciphertext decrypts to the sum of the messages $M^{sum} = M_1 + M_2$.

\martai{The $pk$ used to encrypt is generated by multiple parties as defined in Section~\ref{sec:cryptographic-primitives:dkg}.} +\martai{Add reencryption algorithm, which essentially adds $\Enc(0)$: $\Enc(v) = \Enc(v + 0) = \Enc(v) + \Enc(0)$.} \subsection{Digital signature schemes} \label{sec:cryptographic-primitives:signatures}

@@ -225,6 +228,7 @@ \label{sec:cryptographic-primitives:merkle-trees}

\martai{I am not sure a Merkle trees section is needed, but I thought we could use it to specify the hash function used in the trees, the depth, and the -arity. We could also include some functions like \texttt{MT.Root()}, etc.} \martai{Sparse MTs (binary) with depth $64$. Instantiated with Poseidon hash function.} +\martai{Structure of spare Merkle trees from iden3.} \subsection{Zero-knowledge proof systems} \label{sec:cryptographic-primitives:zkp}
A v2/sections/future-work.tex

@@ -0,0 +1,7 @@

+% !TeX root = ../build/main.tex + +\begin{itemize} + \item Voter: they do circuit1 + circuit2 themselves (instead of the sequencer doing circuit2). + \item Post-quantum. + \item Support to xxx. +\end{itemize}
M v2/sections/protocol-intuition.tex → v2/sections/protocol-intuition.tex

@@ -23,7 +23,7 @@

\paragraph{$\boxed{3}$ Voting.} Voters select their preferred option according to the rules established by the organizer and captured in the process management smart contract. Instead of submitting their votes directly on-chain, they send them off-chain to a sequencer of their choice for processing. To ensure privacy, votes are encrypted using the available encryption public key. Alongside the encrypted vote, each voter must also provide the following data: a proof of valid voting, demonstrating that the vote complies with the election rules; a proof of eligibility, verifying that they are registered in the census; and a proof of identity ownership, in the form of a digital signature, confirming that they are the legitimate voter and are not impersonating someone else. -\martai{In the above paragraph, we could include a short description about double-voting/overwriting.} +\martai{In the above paragraph, we could include a short description about double-voting/overwriting: add the goal/idea of the commitment and the nullifier.} \paragraph{$\boxed{4}$ Votes collection.}
M v2/sections/vocdoni-protocol.tex → v2/sections/vocdoni-protocol.tex

@@ -28,20 +28,30 @@ \paragraph{Census Merkle tree.} Explain what it is. \\

\martai{It could actually be another type of data structure. We only need to be able to get a commitment and a membership proof that can be proven in-circuit. Mention it in some way.} +\martai{One way to think about it: (weight, pk).} + \paragraph{State Merkle tree.} Explain what it is and the structure. Below, the original text:\\ + +\martai{Essentially, the first "addresses" or "leaves" are reserved to those items (like processId, censusRoot, etc.), and then the voters' addresses and nullifiers are used as paths to the leave where the encrypted ballot/commitment is stored.} The State tree contains some special addresses (indices) for storing some required data regarding the voting process: \begin{itemize} \item Address \texttt{0x0}: it stores \processid, a unique identifier for the voting process. \item Address \texttt{0x1}: it stores \censusroot and \type, which contains the necessary information to validate vote proofs. + \martai{they type was a field in case the organization was using a different structure for the census than a MT.} \item Address \texttt{0x2}: it stores \ballotmode, which encodes rules for validating votes, such as the maximum number of selectable options. \item Address \texttt{0x3}: it stores the \epk, which is the public key used to encrypt the votes. + \martai{Ideally, EPK is computed before the organization sets the tree, but I am not sure how practical this is.} \item Address \texttt{0x4}: it stores the \addaccumulator. That is, the aggregated encrypted voting results that need to be added. \item Address \texttt{0x5}: it stores the \substractaccumulator. That is, it stores the aggregated encrypted voting results that need to be subtracted. \item Any address: vote \addresses: are stored within the State tree pointing to a voter's identity commitment. Each commitment is a 32-byte hash derived from the voter's unique information and a secret. + \martai{(address, commitment).} \item Any address: vote \nullifiers: are stored within the State tree to prevent double voting and to allow vote overwrite. Each nullifier is a 32-byte hash derived from the voter's commitment and a secret. + \martai{Nullifiers and addresses are used as indexes (i.e. path to the leaf that stores encrypted ballots/commitments).} \end{itemize} + +\martai{Maybe the voteID will be included in the tree at some point.} \begin{figure}[h] sd \centerline{\includegraphics[width=400pt,draft=false]{\figs/mt-state}}

@@ -79,12 +89,14 @@ \encryptedballot, \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{what does the identifier (blockchain instance) mean?} + \martai{the identifier is computed from the organization address, the Eth nonce, chain ID (e.g. mainnet), formatejat in a certain way.} % \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). %

@@ -126,6 +138,10 @@ \subsection{Circuits}

\label{sec:vocdoni-protocol:circuits} \martai{The idea of this section is to describe the circuits. Then, in Section~\ref{sec:analysis:implementation} we give the details such as of the number of constants, framework used, etc. I haven't done this split yet.} + +\martai{\textbf{About the circuits: in practice (and for optimization), all public inputs $PI$ are private, and we produce a single public input $h = Hash(PI)$. Then, the verifier checks that $Hash(PI) = h$ and verifies the proof only against $h$.} For this, we use the MiMC-7 hash function.\\ \vspace{0.2cm} + +In the case of the voter circuit (circuit~1), the hash $h$ is called the \texttt{voteID}, and it allows to voter to trace their vote (it's propagated through the circuits from the sequencer). Since this is an implementation detail but it is used for traceability, I propose to write this as a footnote or as an introduction to this section.} \textit{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.}

@@ -197,6 +213,8 @@

Figure~\ref{fig:circuit-authentication} -- BLS12-377.\\ \noi Generated by the sequencer, this circuit transforms the vote proof to the BLS12-377 curve for native recursion and validates the user's eligibility in the census, as well as their signature. + +\martai{Hash of public inputs is in the wrong place. Well, in practice, it will be placed before the verification of the proof, but if we keep the hash of the PI as an implementation details, then it is in the right place. (I propose to keep it like this and in the footnote, mention the changes in each of the circuits).} \begin{figure}[H] \centerline{\includegraphics[width=450pt,draft=false]{\figs/circuit-authentication}}

@@ -250,6 +268,10 @@ Figure~\ref{fig:circuit-aggregate} -- BW6-761.\\

\noi This circuit accumulates multiple authenticated votes into a single proof. It also verifies that all accumulated votes belong to the same voting process. +\martai{This circuit has changed. Now, the aggregation circuit only include the authentication proof and the \texttt{voteI}D, and then circuit~4 does the "shared public inputs" check and the fact that voteID = Hash(...).} + +\martai{The batch, number of verification proofs, is a fixed parameter (currently set to 60). If it includes less proofs than the max size of the batch, the sequencer adds dummy proofs to the circuit.} + \begin{figure}[h] \centerline{\includegraphics[width=450pt,draft=false]{\figs/circuit-aggregate}} \caption{Aggregation circuit. All public values are framed in green.}

@@ -380,6 +402,8 @@ \vspace{-0.3cm}

\end{spacing} \end{minipage} \end{mdframed} + +\martai{STATE TRANSITION CIRCUIT: a potential problem is that a sequencer may know if one of their votes has been overwritten, for this reason, sequencers reencrypt a certain amount of ballots every time (already existing ballots I mean). So, the circuit should include the reencryptions: both for existing ballots and also for the new votes, which should be reencrypted (for receipt-freeness).} \subsection{Protocol flow} \label{sec:vocdoni-protocol:flow}