arnaucube
arnaucube/davinci-paperPublic Self-hosted repository
work on vote section + comments ballot protocol
bellesmarta belles.mm@gmail.com
Sun, 11 May 2025 10:38:09 +0200
commit

3ff4eb6be2d55e747d4cd106fec5bd2682537fce

parent

62951c44883896c443c9f7121b02442f8d766b28

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

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

+\documentclass[runningheads, draft]{llncs} %\documentclass{llncs} -\documentclass[runningheads, draft]{llncs} +%\documentclass{article} \input{preamble-packages} \input{preamble-macros}

@@ -40,8 +41,8 @@ \makeatletter

\tableofcontents %\pagebreak -\addcontentsline{toc}{section}{Vocdoni} \section*{Vocdoni} +\addcontentsline{toc}{section}{\protect\numberline{}Vocdoni} \label{sec:intro-old} \input{\secs/introduction-old}

@@ -61,11 +62,11 @@ \section{Crytographic primitives} %building blocks

\label{sec:cryptographic-primitives} \input{\secs/cryptographic-primitives} -\section{The Vocdoni voting protocol} +\section{Voting protocol} \label{sec:vocdoni-protocol} \input{\secs/vocdoni-protocol} -\section{The Vocdoni ballot protocol} +\section{Ballot protocol} \label{sec:ballot-protocol} \input{\secs/ballot-protocol}

@@ -86,7 +87,6 @@ \addcontentsline{toc}{section}{\protect\numberline{}Acknowledgments}

\label{sec:acknowledgments} The authors would like to thank the following reviewers and contributors for their valuable feedback and support: all team members from the Vocdoni association, Jordi Baylina (from Iden3 and Polygon), Adrià Maçanet (Privacy Scaling Explorations, Ethereum Foundation), Arnaucube (0xPARC), Alex Kampa (AZKR), Roger Baig (Polytechnic University of Catalonia), Javier Herranz (Polytechnic University of Catalonia), and Jordi Puiggali (Secrets Vault). - % ---- Bibliography ----
M v2/build/preamble-macros.tex → v2/build/preamble-macros.tex

@@ -2,6 +2,8 @@ % !TeX root = main.tex

