Skip to content

HerodotusDev/integrity

Repository files navigation

Cairo Verifier

Integrity

Continuous Integration - tests

Continuous Integration - proof verification tests

Building the Verifier

To build the Cairo Verifier, follow these steps:

  1. Build the project by running the following command in your terminal:
scarb build
  1. (Optional) Test the project to ensure everything works correctly:
scarb test

Running the Verifier on Example Proof

Local Proof Verification

For local proof verification, follow these steps:

  1. Run the verifier locally on example proof using the following command:
cargo run --release --bin runner -- target/dev/cairo_verifier.sierra.json < examples/proofs/recursive/example_proof.json

Starknet Proof Verification

To verify proofs on Starknet, proceed with the following steps:

  1. Prepare calldata of example proof for sncast:
cargo run --release --bin snfoundry_proof_serializer < examples/proofs/recursive/example_proof.json > examples/starknet/calldata
  1. Call the function with calldata on the Starknet contract:
cd examples/starknet
./1-verify-proof.sh 0x487810706cc0dfdba0c82403d98e9d32dc36793ed2b731231e5ea19f00c5861 calldata

List of deployed Verifier Contracts

Configure Verifier

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]

Benchmarking

In order to launch benchmarking, just run this (it requires recursive layout configuration):

cargo run --release --bin benches -- target/dev/cairo_verifier.sierra.json

Creating a Proof

Stone Prover Instructions

For detailed instructions and examples, refer to the Stone Prover documentation.

Stone Prover SDK Tool

For information on how to use the Stone Prover SDK tool, please refer to the documentation.