> ## Documentation Index
> Fetch the complete documentation index at: https://docs.optimism.io/llms.txt
> Use this file to discover all available pages before exploring further.

# ZK proofs explainer

> Learn how the OP Stack secures withdrawals with optimistic ZK proofs, where a proposal stands unless challenged and a challenged proposal must be proven with a zero-knowledge proof.

> [!NOTE]
>
> **Normative spec:** The ZK dispute game is normatively defined in the
> [ZK dispute game specification](https://specs.optimism.io/fault-proof/stage-one/zk/zk-dispute-game.html). This page is a conceptual explainer; it does not restate the spec.

> [!WARNING]
>
> ZK proofs are experimental and under active development. Do not rely on them to secure a production chain yet.

ZK proofs are how an OP Stack chain proves its state to Ethereum so that users can withdraw without trusting a third party. Anyone can propose the state of the chain on L1, and anyone can challenge a proposal. A challenged proposal must then be proven correct with a zero-knowledge proof before a deadline, or it fails.

The system is optimistic: a proposal is assumed correct unless someone challenges it, and a proposal that nobody disputes needs no proof. Proofs are only needed when a challenge happens, so the cost of proving is paid in the rare case of a dispute, not on every proposal.

## Proposals

A proposal is a claim about the state of the chain at a point in time, submitted to the `DisputeGameFactory` contract on L1. Each proposal creates a new [ZK dispute game](https://docs.optimism.io/op-stack/zk-proofs/zk-dispute-game.md), and the proposer posts a bond with it.

Every proposal is a **super root**: a single hash that commits to the output root of every chain in the chain's interop set at one timestamp. A chain that is not part of an interop set is a set of one, so the same game and the same proof system serve both cases.

Each proposal builds on an earlier one. A game names a parent game, and its claim is that the chain moved from the parent's super root to its own. The first game in a sequence builds on the anchor state recorded in the `AnchorStateRegistry`. A proof therefore only needs to cover the blocks between two proposals, not the chain's whole history.

Proposing is permissionless. The chain operator runs [`op-zk-proposer`](https://docs.optimism.io/op-stack/components/op-zk-proposer) so that proposals land regularly, but any account can create a game by paying the bond.

## Challenges

Anyone who believes a proposal is wrong can challenge it by depositing a challenger bond. A game can be challenged once, and only during its challenge window.

If nobody challenges a proposal before its challenge window ends, the proposal wins. If it is challenged, the game enters a prove window: someone must submit a valid ZK proof that the proposal is correct before that window ends. A valid proof wins the game for the proposer. With no proof by the deadline, the challenger wins and takes the proposer's bond.

These outcomes assume that the parent game won. If the parent lost, the game loses too, even with a valid proof; see [From resolution to withdrawal](#from-resolution-to-withdrawal).

A challenge is a single transaction. There is no back-and-forth between the two sides, and the challenger does not need to compute anything except the correct super root to compare against. The operator runs [`op-challenger`](https://docs.optimism.io/op-stack/components/op-challenger) to check every proposal against its own nodes and challenge invalid ones.

## Proofs

A ZK proof is a short cryptographic proof that a program ran correctly on some inputs. For the OP Stack, the program re-derives each chain from L1 data and executes its blocks, starting from the parent's super root, and checks that the result is the proposed super root. The L1 contract verifies the proof in one call, without re-running anything.

Proofs are generated off-chain with the [SP1 zkVM](https://github.com/succinctlabs/sp1) by Succinct, running programs built from the same [Kona](https://docs.optimism.io/op-stack/components/kona-client.md) code that implements the OP Stack state transition. The proposer buys proofs from the [Succinct Prover Network](https://docs.succinct.xyz/), or generates them on its own GPUs. See [ZK proof system](https://docs.optimism.io/op-stack/zk-proofs/proof-system.md) for how a proof is built.

Proving is permissionless too. Anyone can submit a proof for any game, and a proof is bound to the address that submits it, so it cannot be copied by someone else. In practice the chain operator's proposer proves challenged games.

## Fast finality

An unproven game that nobody challenges has to wait out its whole challenge window before it can resolve. A proposer can choose to prove its games anyway, as soon as they are created. A proven game is over immediately and resolves as soon as its parent resolves, so its result is available much sooner. This trades proving cost for lower latency.

Withdrawals still wait for the delays that protect them, described below, even when a game resolves early.

## From resolution to withdrawal

Once a game is over, anyone can resolve it. Games resolve in order: a game cannot resolve until its parent has. If a parent loses, every game built on it loses too, and anyone can resolve those games at once, without waiting for them to be over.

A resolved game is not trusted immediately:

* The `AnchorStateRegistry` waits a finality delay after resolution before it treats the result as final. During that time the [Guardian](https://docs.optimism.io/op-stack/protocol/privileged-roles.md#guardian) can blacklist a game that resolved incorrectly.
* The `OptimismPortal` waits a proof maturity delay between a user proving a withdrawal and finalizing it.
* Bonds are paid out through `DelayedWETH`, which adds its own delay so funds can be recovered if a game resolved incorrectly.

See [ZK proofs security](https://docs.optimism.io/op-stack/zk-proofs/security.md) for how these safeguards work together.

## Next steps

* Read [ZK dispute game](https://docs.optimism.io/op-stack/zk-proofs/zk-dispute-game.md) for the game's lifecycle, deadlines, and bonds.
* Read [ZK proof system](https://docs.optimism.io/op-stack/zk-proofs/proof-system.md) for how proofs are generated and verified.
* Read [ZK proof system components](https://docs.optimism.io/op-stack/zk-proofs/components.md) for the contracts and services involved.
