Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cairo1 proofs #135

Merged
merged 9 commits into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/proof_verification_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
strategy:
matrix:
cairo_version: ["cairo1"]
layout: ["recursive"]
layout: ["dex", "recursive", "recursive_with_poseidon", "small", "starknet", "starknet_with_keccak"]
steps:
- name: Checkout repository
uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ cairo-lang-utils = { git = "https://github.com/starkware-libs/cairo/", rev = "44
cairo-proof-parser = { git = "https://github.com/Okm165/cairo-proof-parser", rev = "97a04bbee07330311b38d6f4cecfed3acb237626"}
cairo-vm = "0.9.2"
clap = { version = "4.5.2", features = ["derive"] }
itertools = "0.12.0"
itertools = "0.13.0"
num-bigint = "0.4.4"
runner = { path = "runner" }
serde = { version = "1", features = ["derive"] }
Expand Down
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,11 @@ scarb test

For local proof verification, follow these steps:

1. Run the verifier locally using the following command on example proof, followed by the Cairo version of the circuit (0 or 1) used to generate the proof:
1. Run the verifier locally using the following command on example proof, followed by the Cairo version (cairo0 or cairo1) used to generate the proof:

```bash
cargo run --release --bin runner -- target/dev/cairo_verifier.sierra.json 0 < examples/proofs/recursive/example_proof.json
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
```

### Starknet Proof Verification
Expand All @@ -41,14 +42,14 @@ To verify proofs on Starknet, proceed with the following steps:
1. Prepare calldata of example proof for sncast:

```bash
cargo run --release --bin snfoundry_proof_serializer < examples/proofs/recursive/example_proof.json > examples/starknet/calldata
cargo run --release --bin snfoundry_proof_serializer -- -c cairo0 < examples/proofs/recursive/cairo0_example_proof.json > examples/starknet/calldata
```

2. Call the function with calldata on the Starknet contract:

```bash
cd examples/starknet
./1-verify-proof.sh 0x487810706cc0dfdba0c82403d98e9d32dc36793ed2b731231e5ea19f00c5861 calldata
./1-verify-proof.sh 0x274d8165a19590bdeaa94d1dd427e2034462d7611754ab3e15714a908c60df7 calldata
```

[List of deployed Verifier Contracts](deployed_contracts.md)
Expand Down Expand Up @@ -76,8 +77,8 @@ cargo run --release --bin benches -- target/dev/cairo_verifier.sierra.json

### Stone Prover Instructions

For detailed instructions and examples, refer to the Stone Prover [documentation](https://github.com/starkware-libs/stone-prover?tab=readme-ov-file#creating-and-verifying-a-proof-of-a-cairozero-program).
For detailed instructions and examples, refer to the Stone Prover [documentation](https://github.com/starkware-libs/stone-prover?tab=readme-ov-file#overview).

### Stone Prover SDK Tool
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.

For information on how to use the Stone Prover SDK tool, please refer to the [documentation](https://github.com/Moonsong-Labs/stone-prover-sdk).
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.
2 changes: 1 addition & 1 deletion deployed_contracts.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
| | **Mainnet** | **starknet** |
| | **Mainnet** | **starknet_with_keccak** |
| | **Sepolia Testnet** | **dex** |
|[0x0110fc9f06e4864b5e7f51432149bc4c5ef7a2786e9125ba2177fbfe0a682751](https://sepolia.starkscan.co/contract/0x0110fc9f06e4864b5e7f51432149bc4c5ef7a2786e9125ba2177fbfe0a682751) | **Sepolia Testnet** | **recursive** |
|[0x274d8165a19590bdeaa94d1dd427e2034462d7611754ab3e15714a908c60df7](https://sepolia.starkscan.co/contract/0x274d8165a19590bdeaa94d1dd427e2034462d7611754ab3e15714a908c60df7) | **Sepolia Testnet** | **recursive** |
| | **Sepolia Testnet** | **recursive_with_poseidon** |
| | **Sepolia Testnet** | **small** |
| | **Sepolia Testnet** | **starknet** |
Expand Down
1,107 changes: 1,107 additions & 0 deletions examples/proofs/dex/cairo1_example_proof.json

Large diffs are not rendered by default.

1,423 changes: 0 additions & 1,423 deletions examples/proofs/recursive_cairo1/cairo0_example_proof.json

This file was deleted.

Loading
Loading