cairo-lang
cairo-lang copied to clipboard
How to verify a proof?
The documentation is light on this, but it looks like a proof of computation can be generated with cairo-run ... --proof_mode --trace-file=output.trace
. How do I verify this proof?
cairo-run
generates the trace that can later be used by the prover to generate the proof. The proof can then be verified on-chain (Ethereum) by the Cairo Verifier contract. You can find it here - github, etherscan.
Currently, we still haven't released a prover, but we plan to do so in the coming weeks -
- The Cairo Playground will be hooked to a prover and you will be able to prove and verify programs you write there.
- A free-to-use prover that any developer will be able to send their
cairo-run
output to. The prover will send the proofs to a verifier on an Ethereum testnet.
Hey, What is the current state of proof generation and verification now ? I can't find a clear guide on how to do that.
@tdelabro I think this might be helpful
@pedrobergamini @tdelabro Has anyone been able to implement this? I'm currently trying to write a zk contract that can generate a proof on Starknet, then use a verifier on Ethereum to verify the proof. Is there an equivalent of circom and snarkjs for Starknet?
Id also be interested in this. I wrote few circuits using circom and snarkjs
Would love to port those to Cairo as it seems much more expressive. But I need a clear way to generate verifier code that can be ran in browser and also in solidity
I dont see any official solutions by Starkware to do this off-chain except for Giza: https://github.com/maxgillett/giza
Some details here: https://twitter.com/maxgillett/status/1547592166003785730
Sooner or later, we will have the open-source prover - announced on Feb 5 this year - and the process of creating and verifying proofs will become much easier for sure.
Has there been any progress on this?
Here is Stone an open source prover by Starknware: https://github.com/starkware-libs/stone-prover
It looks like it is comming with cpu_air_verifier
a verifier.
This looks potentially good to get started, thanks for sharing, but what about for Cairo 1 instead of 0?
For Starknet, the cairo1 code is actually run inside a cairo0 program, the StarknetOS. The exploration team is in the process an open source version of this piece of software, here: https://github.com/keep-starknet-strange/snos.
What you are proving is the the run of this cairon0 program, which happen to be executing cairo1 code.