> ## 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 security

> Learn the security model of the OP Stack ZK proof system, what it assumes, and the safeguards that protect withdrawals and bonds when something goes wrong.

> [!NOTE]
>
> **Normative spec:** The ZK dispute game's assumptions and invariants is normatively defined in the
> [ZK dispute game specification](https://specs.optimism.io/fault-proof/stage-one/zk/zk-dispute-game.html#assumptions). This page explains the security model in prose; it does not restate the spec's assumptions.

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

The ZK proof system protects withdrawals with two properties. **Soundness**: an invalid proposal cannot be proven. **Completeness**: a valid proposal can always be proven in time. A failure of either one has a different effect, and the system has safeguards for both.

## Soundness

An invalid proposal wins only if nobody challenges it, or if someone proves it. Proving an invalid proposal would require breaking one of these:

* **The verifier.** The SP1 PLONK verifier must reject every proof of an incorrect statement. It is audited. `OPContractsManager` installs the release's verifier on each upgrade.
* **The program.** The proof program must implement the OP Stack state transition correctly, and must check every input the prover supplies against the game's public values. It is built from the same Kona code that implements the state transition elsewhere in the OP Stack.
* **The prestate.** Each game accepts proofs only from the program its `absolutePrestate` identifies. Changing the program requires changing the prestate.

`OPContractsManager` is not the only way to change the verifier and the prestate. The `DisputeGameFactory` owner can also change both directly with `setImplementation(ZK_DISPUTE_GAME, impl, gameArgs)`. Both paths are under the chain's governance.

The other route, an invalid proposal that nobody challenges, is closed by the challenger. Anyone can challenge, so a chain needs only one honest, online challenger during each challenge window. The chain operator runs [`op-challenger`](https://docs.optimism.io/chain-operators/guides/configuration/zk-challenger) and [`op-dispute-mon`](https://docs.optimism.io/chain-operators/tools/chain-monitoring#dispute-mon) for this.

Parent links carry soundness forward. A proof only shows that a proposal follows from its parent, but a game cannot win unless its parent won first, so a sequence of games is only as good as its first parent, the anchor state.

## Completeness

A valid proposal that is challenged and not proven by its prove deadline loses: the challenger takes the proposer's bond, and every game built on it loses too. So an honest proposer must be able to produce a proof within `maxProveDuration` every time, including when someone is trying to stop it.

This is a security property, not just an operational one. An attacker who can make an honest proof fail or take too long can remove valid proposals from the chain and take the proposer's bonds. The attacker posts one challenger bond per game, and gets it back along with the proposer's bond when the attack works. An honest proof could fail or run late in these ways:

* **Expensive blocks.** Proof requests have limits on proving work, input size, and memory. An attacker might fill blocks with transactions that are cheap on L2 but expensive to prove. The proposer splits work into smaller requests to stay under the limits, and the proof programs are reviewed for this kind of cost.
* **Prover availability.** The proposer buys proofs from the Succinct Prover Network. If the network cannot serve a request in time, or the proposer's PROVE balance runs out, a challenged game goes unproven. [Local GPU proving](https://docs.optimism.io/chain-operators/guides/configuration/zk-proposer.md#prove-on-local-gpus) can serve as a backup.
* **Missing inputs.** The proposer needs the prestate's program files, and L1, beacon, and L2 nodes that can serve the data the proof reads.

The proposer monitors the time left before each game's deadline; see [`op-zk-proposer` alarms](https://docs.optimism.io/chain-operators/guides/configuration/zk-proposer#monitor-the-proposer). The prove window should be set with room above the worst-case proving time for the whole interop set.

## Guardian safeguards

The [Guardian](https://docs.optimism.io/op-stack/protocol/privileged-roles.md#guardian) is the backstop if a game resolves incorrectly. These controls are shared with the rest of the OP Stack's dispute system:

* **Blacklisting.** The Guardian can blacklist a game in the `AnchorStateRegistry`. A blacklisted game cannot finalize withdrawals or update the anchor state. If the game has not been closed yet, its bonds are refunded instead of paid to the winner. Games built on a blacklisted parent must be blacklisted individually.
* **Retirement.** The Guardian can call `updateRetirementTimestamp()` to retire every game created at or before the current block time, for example after a bug is found in a prestate. Retired games are treated the same way as blacklisted ones. Unlike blacklisting, retirement also covers the games built on a retired game, because they were created at or before that time too.
* **Respected game type.** The Guardian can change the respected game type. A game can back withdrawals only if its type was respected when it was created, so the change applies to games created after it.
* **Pause.** The Guardian can pause the system. A pause blocks proving and finalizing withdrawals, `DelayedWETH` withdrawals, and closing games that are not closed yet.

These controls only help if the Guardian acts before a bad result is used, so the system adds delays:

* **Finality delay.** The `AnchorStateRegistry` does not treat a resolved game as final until its finality delay has passed.
* **Proof maturity delay.** The `OptimismPortal` makes users wait between proving and finalizing a withdrawal.
* **Bond delay.** `DelayedWETH` holds bonds and delays withdrawals, so funds can be held back from an incorrect game.

## Trust assumptions

Using ZK proofs adds these assumptions to the chain's security model:

* The SP1 zkVM and its PLONK verifier are sound.
* The Succinct Prover Network, or another prover, can generate proofs within the prove window.
* At least one honest challenger watches the chain during every challenge window.
* The Guardian acts honestly and in time when a game resolves incorrectly.

## Next steps

* Read the [spec's assumptions and invariants](https://specs.optimism.io/fault-proof/stage-one/zk/zk-dispute-game.html?utm_source=op-docs\&utm_medium=docs#assumptions) for the normative definitions.
* Read the [OP Stack security model FAQ](https://docs.optimism.io/op-stack/security/faq-sec-model.md).
* Read [Audit reports](https://docs.optimism.io/op-stack/security/audit-reports.md).
