Skip to main content

Proving: Circuit building

Corset 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 performs the first stage of the proving system: it compiles Lineth's zkEVMzkEVM A virtual machine that executes smart contracts and proves the correctness of execution using zero-knowledge proofs. zkEVMs recreate aspects of Ethereum's design, which provides an "Ethereum-like" experience for developers and users. rules into a constraint system, and prepares each batch's execution traces so the prover can check them against that system.

A constraint system is a set of rules that a computation must satisfy. Proving in zero knowledge means showing that some data satisfies every rule in the system, without revealing the data itself.

How it works​

Corset runs at two different times.

At build time, it compiles Lineth's arithmetization: the constraint definitions, written in a Lisp domain-specific language, that describe what correct zkEVM execution looks like. The compiled constraint system is bundled into the prover, so a change to the arithmetization reaches the prover as a new build rather than at runtime.

At runtime, it expands the conflated traces that the tracer produced for a batch. Trace expansion derives the columns the constraint system checks from the columns the tracer recorded, producing the complete data set, or witness, that the prover proves against.

See also​

  • See Circuit execution and runtime for the second stage of the proving system, where gnarkgnark A software library that offers users the ability to design and run computational circuits in zk-SNARKs through a high-level API. turns the witness into a proof.
  • See Module limits for the per-module trace line limits that keep an expanded trace within what the prover can handle.
  • See the go-corset source code, and Lineth's constraint definitions in the lineth-monorepo.

Was this page helpful?