Inspiration 💡

Fair elections are the foundation of a democracy. Yet in the 2020 U.S. Presidential Election, America faced a crisis of trust. Donald Trump claimed the election was stolen was stolen from him, and Joe Biden claimed he won fairly. Both sides raised concerns that, fundamentally, could not be fully disproven, because traditional election systems rely on trust, and not on cryptographic proof.

VerifiedVote

We can't afford elections that not everyone believes in.

Fortunately for us, we now have advanced cryptographic technology like zkSNARKs (zero-knowledge proofs) which allow us to do mathematical verification that an action, like casting and counting a vote, happened correctly without exposing personal information or requiring blind trust.

I realized that this was the perfect opportunity to use zkSnark technology to restore election confidence in America.

By allowing voters to verify that every vote was counted correctly, without revealing who voted for who, we can move past the era of accusations and division, and make sure that elections stay fair and trusted for future generations of Americans.

What it does ⚡

Voters cast their ballots securely and anonymously on the blockchain. When a voter casts their vote, it's encrypted and recorded on a public Ethereum smart contract which ensures no one can tamper with or alter the votes. The system uses zero-knowledge proofs (zkSNARKs) to verify each vote is valid without revealing who the voter chose. By conducting elections this way, every citizen can trust that the election was conducted fairly, without needing to trust a central authority.

UX Flow 🗳️

Below is a high level flow diagram showing how VerifiedVote handles secure voting and result verification. I’ve also summarized the key steps in short bullets underneath.

Voter Voting UX

Voting Flow

  • Voter connects their wallet.
  • Voter submits their encrypted vote to Ethereum, backed by a zero-knowledge proof.
  • Smart contract verifies proof and saves the encrypted vote anonymously.

Trustee Proof Generation Flow

  • Trustee connects their wallet to trustee portal.
  • Trustee decrypts ballots and generates zkSnark proof that shows the winner without revealing individual votes.
  • Trustee creates and deploys a Verifier.sol contract.
  • Trustee shares the Verifier contract address and proof files with voters.

Proof Verification Flow

  • Voter connects their wallet.
  • Voter uploads the proof.json, public.json, and Verifier contract address.
  • Voter verifies election results independently.

How I built it 🛠️

First of all, I want to say that I had so much fun working on this project! 💙 I wanted to build something that could solve one of the biggest challenges facing our society today, fair and trustworthy elections. The project is broken down into a couple main parts:

Front-end: Next.js, Tailwind CSS, Typescript

Smart Contracts: Solidity (I deployed and tested them with Hardhat)

Zero-Knowledge Proofs: I used circom, snarkjs, and custom zkSNARK circuits

Encryption: Poseidon Hash (poseidon-solidity)

Blockchain: Ethereum

Wallet Integration: MetaMask and ethers.js

Design 🎨

I used a version of the Double-Diamond design process I learned from hacking at previous hackathons. This helped me go from defining the problem to delivering an outcome.

double design pattern

Challenges I ran into 🧗

I faced some challenges during the hackathon, mainly related to learning new libraries I needed for my project.

Accomplishments that I'm proud of 🏆

I'm so proud of finishing this project on time and learning so much about cryptography! I was able to realize my vision which means a lot since this was my first time making a project with ZKSnarks.

I think this tech is so cool that its a perfect fit for building a fair election system. I hope that people are inspired to think about how cryptography can solve real world problems!

What I learned 📚

VerifiedVote was really fun to work on! I learned about zero-knowledge proofs and how to make a circuit to generate proofs about inputs. I also learned how cryptographic systems can synergize with blockchain technology like Ethereum.

I gained more experience making fullstack applications using Next.js, writing Solidity smart contracts, and designing web3 user experiences.

And I think most importantly, how crucial it is to make complex technology accessible and easy to use so that everyone can enjoy the benefits.

What's next for VerifiedVote 🚀

VerifiedVote's plans include:

  • Launching on a Public Ethereum Testnet for wider community testing
  • Integrating optimistic or ZK rollups to greatly reduce gas costs and allow millions of voters to participate cheaply
  • Exploring partnerships with civic organizations to make trustless voting accessible for everyone.

Built With

  • circom
  • ethereum
  • ethers.js
  • hardhat
  • metamask
  • next.js
  • snarkjs
  • solidity
  • tailwindcss
  • typescript
  • zksnarks(zero-knowledge-proofs)
Share this project:

Updates