Secret Ballot zkApp

You need to login in order to like this zkApp. Click Here

Secret Ballot zkApp

You need to login in order to like this zkApp. Click Here

Secret Ballot SnarkyJS Hackathon hosted by RDI at UC Berkeley: For more info on this hackathon visit https://zk-hacking.org/tracks/zk_snarkyjs_track (from the github readme file) We implement a private voting zkapp. The idea was to try to implement single stage private voting, say like on Twitter- one where participants do not need to register to vote first, as was done in Minataur. In a voting procedure with a registration step, users are required to make sure that sufficiently many people have signed up for voting before them but not voted and also that sufficient time has passed between their registration and voting transactions, so that their vote may be private. This can be difficult. Further, it seemed like bad UX. In our implementation, a centralized party (let’s assume honest for now) sets up the voting contract (called secretBallot), which includes as state variables: a randomly chosen ballot_ID the root of the Merkle tree containing the hash of public keys contained in the list of voters the root of a Merkle tree storing the votes for different options a MerkleMap storing nullifiers (hash(private_key, ballot_ID)), which record whether a key has been used for voting or not. In order, to vote, the user controlling the key pair (sk, pk) (secret/private key, public key) proves to the contract that: hash(pk) belongs in the voter list pk is derived from sk the hash(sk, ballot_ID) has not been used to vote before: nullifierMap[hash(sk, ballot_ID)] = 0. Together these 3 imply that the user controls a sk which is eligible to vote but has not been used to vote yet (Note that we are placing some assumption on the amount of information that is leaked by these hashes, especially if the same sk is used for multiple votes). The user also needs to provide the correct witness and the number of votes for the option, he chooses to vote for Developer Contact Info GitHub: https://github.com/goforashutosh/secretballot https://www.youtube.com/watch?v=iIrP-sGPlCw