% Doc sytle \setcounter{secnumdepth}{3} %enumerate sections up to depth 3 (subsubsection) +% Set the first-level itemize label to use math mode \bullet +\setlist[itemize,1]{label=$\bullet$} % Working directory \newcommand{\definedir}[2]{\newcommand{#1}{#2}}

@@ -17,7 +19,7 @@ \newcommand{\paui}[1]{\todo[inline, size=\small, color=blue!40]{\textbf{Pau}: #1}}

\newcommand{\jordi}[1]{\todo[size=\small, color=green!40]{\textbf{Jordi}: #1}} \newcommand{\jordii}[1]{\todo[inline, size=\small, color=green!40]{\textbf{Jordi}: #1}} -% freefootnote +% Freefootnote \let\svthefootnote\thefootnote \newcommand\freefootnote[1]{% \let\thefootnote\relax%

@@ -25,7 +27,22 @@ \footnotetext{#1}%

\let\thefootnote\svthefootnote% } -% Colors +% Table of contents style +% Make section entries bold in ToC +\makeatletter +\renewcommand{\@dotsep}{4.5} +\renewcommand{\l@section}[2]{\addpenalty{\@secpenalty} + \addvspace{1.0em plus 1pt} + \@tempdima=1.5em + \parindent \z@ \rightskip \@pnumwidth + \parfillskip -\@pnumwidth + {\leavevmode + \advance\leftskip\@tempdima + \hskip -\leftskip + \bfseries #1\hfil \hbox to\@pnumwidth{\hss #2}}\par} +\makeatother + +% Colours \definecolor{cred}{rgb}{1, 0.5, 0.5} \definecolor{cgreen}{rgb}{0.5, 1, 0.5} \definecolor{cblue}{rgb}{0.5, 0.5, 1}

@@ -63,11 +80,29 @@ \newcommand{\costexponent}{\ballotstyle{costExponent}}

% Voting protocol \newcommand{\variablestyle}[1]{\texttt{#1}\xspace} +\newcommand{\vote}{\variablestyle{vote}} +\newcommand{\processid}{\variablestyle{processID}} +\newcommand{\censuspf}{\variablestyle{censusProof}} +\newcommand{\commitment}{\variablestyle{identityCommitment}} \newcommand{\nullifier}{\variablestyle{nullifier}} -\newcommand{\commitment}{\variablestyle{commitment}} +\newcommand{\encryptedballot}{\variablestyle{encryptedBallot}} +\newcommand{\zkproof}{\variablestyle{ZKproof}} +\newcommand{\signature}{\variablestyle{signature}} + +% State Merkle tree +\newcommand{\censusroot}{\variablestyle{censusRoot}} +\newcommand{\type}{\variablestyle{type}} +\newcommand{\ballotmode}{\variablestyle{ballotMode}} +\newcommand{\epk}{\variablestyle{encryptionKey}} +\newcommand{\addaccumulator}{\variablestyle{addedResultsAccumulator}} +\newcommand{\substractaccumulator}{\variablestyle{substractResultsAccumulator}} +\newcommand{\addresses}{\variablestyle{addresses}} +\newcommand{\nullifiers}{\variablestyle{nullifiers}} + % Others \newcommand{\noi}{\noindent} +\newcommand{\conc}{\:||\:} % Hyperlinks \newcommand{\hlset}[1]{\hypertarget{\detokenize{#1}}{#1}}

@@ -114,14 +149,14 @@ \newcommand{\usedSequencers}{\vocstyle{usedSequencers}}

\newcommand{\votes}{\vocstyle{votes}} \newcommand{\voteRewrites}{\vocstyle{voteRewrites}} -% misc +% Misc \newcommand{\davinci}{DAVINCI\xspace} \newcommand{\Davinci}{DAVINCI\xspace} -% draft watermark +% Draft watermark %\ifdraft{\SetWatermarkScale{4}}{\SetWatermarkScale{0}} -% new foonote referencing a previous footmark +% New foonote referencing a previous footmark \makeatletter \newcommand\footnoteref[1]{\protected@xdef\@thefnmark{\ref{#1}}\@footnotemark} \makeatother
M v2/build/preamble-packages.tex → v2/build/preamble-packages.tex

@@ -39,4 +39,7 @@

\ifdraft{\usepackage[colorinlistoftodos, textwidth = 40mm]{todonotes}} {\usepackage[disable, colorinlistoftodos, textwidth = 40mm]{todonotes}} -\usepackage{tikz,tikz-cd}+\usepackage{tikz,tikz-cd} +\usepackage{enumitem} + +\usepackage{etoolbox} %table of contents
M v2/sections/analysis.tex → v2/sections/analysis.tex

@@ -59,7 +59,7 @@ However, the design of \davinci incorporates mechanisms that preserve voter anonymity even in the face of future quantum attacks:

\begin{itemize} \item Detachment of identity and encrypted Ballot: The voter's identity and their encrypted ballot are decoupled through the use of a secret in the nullifier. The nullifier is computed as: - $$ N = \text{Hash}(\text{ProcessId} || s) $$ + $$ N = \text{Hash}(\processid \conc s) $$ where is a secret known only to the voter. This means that even if an adversary decrypts the encrypted ballots using a quantum computer, they cannot link a decrypted vote back to a voter's identity in the census without knowledge of the secret $s$. \martai{Instead of ``detachment", I propose ``unlinkability": identity unlinkability.} \item Quantum-resistant hash functions: the \nullifier and \commitment are computed using cryptographic hash functions that are believed to be resistant to quantum attacks (e.g., SHA-3). While Grover's algorithm can provide a quadratic speedup in searching for preimages, using sufficiently long hash outputs (e.g., 256 bits) mitigates this risk.
M v2/sections/ballot-protocol.tex → v2/sections/ballot-protocol.tex

@@ -2,21 +2,23 @@ % !TeX root = ../build/main.tex

\martai{It is not clear what is the advantage of defining a protocol like this. Is it easy because it is easy to implement as an arithmetic circuit? Make the advantage clear.} -The \textit{Vocdoni ballot protocol} is a simple and efficient mechanism for casting and tallying votes in any type of election or collective decision-making process. Each voting process consists of one or several fields and voters are required to provide a response for each of these fields in their ballot. +The \davinci ballot protocol is a simple and efficient mechanism for casting and tallying votes in any type of election or collective decision-making process. Each voting process consists of one or several fields and voters are required to provide a response for each of these fields in their ballot. The responses in the ballot are represented as a sequence of natural numbers, each corresponding to the voter’s choice for the respective field. Results are accumulated into a single array. Each position in the array corresponds to the sum of all votes cast for that field across all voters. -The ballot protocol is defined by a set of configurable variables that dictate how votes must be cast. This way the protocol can accommodate a wide range of voting processes and behaviors. +The ballot protocol is defined by a set of configurable variables that dictate how votes must be cast. This way the protocol can accommodate a wide range of voting processes and behaviors. The list of variables is the following. \begin{enumerate} - \item \maxcount: Defines the maximum number of fields in a ballot (max 64). - \item \maxvalue: The maximum allowable value for any field in a ballot (if greater than 0). - \item \minvalue: The minimum allowable value for any field in a ballot (default 0). - \item \uniquevalues: Specifies whether voters can select the same value multiple times within a ballot (default false). - \item \maxtotalcost: Limits the sum of all field values in a ballot (if greater than 0). - \item \mintotalcost: Specifies a minimum required total sum of field values in a ballot (default 0) - \item \costexponent: Defines the exponent used to calculate the "cost" of votes for each field (default 1 + \item \maxcount: it defines the maximum number of fields in a ballot (max 64). + \item \maxvalue: it is the maximum allowable value for any field in a ballot (if greater than 0). + \item \minvalue: it is the minimum allowable value for any field in a ballot (default 0). + \item \uniquevalues: it specifies whether voters can select the same value multiple times within a ballot (default false). + \item \maxtotalcost: it limits the sum of all field values in a ballot (if greater than 0). + \item \mintotalcost: it specifies a minimum required total sum of field values in a ballot (default 0) + \item \costexponent: it defines the exponent used to calculate the "cost" of votes for each field (default 1). \end{enumerate} + +\martai{"if greater than 0" vs. "default" (make it consistent).} \begin{figure}[H] \centering

@@ -24,8 +26,13 @@ \fbox{

\includegraphics[scale = 0.4, draft = false]{\figs/ballot-variables.png}} \end{figure} +\martai{In Figure: when is says uniqueValues: x, y, z must be different -- this is if uniqueValues = false, right?} + \paragraph{Example 1: Rating candidates.} +\martai{Reorder names Lennon, Hendrix, Joplin alphabetically.} +\martai{In this example, the rest of variables are default, right? E.g. minValue = 0?} + Consider a voting process where voters are asked to rate three candidates: Lennon, Hendrix, and Joplin. Voters rate each candidate from 0 to 5 stars, and each vote is represented as an array where each position corresponds to the candidate’s rating. The configuration of this voting would be the following: \begin{itemize}

@@ -42,6 +49,8 @@ \item Vote 2: \texttt{[4, 3, 2]}

\item Vote 3: \texttt{[2, 4, 5]} \end{itemize} +\martai{I would write 4 ballots.} + After accumulating the votes: \begin{itemize}

@@ -49,6 +58,8 @@ \item Results Array: \texttt{[3+4+2, 2+3+4, 5+2+5] = [9, 9, 12]}\\

Lennon received 9 points, Hendrix received 9 points, and Joplin received 12 points. \end{itemize} +\martai{In the above example, there is no limit to maxTotalCost, right? Maybe add something like, if maxTotalcost = X, then one of the previous ballots would be invalid (and explain why).} + \paragraph{Example 2: Quadratic voting for resource allocation.} In a scenario where voters distribute a fixed number of credits across different options (e.g., selecting funding levels for NGOs), the ballot allows voters to assign multiple points, but the cost of casting multiple votes for a single option increases quadratically.

@@ -68,6 +79,8 @@ \item Vote 1: \texttt{[2, 2, 2, 0]}

\item Vote 2: \texttt{[1, 1, 3, 1]} \item Vote 3: \texttt{[0, 2, 1, 2]} \end{itemize} + +\martai{Add a fourth vote, e.g. [3, 3, 0, 0]. Then mention that the first 3 ballots are ok because $2^2 + 2^2 + 2^2 = 12$, $1^2 + 1^1 + 3^2 + 1^2 = 12$, $2^2 + 1 + 2^2 = 9 < 12$, but $3^2 + 3^2 = 18 > 12$, and therefore it's invalid. Did I get this right?} After accumulating the votes:
M v2/sections/cryptographic-primitives.tex → v2/sections/cryptographic-primitives.tex

@@ -59,6 +59,8 @@

\subsection{Hash functions} \label{sec:cryptographic-primitives:hash} +\martai{Poseidon?} + \subsection{Encryption schemes} \label{sec:cryptographic-primitives:encryption}
M v2/sections/token.tex → v2/sections/token.tex

@@ -1,7 +1,5 @@

% !TeX root = ../build/main.tex -\martai{I suggest to readjust this section to the new paper style.} - \Davinci introduces the Vocdoni token (VOC) as a key element of its decentralized voting ecosystem, playing a crucial role in the protocol's sustainability. The token serves multiple utility functions that align the incentives of all participants (voting organizers, sequencers, and voters) ensuring the integrity, efficiency, and security of the voting system.
M v2/sections/vocdoni-protocol.tex → v2/sections/vocdoni-protocol.tex

@@ -33,18 +33,18 @@

The State tree contains some special addresses (indices) for storing some required data regarding the voting process: \begin{itemize} - \item Address \texttt{0x0}: Process identifier: stores a unique identifier for the voting process. - \item Address \texttt{0x1}: Census Root and Type: contains the information necessary to validate vote proofs. - \item Address \texttt{0x2}: Ballot Mode: encodes rules for validating votes, such as the maximum number of selectable options. - \item Address \texttt{0x3}: Threshold Encryption key: the public key used to encrypt the votes. - \item Address \texttt{0x4}: Added Results Accumulator: stores the aggregated encrypted voting results that need to be added. - \item Address \texttt{0x5}: Subtract Results Accumulator: 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. - \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. + \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. + \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. + \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. + \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. \end{itemize} \begin{figure}[h] - \centerline{\includegraphics[width=400pt,draft=false]{\figs/mt-state}} +sd \centerline{\includegraphics[width=400pt,draft=false]{\figs/mt-state}} \caption{Structure of the state Merkle tree (FIGURE SHOULD BE POLISHED).} \label{fig:mt-state} \end{figure}

@@ -73,127 +73,52 @@

\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{enumerate} - \item Process Identifier - \item Census Proof - \item Identity Commitment - \item Nullifier - \item Encrypted Ballot and Zero-Knowledge Proof (ZKP) - \item Signature -\end{enumerate} - -Below, we detail each component and its role in the voting process. +\begin{align*} + \vote = [ \processid, \censuspf, \commitment, \nullifier, + \encryptedballot, \zkproof, \signature ]. +\end{align*} +\martai{In the code, the struct is just: address, commitment, nullifier and ballot. Check!} -\begin{enumerate} - \item \textbf{Process Identifier} \\ - - The \textbf{Process Identifier} (\texttt{ProcessId}) is a unique 32-byte number that uniquely identifies a specific voting process within the \davinci ecosystem. It encapsulates essential information, including the rules and constraints for ballots and the unique identifier of the \davinci blockchain instance.\\ - - \item \textbf{Census Proof} \\ - - The \textbf{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: - \begin{itemize} - \item \textbf{Merkle Tree-Based Proof}: A Merkle proof showing inclusion in the census. - \item \textbf{Credential Service Provider (CSP)}: A credential issued by a trusted third party. \\ - \end{itemize} - - \item \textbf{Identity Commitment}\\ - - The \textbf{Commitment} $C$ is used to prevent a voter from registering multiple nullifiers and to avoid collisions if different voters choose the same secret. - - $$ C = \text{Hash} (\text{Address} || ProcessId || s). $$ - +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?} + % + \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 \commitment: the identity commitment is used to prevent a voter from registering multiple nullifiers and avoid collisions if different voters choose the same secret. The commitment is computed the following way: + \[ \commitment = \text{Hash}(\text{Address} \conc \processid \conc s)\] + \martai{Link Hash function to function in Section\ref{sec:cryptographic-primitives}.} + {\it Old text: \begin{itemize} - \item \textbf{Stored in State Merkle Tree (SMT)}: Indexed by the voter's address. - \item \textbf{Prevents Multiple Registrations}: Each address can have only one commitment, ensuring a voter cannot register multiple secrets. - \item \textbf{Collision Resistance}: Including the address in $C$ ensures that commitments are unique even if voters choose the same secret $s$. + \item Stored in state Merkle tree (SMT): indexed by the voter's address. + \item Prevents multiple registrations: each address can have only one commitment, ensuring a voter cannot register multiple secrets. + \item Collision resistance: including the address in $\commitment$ ensures that commitments are unique even if voters choose the same secret $s$. \end{itemize} The secret $s$ can be implemented from different ways or a combination of them, such as: \begin{itemize} - \item A secure enough Password introduced by the user. + \item A secure enough password introduced by the user. \item A signature of a specific text. \item A random input that the user must store to allow potential vote overwrite.\\ - \end{itemize} - - \item \textbf{Nullifier} \\ - - The \textbf{Nullifier} $N$ is a 32-byte hash used to: - - \begin{itemize} - \item \textbf{Prevent double voting}: Ensures each voter can cast only one vote or overwrite their previous vote. - \item \textbf{Allow vote overwrite}: Voters can submit a new vote with the same nullifier to replace their previous vote. - \item \textbf{Provide anonymity}: Cannot be linked back to the voter's identity without knowledge of the secret $s$. - \end{itemize} - - $$ N = \text{Hash}(\text{C} || s) $$ - - \item \textbf{Encrypted Ballot and Zero-Knowledge Proof (ZKP)} \\ - - The ballot contains the voter's selections encoded according to the ballot protocol rules. To ensure privacy, the ballot is encrypted using the ElGamal cryptosystem over elliptic curves, which allows homomorphic combination of encrypted votes. - - \textbf{Encryption process}: - - \begin{itemize} - \item The voter's choice $m$ is encoded as a point on the elliptic curve. - \item The voter selects a random scalar $k \in [1, n-1]$, where is the order of the elliptic curve group. - \item Compute the ciphertext components: - \begin{itemize} - \item $C_1 = k \cdot G$ - \item $C_2 = M + k \cdot H$ - \end{itemize} - \item The ciphertext is the pair $(C_1, C_2)$. - \end{itemize} - - - \textbf{Zero-Knowledge Proof (ZKP)}: - - The voter generates a ZKP to prove the correctness of the ballot and encryption process: - - \begin{enumerate} - \item \textbf{Correctness of Encryption}: Ensures the ciphertext $(C_1, C_2)$ is correctly computed from the plaintext message $M$ and random scalar $k$. - \item \textbf{Compliance with Ballot Protocol Rules}: The plaintext vote adheres to the ballot protocol constraints, such as valid choices and allowed number of selections. - \item \textbf{Correct Computation of Commitment and Nullifier}: - \begin{itemize} - \item \textbf{Commitment}: $C = \text{Hash} (\text{Address} || ProcessId || s).$ - \item \textbf{Nullifier}: $N = \text{Hash}(\text{C} || s)$. - \item The voter knows the secret linking the commitment and nullifier. - \end{itemize} - \end{enumerate} - - \textbf{Inputs to the ZKP Circuit}: - - \begin{itemize} - \item \textbf{Public Inputs}: - \begin{itemize} - \item Encrypted Ballot $(C_1, C_2)$. - \item Ballot Protocol Configuration. - \item Encryption Parameters. - \item Voter's Weight - \item Commitment $C$. - \item Nullifier $N$. - \end{itemize} - \item \textbf{Private Inputs}: - \begin{itemize} - \item Plaintext Vote $m$. - \item Secret $s$. - \item Random Scalar $k$. - \item Voter's Address (used internally in the computation of $C$). - \end{itemize} - \end{itemize} - - \begin{figure}[H] - \centering - \fbox{ - \includegraphics[scale = 0.3, draft = false]{\figs/vote-circuit-inputs.png}} - \end{figure} - - \item \textbf{Signature}\\ - - The \textbf{Signature} authenticates the vote and ensures that it 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). -\end{enumerate} + \end{itemize}} + % + \item \nullifier: the nullifier is a 32-byte hash used to prevent double voting. It is computed the following way: + \[\nullifier = \text{Hash}(\commitment || s) \] + \martai{Link Hash function to function in Section\ref{sec:cryptographic-primitives}.} + That is, it ensures that each voter can either cast only one vote or overwrite their previous vote. By means of nullifiers, voters can submit a new vote with the same nullifier to replace their previous vote. Moreover, nullifiers provide users' anonymity, since nullifiers cannot be linked back to the voter's identity without knowledge of the secret $s$. + % + \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$, the vote is encoded as follows: + \[ \encryptedballot = \hlget{\Enc}(m). \] + % + \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}

@@ -213,6 +138,8 @@

\subsubsection{Voter circuit} Figure~\ref{fig:circuit-voter}. + +\martai{ (1) I think that the voter's address should be private, and (2) the vote's weight is missing.} \paragraph{Description.} Generated by the user when casting a vote, this circuit proves that the encrypted ballot is valid (i.e. follows the protocol rules) and that the nullifier and commitment are correctly generated.

@@ -237,6 +164,40 @@ \caption{Voter circuit. All public values are framed in green.}

\label{fig:circuit-voter} \end{figure} + The voter generates a ZKP to prove the correctness of the ballot and encryption process: + +\begin{enumerate} + \item \textbf{Correctness of Encryption}: Ensures the ciphertext $(C_1, C_2)$ is correctly computed from the plaintext message $M$ and random scalar $k$. + \item \textbf{Compliance with Ballot Protocol Rules}: The plaintext vote adheres to the ballot protocol constraints, such as valid choices and allowed number of selections. + \item \textbf{Correct Computation of Commitment and Nullifier}: + \begin{itemize} + \item \textbf{Commitment}: $C = \text{Hash} (\text{Address} || ProcessId || s).$ + \item \textbf{Nullifier}: $N = \text{Hash}(\text{C} || s)$. + \item The voter knows the secret linking the commitment and nullifier. + \end{itemize} +\end{enumerate} + +\textbf{Inputs to the ZKP Circuit}: + +\begin{itemize} + \item \textbf{Public Inputs}: + \begin{itemize} + \item Encrypted Ballot $(C_1, C_2)$. + \item Ballot Protocol Configuration. + \item Encryption Parameters. + \item Voter's Weight + \item Commitment $C$. + \item Nullifier $N$. + \end{itemize} + \item \textbf{Private Inputs}: + \begin{itemize} + \item Plaintext Vote $m$. + \item Secret $s$. + \item Random Scalar $k$. + \item Voter's Address (used internally in the computation of $C$). + \end{itemize} +\end{itemize} + \subsubsection{Authentication circuit} Figure~\ref{fig:circuit-authentication}.

@@ -393,7 +354,7 @@ \caption{Vocdoni voting process overview.}

\label{fig:protocol-flow} \end{figure} -\subsection{Prior to voting (only once)} +\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.}

@@ -416,7 +377,7 @@ \martai{What happens to the collateral? If done only once, then you lose it? Do you need to send a new tx with more collateral?}

\item Send transaction to Sequencer registry smart contract (pay for tx fee). \end{enumerate} -\subsection{Start of the voting process} +\subsubsection{Start of the voting process} \label{sec:vocdoni-protocol:start} The organizer:

@@ -430,7 +391,7 @@ \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} -\subsection{Key generation process} %Voting key generation +\subsubsection{Key generation process} %Voting key generation \label{sec:vocdoni-protocol:dkg} The sequencer:

@@ -449,7 +410,7 @@ \martai{I understand EPK becomes available in the SR smart contract, and that key is sent to the PM contract?}

\martai{The idea here is that some sequencer makes EPK available (a.k.a. sends a transaction). Alternatively, generate a SNARK proving the EPK has been generated correctly and the SC verifies it.} \end{itemize} -\subsection{Voting process} +\subsubsection{Voting process} \label{sec:vocdoni-protocol:voting} Voter:

@@ -492,7 +453,7 @@ \item Ensure the origin root corresponds to the current stored state root.

\item Confirm that the blob hash matches the one stored in Ethereum. \end{itemize} -\subsection{Results validation} +\subsubsection{Results validation} \label{sec:vocdoni-protocol:validation} Once the voting is completed (I understand the timeout set by the organizer expires), the following things happen.

@@ -517,5 +478,5 @@ \item Use the zkSNARK state proof and publicly available data on-chain to ensure the integrity and correctness of the entire voting process.

\martai{elaborate on this.} \end{itemize} -\subsection{Finalization of the voting process} +\subsubsection{Finalization of the voting process} \label{sec:vocdoni-protocol:finalization}