zkSnark based random subset voting.
- Install dependencies:
npm install
- Compile the circuit and run the setup
./node_modules/.bin/circom subsenate.circom --wasm --r1cs --sym
./node_modules/.bin/snarkjs setup -r subsenate.r1cs
- Generate inputs (either yourself or using the supplied generate test inputs script)
node generate-test-inputs.js
- Calculate the witness, create and verify the proof.
./node_modules/.bin/snarkjs calculatewitness --wasm subsenate.wasm --input input.json --witness witness.json
./node_modules/.bin/snarkjs proof
./node_modules/.bin/snarkjs verify