% !TeX root = ../build/main.tex The census defines the set of eligible voters and their associated voting weights. Throughout the protocol, the census is represented by a lean incremental Merkle tree of fixed depth, as defined in Section~\ref{sec:cryptographic-primitives:merkle-trees}, and denoted by $\hlset{\censusTree}$. Voters are inserted sequentially into the tree: each new eligible voter occupies the next available leaf, and that leaf stores both their Ethereum address (or another unique identifier) and their voting weight. While the default weight is one, the protocol also supports weighted voting, where different participants may have different voting power. % To ensure verifiability, only a commitment to the census (the Merkle root) is required on-chain. During the voting period, sequencers provide Merkle membership proofs showing that voters addresses and weights are included in the committed census. These proofs are verified inside \ac{ZK} circuits, ensuring that eligibility checks occur privately. This approach provides a compact and scalable mechanism for attesting voter eligibility while keeping on-chain storage minimal. \Davinci does not prescribe how the census must be constructed. Organizers may derive it from internal membership lists (e.g., CSV files or databases), self-sovereign identity credentials, or Ethereum-based tokens (e.g., ERC-20 or NFTs) whose balances define eligibility. In token-based settings, the census may be built using an optimistic snapshot at a chosen block or via a \ac{ZK} proof that validates balances using Ethereum storage proofs. This flexibility allows the \davinci protocol to accommodate a wide range of use cases, from private associations to decentralized communities, while maintaining the same security and verifiability guarantees. In practice, the protocol distinguishes Merkle-tree-based census configurations according to their origin (off-chain or on-chain) and whether they are static or dynamic (i.e., allow adding new members during the voting period). Beyond these, \davinci also offers a credential-based census model in which eligibility is certified by a signature issued by a \ac{CSP} rather than a Merkle proof. To support all these configurations, the \hlget{\electionregistry} smart contract defines the following parameters: \begin{itemize} \item \censusorigin: the deployment model (off-chain static, off-chain dynamic, on-chain dynamic, or CSP). \item \censusuri: a \ac{URI} pointing to an external reference (URL, GraphQL endpoint, CDN path, IPFS/IPNS, etc.) from which sequencers can download or query the census data. \item \censusroot: the on-chain commitment whose meaning depends on the census model (Merkle root, census contract address, or \ac{CSP}'s public key). \end{itemize} Below, we describe each census model. \paragraph{Off-chain static census.} In this model, the organizer constructs a fixed census before the election begins. The incremental Merkle tree is built locally, its root is stored in \censusroot, and \censusuri provides a \ac{URI} from which sequencers can download the full tree. Since the census is static, no updates occur during the voting period. \paragraph{Off-chain dynamic census.} Here the Merkle tree remains off-chain, but the organizer may append new voters during the voting period (never deleting voters or modifying weights, as this would allow double voting). Each update produces a new Merkle root, which the organizer must publish to the \hlget{\electionregistry} contract by updating the parameter \censusroot. As in the off-chain static model, \censusuri provides a \ac{URI} from which sequencers can download the current version of the tree. Sequencers verify membership proofs against the most recently published root, ensuring consistency with the organizer’s commitment. \paragraph{On-chain dynamic census.} In this configuration, the census is managed by a dedicated on-chain contract (\hlget{\censusmanagement}) that allows adding new members during the voting period. The address of this contract is stored in \censusroot, while \censusuri points to an external representation of the tree (e.g., a GraphQL endpoint or CDN). The \hlget{\censusmanagement} contract maintains a history of valid Merkle roots. Sequencers may therefore use membership proofs referencing older roots, and during state transitions the \hlget{\electionregistry} contract queries the \hlget{\censusmanagement} contract to verify that the root used in the proof is recognized as valid. As in all dynamic models, only additions to the census are permitted. \paragraph{Credential service providers.} This model replaces the Merkle-tree-based census with eligibility credentials issued by a trusted entity. Instead of a Merkle proof, the voter presents a digital signature from a \ac{CSP} attesting to their membership. In this case, \censusroot stores the \ac{CSP}’s public key, and \censusuri specifies the endpoint where voters can obtain their credential. Sequencers verify eligibility by checking the \ac{CSP} signature directly. This model applies when eligibility is managed externally through attested identities.