Privacy preserving governance mechanism using zero knowledge for proof of merkle inclusion.

Overview

Zero Knowledge Private Voting V1

Motivation

On-chain governance today is fully transparent at the cost of privacy. This means that every proposal and vote can be trivially mapped to the public key who cast that vote. And because the entire transaction history of each wallet is public on chain, it is difficult to seperate the key identity from IRL identity.

In todays on-chain governance, a contrarian voter may have their decision swayed if they feared social backlash from the community. This demo implementation shows how you can use zero-knowledge proofs to anonymize the sender of a vote or proposal while still maintaining authorization rules.

How does it work?

This project heavily leans on the semaphore library which provides the contracts to verify a merkle proof of inclusion along with the js libraries to generate the proofs in browser.

The demo uses a zero-knowledge proof of inclusion in a set of holders of an NFT collection without revealing the id of the token they own or their public key. First a user that holds the NFT will have to register their identity with the smart contract by submitting a identityCommitment, this is then appended to the on-chain merkle tree.

I am in this set, but I will not tell you which one I am. Instead, I will provide a proof that I could ONLY produce if I have the private key that is associated with one of the registered identities.

merkle

Next Steps

  1. The end goal for this project is to have a full on-chain governance that has optional or default privacy features. To acheive this goal, we plan on forking the Governor Bravo contracts to use this merkle inclusion proof as the authentication mechanism.

  2. In traditional democratic voting systems, votes are cast privately and accumulated before any results are publicly announced. An additional commit-reveal scheme could be used in tandem to the private voting to enable this feature in an on-chain governance system as well.

  3. The current system uses a 1 token = 1 vote scheme, this was primarily for simplicity in the POC. Eventually, there should be a way to vote based on your actual voting power and all at once. The downside of allowing users to vote with their exact token balance is that it might reveal some information about who is casting the vote. An alternative strategy could be allow votes in uniform "chunks" so that no single vote transaction stands out from the rest.


Installation

Clone the repository

git clone [email protected]:BlockchainCapital-dev/zk-vote.git

Install the dependencies

cd zk-vote
yarn install 

Run local hardhat instance and deploy the contracts

yarn chain 
yarn deploy 

Generate types for contracts:

yarn contracts:build

Launch the frontend demo

yarn start

Disclaimer

Contracts written here are un-audited and are presented for demonstration purposes only. These contracts are not considered production ready. If you or your team is looking to implement on chain governance with privacy features, reach out to [email protected]

You might also like...

Hemsida för personer i Sverige som kan och vill erbjuda boende till människor på flykt

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

May 3, 2022

Kurs-repo för kursen Webbserver och Databaser

Webbserver och databaser This repository is meant for CME students to access exercises and codealongs that happen throughout the course. I hope you wi

Jan 3, 2023

A Drag-and-Drop library for all JavaScript frameworks implementing an enhanced transformation mechanism to manipulate DOM elements

A Drag-and-Drop library for all JavaScript frameworks implementing an enhanced transformation mechanism to manipulate DOM elements

JavaScript Project to Manipulate DOM Elements DFlex A Drag-and-Drop library for all JavaScript frameworks implementing an enhanced transformation mech

Jan 8, 2023

A fast, safe and easy caching mechanism similar to Redis written in typescript

Viper Viper is a memory based caching mechanism which is aimed towards ease of use and speed. It's in a very early stage right now and not meant to us

Jan 24, 2022

In our last repo we learnt how to create a DAO on your own and how to use governance tokens and NFTs for voting purposes.

In our last repo we learnt how to create a DAO on your own and how to use governance tokens and NFTs for voting purposes.

In our last repo we learnt how to create a DAO on your own and how to use governance tokens and NFTs for voting purposes. Now we will be stepping into the world of games with NFTs where a user has to play games with their character being an NFT which has unique powers, unique traits etc etc.

Oct 1, 2022

Tell your crush you like them with zero-knowledge

Tell your crush you like them with zero-knowledge

zk-Crush zk-Crush is a way to tell your crush you like them with zero-knowledge. Disclaimer Note this project was mostly meant as a joke, it's not tru

