Skip to content

Instantly share code, notes, and snippets.

@leonardoalt
Last active April 25, 2024 09:22
Show Gist options
  • Save leonardoalt/883dc6da48f587bd83d9085babaa4e1d to your computer and use it in GitHub Desktop.
Save leonardoalt/883dc6da48f587bd83d9085babaa4e1d to your computer and use it in GitHub Desktop.

Checkout branch https://github.com/powdr-labs/powdr/tree/single-snark-halo2

Download setup of size 22 (faster than generating): https://drive.google.com/file/d/1xG_O_KqooiRR3QJno3tXIiNELSB2AQMH/view?usp=sharing

Generate witness and Poseidon transcript proof for this test (application)

cargo run -r pil test_data/asm/book/hello_world.asm --field bn254 --inputs 0 --prove-with halo2 --backend-options "poseidon" -f --params params22.bin

Create application verification key

cargo run -r verification-key test_data/asm/book/hello_world.asm --field bn254 --backend halo2 --backend-options "poseidon" --params params22.bin

Verify proof

cargo run -r verify test_data/asm/book/hello_world.asm --field bn254 --backend halo2 --backend-options "poseidon" --params params22.bin --vkey vkey.bin --proof hello_world_proof.bin

Rename proof to not get mixed up with the recursive proof

mv hello_world_proof.bin hello_world_proof_app.bin

Rename vkey to not get mixed up with the recursive vkey

mv vkey.bin vkey_app.bin

So far everything should have worked

Generate aggregation circuit verification key, this should also work

cargo run -r verification-key test_data/asm/book/hello_world.asm --field bn254 --backend halo2 --backend-options "snark_aggr" --params params22.bin --vkey-app vkey_app.bin

Generate aggregation proof

cargo run -r prove test_data/asm/book/hello_world.asm --field bn254 --backend halo2 --backend-options "snark_aggr" --params params22.bin --vkey vkey.bin --vkey-app vkey_app.bin --proof hello_world_proof_app.bin

The generated proof somehow doesn't pass verification which is tested right after proof generation internally

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment