Skip to content

JavaScript library for anonymous voting on Ethereum blockchain using zero-knowledge proof

License

Notifications You must be signed in to change notification settings

ShaojieH/zk-merkle-tree

 
 

Repository files navigation

zk-merkle-tree

This package is a fork of zk-merkle-tree with support for using one nullifier multiple times.

The library is based on the source code of Tornado Cash. The most essential component of TC is a Merkle tree where users can deposit ethers with a random commitment, that can be withdrawn with a nullifier. The nullifier is assigned to the commitment, but nobody knows which commitment is assigned to which nullifier, because the link between them is the zero-knowledge. This method can be also used for anonymous voting, where the voter sends a commitment in the registration phase, and a nullifier when she votes. This method ensures that one voter can vote only once.

For more info, please read Laszlo Fazekas's article on Medium about the original library.

Usage

When constructing ZKTree, use nullifierUseCount to limit the number of times a nullifier can be used. Check Original repository for details.

About

JavaScript library for anonymous voting on Ethereum blockchain using zero-knowledge proof

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 49.4%
  • Solidity 37.1%
  • Circom 10.4%
  • Shell 3.1%