Onchain Anonymous Voting demo.
TL;DR: users vote onchain by sending a zk-proof where they prove that they belong to the census without revealing who they are in it.
This project builds on top of OAV circuits, which follows a similar design done in vocdoni/zk-franchise-proof and Semaphore. The census in this project is compatible with OVOTE census, and a similar circuit design but implemented in arkworks can be found at ark-anon-vote.
Target:
Users send their vote + zk-proof to the smart contract, proving that they belong to the census (without revealing who they are) and that their vote has not been already casted.
The census is build from the public keys of the DAO members.
Each user computes a zk-proof which will be verified onchain. Proof proves:
Circuit (grey background indicates public inputs):
sequenceDiagram
participant user
participant census_builder
participant Eth
participant IPFS
par Census creation phase
user->>user: gen key
user->>census_builder: pubKey
census_builder->>census_builder: build census
census_builder->>IPFS: publish census
and Process creation phase
census_builder->>Eth: new process
user->>Eth: get process
Eth-->>user: process.census-ipfs-hash
and Voting phase
user->>IPFS: get census by ipfs-hash
IPFS-->>user: census
user->>user: generate zk-census-proof
user->>Eth: vote + zk-census-proof
Eth->>Eth: verify zk-census-proof & process vote
end