To build the Cairo Verifier, follow these steps:
- Build the project by running the following command in your terminal:
scarb build
- (Optional) Test the project to ensure everything works correctly:
scarb test
For local proof verification, follow these steps:
- Run the verifier locally using the following command on example proof, followed by the Cairo version (cairo0 or cairo1) used to generate the proof:
cargo run --release --bin runner -- --program target/dev/cairo_verifier.sierra.json -c cairo0 < examples/proofs/recursive/cairo0_example_proof.json
cargo run --release --bin runner -- --program target/dev/cairo_verifier.sierra.json -c cairo1 < examples/proofs/recursive/cairo1_example_proof.json
To verify proofs on Starknet, proceed with the following steps:
- Prepare calldata of example proof for sncast:
cargo run --release --bin snfoundry_proof_serializer -- -c cairo0 < examples/proofs/recursive/cairo0_example_proof.json > examples/starknet/calldata
- Call the function with calldata on the Starknet contract:
cd examples/starknet
./1-verify-proof.sh 0x274d8165a19590bdeaa94d1dd427e2034462d7611754ab3e15714a908c60df7 calldata
List of deployed Verifier Contracts
By default, the verifier is configured for recursive layout and keccak hash for verifier unfriendly commitment layers. You can easily change that by using the configure python script (this script is in Experimental stage):
python configure.py -l recursive -s keccak
layout types: [dex, recursive, recursive_with_poseidon, small, starknet, starknet_with_keccak]
hash types: [keccak, blake2s]
In order to launch benchmarking, just run this (it requires recursive layout configuration):
cargo run --release --bin benches -- target/dev/cairo_verifier.sierra.json
For detailed instructions and examples, refer to the Stone Prover documentation.
How to prove Cairo0 program with Stone Prover.
How to prove Cairo1 program with Stone Prover.