Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
fmkra committed Sep 10, 2024
1 parent 717f6d0 commit 0050351
Showing 1 changed file with 22 additions and 8 deletions.
30 changes: 22 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@

[![Continuous Integration - proof verification tests](https://github.com/HerodotusDev/cairo-verifier/actions/workflows/proof_verification_tests.yml/badge.svg)](https://github.com/HerodotusDev/cairo-verifier/actions/workflows/proof_verification_tests.yml)

## Building the Verifier
## Using Verifier contracts

To use the Verifier for verifying proofs on starknet, you need to generate calldata for your proof. The easiest way to do that is to use [Calldata Generator](https://github.com/HerodotusDev/integrity-calldata-generator). It also provides script for automatic transaction sending (proof verification is split into multiple transactions, for more information see [Split Verifier Architecture](/README.md#split-verifier-architecture)).

## Running locally

To build the Cairo Verifier, follow these steps:

Expand All @@ -24,9 +28,7 @@ If you want to build for other layouts, refer to [Configure Verifier](/README.md
scarb test
```

## Running the Verifier on Example Proof

### Local Proof Verification
### Running the Verifier on Example Proof

For local proof verification, follow these steps:

Expand All @@ -37,7 +39,7 @@ cargo run --release --bin runner -- --program target/dev/cairo_verifier.sierra.j
cargo run --release --bin runner -- --program target/dev/cairo_verifier.sierra.json -c cairo1 < examples/proofs/recursive/cairo1_example_proof.json
```

### Starknet Proof Verification
<!-- ### Starknet Proof Verification
To verify proofs on Starknet, proceed with the following steps:
Expand All @@ -54,9 +56,9 @@ cd examples/starknet
./1-verify-proof.sh 0x274d8165a19590bdeaa94d1dd427e2034462d7611754ab3e15714a908c60df7 calldata
```
[List of deployed Verifier Contracts](deployed_contracts.md)
[List of deployed Verifier Contracts](deployed_contracts.md) -->

## Configure Verifier
### Configure Verifier

By default, the verifier is configured for monolith version, recursive layout and keccak hash for verifier unfriendly commitment layers. You can easily change that by using scarb's features:

Expand All @@ -68,7 +70,7 @@ layout types: [dex, recursive, recursive_with_poseidon, small, starknet, starkne
hash types: [keccak, blake2s]
verifier types: [monolith, split]

## Benchmarking
### Benchmarking

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

Expand All @@ -85,3 +87,15 @@ For detailed instructions and examples, refer to the Stone Prover [documentation
How to prove [Cairo0](https://github.com/starkware-libs/stone-prover?tab=readme-ov-file#creating-and-verifying-a-proof-of-a-cairozero-program) program with Stone Prover.

How to prove [Cairo1](https://github.com/starkware-libs/stone-prover?tab=readme-ov-file#creating-and-verifying-a-proof-of-a-cairo-program) program with Stone Prover.

## Split Verifier Architecture

### Background information

TODO: why we need splitting, starknet limits, autogenerated and fri split

### FactRegistry and Proxy contract

Since verifier can be configured in many ways and some parts of the logic changes with new stone versions, a contract which routes calls to the correct verifier is needed. This task is handled by FactRegistry contract that also stores data for all verified proofs.

FactRegistry contract is trustless which means that owner of the contract can't override or change any existing behavior, they can only add new verifiers. Proxy contract on the other hand is upgradable, so every function can be changed or removed. It has the advantage of having all future updates of the verifier logic without having to replace the address of FactRegistry contract.

0 comments on commit 0050351

Please sign in to comment.