This is the proof of concept of our paper "Dispute-free Scalable Open Vote Network using zk-SNARKs"
- Install Nodejs
- Install Circom 2.0
- Install Truffle Framework:
npm install -g truffle
- Install Ganache-cli:
npm install -g ganache-cli
- Clone this repository and change directory to its path
- Install the required packages
npm i
-
cd build
-
Run
./setup.sh -d [DESIGN_TO_BE_USED] -n [NUMBER_of_VOTERS]
where[DESIGN_TO_BE_USED]
could be:original
: Our original proposed designsha256
: The first enhancement using Sha256progressiveSha256
: The second enhancement using Sha256progressivePoseidon
: The second enhancement using Poseidon
For example
./setup.sh -d "original" -n 3
-
Check the test code in the file
test/completeTest.js
-
Run the local Ethereum node:
ganache-cli -l 30e6 -a [[NUMBER_of_VOTERS + 2]]
-
Run the command
truffle test
to view the result and the gas cost of each transaction
- You may need to update the variable
powersOfTau
inbuild/setup.sh
based on the number of constraints generated by the circuits. - You can find the suitable powerOfTau in https://github.com/iden3/snarkjs#7-prepare-phase-2(https://github.com/iden3/snarkjs#7-prepare-phase-2)