<!-- Canonical: https://docs.linea.build/protocol/architecture/prover/proving -->

> For the complete Linea documentation index, see [llms.txt](/llms.txt).
> Agents can fetch this page as Markdown at [https://docs.linea.build/protocol/architecture/prover/proving.md](https://docs.linea.build/protocol/architecture/prover/proving.md).

# Proving: Circuit execution and runtime

gnark is part of the [Lineth](/protocol/reference/zero-knowledge-glossary#lineth)**Lineth** (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](/protocol/architecture/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](/protocol/architecture/prover/trace-expansion) stage, it produces the proof submitted at finalization.

## How it works

The prover first checks the expanded traces from [Corset](/protocol/architecture/prover/trace-expansion) 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](https://pkg.go.dev/github.com/consensys/gnark/frontend) defines the circuits, including circuits whose job is to verify a proof from an earlier stage, and its [backend API](https://pkg.go.dev/github.com/consensys/gnark/backend) 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-SNARK](/protocol/reference/zero-knowledge-glossary#zk-snark)**zk-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](/protocol/architecture/coordinator) to pick up and submit.

## See also

-   See [Circuit building](/protocol/architecture/prover/trace-expansion) for the first part of the proving system that produces gnark's input.
-   See [Trusted setup](/protocol/architecture/prover/trusted-setup) for the reference strings, and the curve each proving stage uses them for.
-   See the [gnark repository](/protocol/reference/repos#gnark), and the [prover source code](https://github.com/LFDT-Lineth/lineth-monorepo/tree/main/prover) in the `lineth-monorepo`.
