Inspiration

As we know current decentralized voting system uses a public address to vote on important DAO discussions or proposals. Which doesn't protect voter privacy and voting. Even though it is publicly stored on the blockchain so anyone can see who votes on which proposal by decoding events. This limitation can be overcome by Zero Knowledge.

What it does

This application allows DAOs to create a new voting process or to vote on already existing processes. In order to vote users need to register their identity using Discord. Registration is done with the use of Semaphore smart contracts. User’s IdentityCommitment is stored on-chain, but their identity remains private. As we are using Discord as an authentication layer DAOs need to register their Discord server Id and the Discord role so members belonging to that role will be eligible to join DAO on the platform. Once all members Joined DAO on the platform the DAO admin will create the proposal. We have three activities before/after starting the voting process. Firstly, the admin has to add voters to that proposal. Secondly, the admin has to start the poll with an encryption key. Now, Voter able to start the voting process. When casting a vote, proof of registration is created and verified by Semaphore smart contract. Users only get access to the voting page and get voting rights after the user is verified by the Discord role. Users are not allowed to vote on the same voting process twice. Double voting is disabled with the use of external nullifiers (voting process id). Nullifier hash (hash of external nullifier and identity nullifier) is stored on-chain and checked every time voting happens, which prevents double voting. Thirdly, the admin ends the poll once the voting process is completed. Now anyone can see the result of voting on that proposal.

How we built it

We used the Polygon chain to implement MVP because the community growing fast and don't have many DAO tool which uses Zero-Knowledge for the voting process to prevent discrimination and possible conflicts inside DAO. Also used Discord as an authentication layer to generate identity and identityCommitment is stored on-chain. Used semaphore protocol as a base layer for the application. We have four components in the project web app, relay, smart contract and IPFS.

  1. Web app is used for user interaction.
  2. Relay used for relaying transactions.
  3. Smart contract has business logic for the application.
  4. IPFS used for storing all proposal. Also used the zero-knowledge library to create ZK proof.

Challenges we ran into

As we know zero knowledge is new technology and information is not available easily on the internet. So understanding the ZK stack and implementing the voting system is much more difficult than a normal smart contract. While integrating the ZK library with react is also challenging. Generating ZK proof with the ZK library is also very difficult.

Accomplishments that we're proud of

Before I started work on the hackathon I don't have believed that by this time I would have a fully operational ZK voting system. I have enjoyed working on the ZK stack and completing the voting application.

What we learned

I learned ZK technology. And know how it solves privacy issues with the current web3 system. Also learned how the ZK library and circuit work with the smart contract and react js. It's fun to play with new technology.

What's next for Polygon ZKVote

Possible features to be added:

Adding the discord bot to get all the candidates from the DAO into a list. Adding time lock features to end votes at a certain interval. Adding funds inside a wallet to automate proposal payout once 80% vote has been reached. Adding basic template(s) for adding custom polls.

Built With

Share this project:

Updates