Currently, due to the Circom native C++ witness generator that depends on x86 assembly for field operations, only x86 architecture is supported.
This directory contains utilities for performing a "stark2snark" workflow. This is useful for transforming a RISC Zero STARK proof into a Groth16 SNARK proof which is suitable for publishing on-chain.
Recommended way to produce Groth16 receipts is to use the
Prover
trait in therisc0-zkvm
crate. See the crate documentation for more information.
To install the necessary dependencies, run:
./scripts/install_prover.sh
All the following commands must be run from the groth16_proof
directory.
- Run the ceremony (optional):
wget -O groth16/pot23.ptau https://hermez.s3-eu-west-1.amazonaws.com/powersOfTau28_hez_final_23.ptau docker build -f docker/ceremony.Dockerfile . -t snark-ceremony docker run --rm -v $(pwd)/groth16:/ceremony/groth16 snark-ceremony
- Build the prover image:
docker build -f docker/prover.Dockerfile . -t risc0-groth16-prover
Note that the
prover.Dockerfile
downloads a proving key from an existing ceremony. If a new ceremony is required, replace it with the new proving key generated in step 1.
The input.json
file needs to be generated using the seal-to-json
utility.
Place this file into the directory of your choice, then add this as a volume and
run the docker container:
docker run --rm -v $WORK_DIR:/mnt risc0-groth16-prover
The resulting proof.json
file will be in the chosen $WORK_DIR
.
This file can be parsed and decoded into a risc0_groth16::Seal
.
Finally, this seal can be embedded within a InnerReceipt::Groth16
.
See risc0-zkvm/src/host/server/prove/tests.rs
for an end-to-end
example.