private_vote Circuit
private_vote lets a token holder cast a boolean vote while proving eligibility (balance at least a
threshold), committing to both the balance and the vote with Poseidon — without revealing the
balance or linking the vote to an identity. Size: k=11.
What it proves
For the witnesses below and a public threshold, the circuit proves:
balance_commitment = Poseidon(balance, randomness_balance).vote_commitment = Poseidon(vote, randomness_vote).vote ∈ {0, 1}— the vote is boolean.balance ≥ threshold— voter eligibility, without revealing the balance.
Witness
private_vote.json
{
"balance": "500",
"randomness_balance": "11",
"vote": "1",
"randomness_vote": "22",
"threshold": "100"
}
| Field | Type | Visibility | Description |
|---|---|---|---|
balance | u64 | private | Voter's token balance |
randomness_balance | field | private | Commitment randomness for balance |
vote | u64 | private | Boolean vote value (0 or 1) |
randomness_vote | field | private | Commitment randomness for vote |
threshold | u64 | public | Minimum balance required to vote |
Public inputs
| Input | Description |
|---|---|
balance_commitment | Poseidon(balance, randomness_balance) |
threshold | Public eligibility threshold |
vote_commitment | Poseidon(vote, randomness_vote) |
note
The current circuit exposes the commitments and threshold as public inputs; it does not expose a
nullifier, so double-vote prevention would be enforced by the surrounding contract (e.g. a
registry of balance_commitments).