arnaucube
arnaucube/davinci-paperPublic Self-hosted repository
davinci-paper/v2/sections/ballot-protocol.tex
v2/sections/ballot-protocol.texRaw
 1% !TeX root = ../build/main.tex
 2
 3The ballot protocol provides a unified and parametric way to represent a wide range of voting systems within \davinci. Instead of designing a separate circuit for each voting rule, the protocol defines ballots as fixed-length arrays of integers, subject to a small set of configurable parameters. These parameters constrain the values that can appear in each field of the ballot and the aggregate properties of the ballot as a whole. By adjusting these parameters, the same circuit can implement approval voting, ranking, quadratic voting, multiple choice, and many other schemes. In the protocol we refer to the different configurations as the \emph{ballot mode} ($\ballotmode$). This abstraction has two key advantages. First, it allows a broad variety of voting systems to be supported with a minimal circuit design, avoiding conditional logic that would otherwise increase constraint counts. Second, it provides a common interface for tallying, since all ballots are aggregated into a single results array regardless of the voting mode. 
 4
 5\paragraph{Definition of parameters.} 
 6%Each ballot is defined as an array of integer values subject to the following configurable parameters:
 7Each ballot is defined as an array of integer values subject to a set of configurable parameters, illustrated in Fig.~\ref{fig:ballot-variables}. These parameters are defined as follows:
 8\begin{itemize}
 9	\item \numfields: the maximum number of fields (i.e., options) in the ballot (by default, $\numfields = 16$).  
10	\item \minvalue: the minimum value that each field in the ballot can take.  
11	\item \maxvalue: the maximum value that each field in the ballot can take.  
12	\item \uniquevalues: a Boolean flag indicating whether all field values must be different (as in ranking systems).  
13	\item \costexponent: the exponent applied when computing the cost of casting votes in a field. This parameter enables quadratic or higher-order voting rules.  
14	\item \minvaluesum: the minimum allowed total sum of a ballot, computed as $\sum_{i=1}^{\numfields} v_i^{\costexponent}$, 
15	where $v_i$ are the field values.  
16	\item \maxvaluesum: the maximum allowed total sum of a ballot, computed as $\sum_{i=1}^{\numfields} v_i^{\costexponent}$, where $v_i$ are the field values (e.g., to enforce a budget of credits).  
17\end{itemize}
18%\begin{itemize}
19%	\item \numfields: the maximum number of fields (i.e., options) in the ballot.
20%	\item \minvalue, \maxvalue: the allowable range for each field value.
21%	\item \uniquevalues: a Boolean flag specifying whether all field values must be distinct (as in ranking systems).
22%	\item \costexponent: the exponent applied when computing the cost of casting votes in a field; this parameter enables quadratic or higher-order voting rules.
23%	\item \minvaluesum, \maxvaluesum: bounds on the total sum of all field values in a ballot (e.g., to enforce a budget of credits).
24%\end{itemize}
25
26\vspace{-0.5cm}
27\begin{figure}[H]
28	\centering
29	\includegraphics[scale = 0.8, draft = false]{\figs/ballot-variables.pdf}
30	\caption{Schematic representation of the parameters that define a ballot in \davinci.}
31	\label{fig:ballot-variables}
32\end{figure}
33\vspace{-1cm}
34
35\paragraph{Definition of constraints.} Given a ballot with $n$ fields and each field filled with a value $v_i$ for $i = 1, \dots, n$, we enforce the following constraints (captured in Fig.~\ref{fig:ballot-variables}):
36
37\begin{itemize}
38	\item $\numfields = n$,
39	\item If $\uniquevalues = \true$, then $v_i \neq v_j$ for all $i\neq j$.
40	\item $\minvalue \leq v_i \leq \maxvalue$ for all $i\in\{1, \dots, n\}$.
41	\item $\minvaluesum \leq \sum_{i=1}^n v_i^{\costexponent} \leq \maxvaluesum$.
42\end{itemize}
43
44\paragraph{General mechanism.}
45A ballot is valid if and only if all the above constraints are satisfied. Invalid ballots are rejected at the circuit level and do not contribute to the tally. Valid ballots are aggregated into a results array, where each entry is the sum of all votes cast for the corresponding field across all voters. Voter weights, defined in the census tree (see Section~\ref{sec:vocdoni-protocol:census}), are taken into account when computing these sums. By default, all voters have the same weight, but the protocol also supports weighted voting, where different participants may contribute proportionally to their assigned voting power. In this case, \maxvaluesum\ reflects the maximum weight assigned to each voter, and the ballot and verifier circuits enforce that the correct weight is being used (see Sections~\ref{sec:vocdoni-protocol:circuits:ballot} and~\ref{sec:vocdoni-protocol:circuits:verifier} for further details).
46
47\paragraph{Ballot modes.} 
48Ballot modes correspond to different voting systems, each adjusted with the variables above ballot configurations. For usability, the organizer does not need to set every parameter manually: instead, they simply select one of the predefined ballot modes (e.g., quadratic voting, ranking, approval), each corresponding to a fixed parameter configuration. Some representative modes are shown in Fig.~\ref{fig:ballot-modes}, which illustrate the expressiveness of the ballot protocol. For example, in \emph{approval voting}, each field is binary and voters can approve or reject multiple options simultaneously. In \emph{ranking}, fields must form a permutation of the integers from $1$ to $N$, enforcing uniqueness of values. In \emph{quadratic voting}, voters allocate credits across options, and the cost is quadratic in the number of credits used, captured by setting \costexponent$=2$. Other systems such as single-choice or multiple-choice elections are special cases of the same framework. The figure also illustrates examples of voters' ballots, with the last column indicating whether each ballot is valid or invalid under the rules of the selected mode.
49
50%\begin{landscape}
51\begin{figure}[h]
52	\centerline{\includegraphics[width=\textwidth,draft=false]{\figs/ballot-protocol-table.png}}
53	\caption{Table showing various voting models using different ballot configurations. Each row corresponds to a voting system specified by a fixed configuration of the ballot parameters (\numfields, \minvalue, \maxvalue, \uniquevalues, \costexponent, \minvaluesum, \maxvaluesum). The table also includes example ballots for each mode, illustrating how the constraints are enforced in practice. The last column indicates whether a ballot is valid (1) or invalid (0) under the rules of the selected mode.}
54	\label{fig:ballot-modes}
55\end{figure}
56%\end{landscape}