privacy-scaling-explorations / maci

Minimal Anti-Collusion Infrastructure (MACI)
https://maci.pse.dev/
Other
509 stars 130 forks source link

Error: generated an invalid proof #390

Closed baumstern closed 2 years ago

baumstern commented 2 years ago

Couldn't generate proof with https://github.com/appliedzkp/maci/tree/fix/v1-tally-bug-Q branch.

Error log

fromBlock = 0
Generating proofs of message processing...
Error: generated an invalid proof

Reproduction procedure

cd maci/cli
./test.sh

node build/index.js genProofs -x 0xf204a4Ef082f5c04bB89F7D5E6568B796096735a \
    -sk macisk.49953af3585856f539d194b46c82f4ed54ec508fb9b882940cbe68bbc57e59e \
    -o 0 \
    -r ~/rapidsnark/build/prover \
    -wp ./zkeys/ProcessMessages_10-2-1-2_test \
    -wt ./zkeys/TallyVotes_10-1-2_test \
    -zp ./zkeys/ProcessMessages_10-2-1-2_test.0.zkey \
    -zt ./zkeys/TallyVotes_10-1-2_test.0.zkey \
    -t tally.json \
    -f proofs/

Environment

OS: Ubuntu 21.04 (ami: ami-003011dcd025746b3 on ap-northeast-2 region of AWS) Node.js: 16 circom: 2.0.3 rapidsnark: https://github.com/iden3/rapidsnark/commit/1c13721de4a316b0b254c310ccec9341f5e2208e zkeys: https://macitestcircuits.blob.core.windows.net/test/ProcessMessages_10-2-1-2.test.0.zkey https://macitestcircuits.blob.core.windows.net/test/TallyVotes_10-1-2.test.0.zkey witness: generated freshly using default config

baumstern commented 2 years ago

@daodesigner

johnson86tw commented 2 years ago

@gurrpi It seems that you're using the zkey files from the documentation. Maybe you should generate new zkey files.

baumstern commented 2 years ago

@gurrpi It seems that you're using the zkey files from the documentation. Maybe you should generate new zkey files.

I tried but it still fails with the same error.

johnson86tw commented 2 years ago

@gurrpi This branch works for me to generate proofs when I use docker container. Maybe you can check out my branch and the Dockerfile settings to get some clues. https://github.com/chnejohnson/maci/blob/maci-v1/Dockerfile

baumstern commented 2 years ago

Figured it succeeded when generating both zkeys and witnesses freshly. Will try possible combinations (generate or reuse them) to find the cause of this error.

baumstern commented 2 years ago

Files of the MACI site looks outdated with a hidden dependency. None of zkeys from it was incompatible, generated invalid proof, to witness executable generated using the current version(v1) of MACI.