Jan 2, 2023

Zero-Knowledge OTP verification on chain

zkOTP: Zero-Knowledge OTP verification on chain Motivation Inspired by SmartOTP and Modulo's 1wallet, a zkOTP solution can manage access to a smart co

Dec 22, 2022

The zkPass browser extension can proxy three parties TLS and generate zero-knowledge proofs

zkPass Extension zkPass a Chromium extension which can proxy three parties TLS and generate zero-knowledge proofs. Technology Dependence Multi-party c

Nov 1, 2022

2FA with Zero-Knowledge proofs

2FA with Zero-Knowledge proofs

zkAuth 🗝️ 🔗 Zero-Knowledge protected onchain two-factor Authentication This project provides 2FA for EVM blockchains, compatible with the broadly ad

Dec 26, 2022
Owner
Blockchain Capital
Blockchain Capital in house engineering public repository.
Blockchain Capital
Dapp example for airdropping ERC-20 tokens using World ID, preserving privacy for the claimers with zero-knowledge proofs.

World ID Example - Mesha Airdrop This repository contains an example decentralized application (dapp) for World ID. With Mesha Airdrop test airdroppin

Worldcoin 14 Dec 16, 2022
DecentraMix.io is a cross-chain, non-custodial, universal privacy-preserving protocol with the decentralized governance

DecentraMix.io is a cross-chain, non-custodial, universal privacy-preserving protocol with the decentralized governance. DecentraWorld applies zkSNARKs to enable transactional privacy for all DeFi components by breaking the on-chain link between depositor and recipient addresses.

DecentraWorld Ecosystem 65 May 7, 2022
Solidity NFT whitelist contract example using MerkleTree.js for constructing merkle root and merkle proofs.

MerkleTree.js Solidity NFT Whitelist example Allow NFT minting only to whitelisted accounts by verifying merkle proof in Solidity contract. Merkle roo

Miguel Mota 65 Dec 29, 2022
Been interested, studying, and developing blockchain security with a Zero Knowledge Proof (ZKP) and create a prototype on the current issue with Philippine's upcoming election. 📥

Implementation of Zero Knowledge Proofs in Cryptographic Voting ?? Reference: Cryptographic Voting – A Gentle Introduction Overview ????‍?? The main i

Karl Joseph Saycon 2 Apr 11, 2022
An Opensource Peer-to-peer Social Network with Zero-Knowledge-Proof based authentication.

HexHoot This is an attempt to create an Opensource Peer-to-peer Social Network with Zero-Knowledge-Proof based authentication. The objective is to dem

Zenin Easa Panthakkalakath 6 Dec 28, 2022
The classical game of Liar's Dice enhanced with the usage of Zero-Knowledge Proof

Liar's Dice An online multiplayer game showcasing the potential of Aleo's Zero Knowledge Proof platform. Local deployment Prerequisites Setup dnsmasq

Kryha 4 Dec 15, 2022
The classical game of Liar's Dice enhanced with the usage of Zero-Knowledge Proof

Liar's Dice An online multiplayer game showcasing the potential of Aleo's Zero Knowledge Proof platform. Local deployment Prerequisites Setup dnsmasq

Kryha 3 Oct 20, 2022
Privacy Pass: a privacy-enhancing protocol and browser extension.

Privacy Pass Extension The Privacy Pass protocol is now being standardised by the privacypass IETF working group. All contributions are welcome! See t

Privacy Pass Team 1.1k Jan 7, 2023
There can be more than Notion and Miro. Affine is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.

AFFiNE.PRO The Next-Gen Knowledge Base to Replace Notion & Miro. Planning, Sorting and Creating all Together. Open-source, Privacy-First, and Free to

Toeverything 12.1k Jan 9, 2023
Grupprojekt för kurserna 'Javascript med Ramverk' och 'Agil Utveckling'

JavaScript-med-Ramverk-Laboration-3 Grupprojektet för kurserna Javascript med Ramverk och Agil Utveckling. Utvecklingsguide För information om hur utv

Svante Jonsson IT-Högskolan 3 May 18, 2022