Skip to main content

Proving: Circuit execution and runtime

gnark is part of the LinethLineth (Formerly the Linea Stack) The open-source ZK-rollup stack, codebase, and technical protocol that's the foundation of Linea Mainnet. Operators can deploy this stack to launch their own Ethereum-compatible L2 or L3 networks. prover. It's a Go library for building and proving cryptographic circuits, used standalone in other projects as well as in Lineth.

gnark completes the second stage of the proving system: after the circuit building stage, it produces the proof submitted at finalization.

How it works

The prover first checks the expanded traces from Corset against the arithmetization, using its own proving framework. The result is an inner proof: it establishes that execution was correct, but it's too large to verify onchain.

gnark turns that inner proof into one a contract can check. Its frontend API defines the circuits, including circuits whose job is to verify a proof from an earlier stage, and its backend API runs those circuits at proving time to produce a proof at each stage.

Because each stage proves the verification of the stage before it, the proof gets smaller and cheaper to verify as it moves toward the finalization layer. Aggregation circuits then combine the proofs for several blobs into the single proof the coordinator submits, a zk-SNARKzk-SNARK (Zero-Knowledge Succinct Non-interactive Argument of Knowledge) A type of ZK proof where the prover and verifier don't have to interact. With zk-SNARKs, you can verify 1 transaction or 1 billion transactions in the same amount of time. that a verifier contract can check cheaply.

The prover writes the finished proof back for the coordinator to pick up and submit.

See also

Was this page helpful?