Skip to content

Conversation

@drewstone
Copy link
Contributor

This PR adds a bunch of things that currently do not work. Nonetheless, as we debug to improve tests passing we can add more tools to improve how the snark setup works for any end developer. In this PR there should be some verifier.sol files generated for each type of circuit (Poseidon Bridge and Tornado Cash withdrawals) as well as a trusted setup script (which fails, but can be run line by line manually) that generates the parameters and verifiers needed for these circuits.

@drewstone drewstone requested a review from nepoche July 21, 2021 14:07
snarkjs zkey new ../artifacts/circuits/withdraw.r1cs pot12_final.ptau circuit_0000.zkey
snarkjs zkey contribute circuit_0000.zkey circuit_final.zkey --name="1st Contributor Name" -v
if [ ! -f $OUTPUT_DIR/circuit_0000.zkey ]; then
echo "snarkjs groth16 setup "${R1CS_PATH}" $OUTPUT_DIR/pot12_final.ptau $OUTPUT_DIR/circuit_0000.zkey\n"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like snarkjs doesn't have a function for 'groth16 setup'

@drewstone
Copy link
Contributor Author

drewstone commented Jul 22, 2021 via email

@nepoche
Copy link
Contributor

nepoche commented Jul 22, 2021

I haven't gotten the script to work properly either, with an error for line 53: wait: pid 500 is not a child of this shell. I did attempt to go line by line, and that's how I found out that snarkjs does not support a command for groth16 setup. Instead, I executed the removed snarkjs zkey new ../artifacts/circuits/withdraw.r1cs pot12_final.ptau circuit_0000.zkey and continued afterwards.

@drewstone
Copy link
Contributor Author

drewstone commented Jul 22, 2021 via email

@nepoche
Copy link
Contributor

nepoche commented Jul 22, 2021

Right. When executing line by line, attempting to execute: npx snarkjs groth16 setup ./artifacts/circuits/t ornado/withdraw_30.r1cs ./build/tornado/pot12_final.ptau ./build/tornado/circuit_0000.zkey yields an output of Invalid command.

@drewstone
Copy link
Contributor Author

drewstone commented Jul 22, 2021 via email

@nepoche
Copy link
Contributor

nepoche commented Jul 22, 2021

Could we update the package.json snarkjs version to the version which we expect? Seems like 0.3.59 does not have support for the command but 0.4.6 does.

@drewstone
Copy link
Contributor Author

drewstone commented Jul 23, 2021 via email

@drewstone drewstone merged commit cbad543 into main Jul 25, 2021
@drewstone drewstone deleted the snark-setup branch July 25, 2021 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants