Optimistic Rollup
An Optimistic Rollup is a Layer-2 scaling solution that executes transactions off-chain and posts transaction data to the main chain, assuming transactions are valid unless challenged.
Optimistic Rollups are a prominent Layer-2 scaling solution designed to increase the transaction throughput of blockchains, primarily Ethereum, by processing transactions off-chain while posting compressed transaction data to the main chain (Layer-1). The core architectural principle is 'optimism': transactions are assumed to be valid by default. A sequencer bundles transactions into blocks, executes them, and generates state roots. This data, along with proofs or call data, is then posted to the Layer-1 chain. The 'optimistic' part comes into play during a challenge period. During this period (typically 7 days), anyone can submit a 'fraud proof' to the Layer-1 chain if they believe a transaction in the rollup block was invalid. If a fraud proof is successful, the invalid transaction is reverted, and the sequencer (or other malicious actors) faces a financial penalty (slashing) from a security bond. If no fraud is submitted within the challenge period, the state transition is finalized and considered valid. The mechanics involve state commitment on L1, off-chain execution by sequencers, and dispute resolution via fraud proofs. Trade-offs include the significant latency introduced by the challenge period, which delays fund withdrawals back to Layer-1, and the reliance on a sequencer (or a set of sequencers) to bundle transactions. Security relies on the economic incentives of validators/verifiers to monitor the rollup and submit fraud proofs, as well as the security of the Layer-1 chain itself. Compared to zero-knowledge rollups, optimistic rollups are generally simpler to implement and support EVM compatibility more easily, but at the cost of longer withdrawal times.
graph LR
Center["Optimistic Rollup"]:::main
Pre_smart_contract["smart-contract"]:::pre --> Center
click Pre_smart_contract "/terms/smart-contract"
Pre_layer_2["layer-2"]:::pre --> Center
click Pre_layer_2 "/terms/layer-2"
Rel_zk_rollup["zk-rollup"]:::related -.-> Center
click Rel_zk_rollup "/terms/zk-rollup"
Rel_sidechains["sidechains"]:::related -.-> Center
click Rel_sidechains "/terms/sidechains"
Rel_fraud_proof["fraud-proof"]:::related -.-> Center
click Rel_fraud_proof "/terms/fraud-proof"
classDef main fill:#7c3aed,stroke:#8b5cf6,stroke-width:2px,color:white,font-weight:bold,rx:5,ry:5;
classDef pre fill:#0f172a,stroke:#3b82f6,color:#94a3b8,rx:5,ry:5;
classDef child fill:#0f172a,stroke:#10b981,color:#94a3b8,rx:5,ry:5;
classDef related fill:#0f172a,stroke:#8b5cf6,stroke-dasharray: 5 5,color:#94a3b8,rx:5,ry:5;
linkStyle default stroke:#4b5563,stroke-width:2px;
🧒 Explain Like I'm 5
🤥 Imagine a high-speed checkout at a store where you just shout your total and leave. The store 'optimistically' trusts you are honest to save time. However, there's a camera (the [fraud proof](/en/terms/fraud-proof) system). If a guard checks the tape later and sees you lied, the store reverses the [transaction](/en/terms/transaction) and punishes you. Because of this check, you have to wait 7 days before your 'receipt' is officially final.
🤓 Expert Deep Dive
Optimistic Rollups leverage fraud proofs, a mechanism rooted in game theory and computational integrity, to ensure security without requiring complex zero-knowledge proofs. The state transition function of the rollup is replicated on L1 via a verifier contract. When a sequencer posts a new state root S_new derived from S_old after executing transactions T, it is posted as (S_old, S_new, calldata_T). A verifier contract allows any party to submit a fraud proof, typically involving a computational challenge to pinpoint the exact faulty computation. This often requires a mechanism like 'state-rent' or 'challenge-specific computation' on L1 to verify the disputed step. The challenge period duration is a critical trade-off, balancing security against user experience (withdrawal times). Vulnerabilities include the 'data availability problem' (if L1 data is unavailable, L2 state cannot be reconstructed), sequencer censorship, and the potential for a single malicious sequencer to halt the network (though economic incentives mitigate this). Advanced designs explore multi-sequencer setups and validity proofs as a fallback or complementary mechanism.