WARNING: This software is still experimental, we do not recommend it for production use (see Security section).
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.
To install the necessary dependencies, run:
./scripts/install_prover.sh
All the following commands must be run from the compact_proof
directory.
- Build circom files and binaries:
docker build -f docker/build.Dockerfile . -t snark-build --output=groth16 --target outputs
- Copy the
stark_verify_final.zkey
from a ceremony into thegroth16
directory. Alternatively, 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
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::Compact
.
See risc0-groth16/src/tests/stark_to_snark.rs
for an end-to-end
example.