cairo-lang icon indicating copy to clipboard operation
cairo-lang copied to clipboard

How to verify a proof?

Open cmars opened this issue 4 years ago • 11 comments

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?

cmars avatar Jan 19 '21 13:01 cmars

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.

bbrandtom avatar Jan 20 '21 10:01 bbrandtom

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 avatar Jun 13 '22 08:06 tdelabro

@tdelabro I think this might be helpful

pedrobergamini avatar Aug 18 '22 17:08 pedrobergamini

@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?

remi-gai avatar Sep 03 '22 19:09 remi-gai

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

grmkris avatar Sep 15 '22 07:09 grmkris

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

dhvanipa avatar Jan 26 '23 22:01 dhvanipa

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.

Neurone avatar Jun 15 '23 10:06 Neurone

Has there been any progress on this?

Anne-Onymous72 avatar Dec 05 '23 14:12 Anne-Onymous72

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.

tdelabro avatar Dec 05 '23 14:12 tdelabro

This looks potentially good to get started, thanks for sharing, but what about for Cairo 1 instead of 0?

Anne-Onymous72 avatar Dec 06 '23 13:12 Anne-Onymous72

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.

tdelabro avatar Dec 06 '23 13:12 tdelabro