An optimistic rollup is a type of layer-2 scaling solution that relies on off-chain computation to record transactions in layer 2 trustlessly.
An optimistic rollup is a type layer 2 scaling solution that relies on off-chain computation to trustlessly record transactions that happen in layer 2. Periodically the system publishes a Merkle root of the transactions that happen within the rollup in order to update the "state" of the rollup on the main underlying blockchain. A network of external validators checks the Merkle roots to make sure that they are correct before the state is updated some time later. If an inconsistency arises, then the validator can publish a fraud proof during the dispute period, which can cause the state of the system to be rolled back to the previous valid state.
The main advantage to optimistic rollups compared to their zero knowledge equivalents is that they are more generalist and can support smart contracts in a similar way to the underlying smart contract-enabled blockchain. Native support for smart contracts within the rollup means that apps can be launched much easier, without the need for additional development.
You may learn more about Optimistic Rollup vs ZK Rollup!
The three main components of an optimistic rollup are:
Using an optimistic rollup requires users to deposit funds into the Ethereum smart contract. The smart contract then locks the funds and emits an event signaling the deposit. The sequencer receives the event and credits the user with equivalent tokens on the layer-2 chain.
Users can transact freely on the layer-2 chain with other users who have also deposited funds into the smart contract. They sign transactions and submit them to the sequencer, who verifies and adds them to a queue.
Periodically, the sequencer batches thousands of queued transactions into a block and submits it to Ethereum as a single transaction. The block contains minimal data, such as the state root (a Merkle root of the layer-2 chain's state) and the transaction root (a Merkle root of the transactions in the block). The smart contract stores these roots and updates its state accordingly.
When a user wants to withdraw funds from the layer-2 chain to Ethereum, they must initiate an exit request on the layer-2 chain. The sequencer includes this request in a block and submits it to Ethereum. The smart contract then unlocks the funds and transfers them to the user's address. However, there is a waiting period (typically one week) before the withdrawal is finalized, during which anyone can challenge the exit with a fraud proof if it is invalid.
Optimistic rollups' key feature is their assumption that all transactions are valid by default, and it only verifies them if a fraud proof is submitted. This enables high scalability without sacrificing security or decentralization.
Optimistic rollups are not a single protocol but a class of protocols sharing common features and design choices, including:
Decentralized data availability solutions use a peer-to-peer network or a decentralized storage network (e.g., IPFS) to store and distribute full-block data. Centralized data availability solutions use a single server or a trusted third party to store and provide full-block data.
Examples of rollups with decentralized data availability include Optimism and Arbitrum, while those with centralized data availability include Boba Network and zkSync 2.0.
Interactive fraud-proof mechanisms require a challenge-response game between the sequencer and validators to verify a block's validity. Non-interactive fraud proof mechanisms utilize cryptographic proofs or witnesses to verify a block's validity without any interaction. Where interactive fraud-proof mechanisms are more flexible and general but more costly and time-consuming, non-interactive mechanisms are more efficient and fast but more restrictive and specialized.
Examples of rollups with interactive fraud-proof mechanisms are Optimism and Arbitrum, while non-interactive fraud-proof mechanisms can be found in Boba Network and zkSync 2.0.
In optimistic rollups, the term "optimistic" refers to the assumption that all transactions are valid by default. This means the layer-2 chain does not verify or validate transactions before submitting them to Ethereum unless challenged. Instead, it relies on economic incentives and fraud proofs to ensure the system's correctness and security.
By moving most of the computation and data storage off-chain, optimistic rollups reduce gas fees for transactions. They save on gas costs and increase efficiency by batching thousands of transactions into a single block and submitting minimal data on-chain.
Instant confirmations on the layer-2 chain improve transaction latency in optimistic rollups.
Optimistic rollups derive their security and decentralization from the base layer by publishing transaction results on-chain and relying on fraud proofs for correctness.
Ensuring the full block data is accessible off-chain for anyone wishing to verify or challenge a transaction poses a challenge. If data is unavailable or corrupted, fraud proofs cannot be generated or submitted, potentially compromising the system's security and integrity. Decentralized and centralized data availability solutions can mitigate the data availability problem but have their own pros and cons.
Relying on a single entity or a small group of entities to collect, order and execute layer-2 chain transactions carries the risk of centralization. A malicious or compromised sequencer could censor, reorder or manipulate transactions, harming users and applications on the rollup. The sequencer centralization risk can be mitigated by using multiple sequencers, randomizing sequencer selection, or allowing users to bypass the sequencer.
Previous to DeversiFi, Ross worked at the Ethfinex and Bitfinex exchanges. Before joining crypto, Ross was a professional energy trader and analyst in London for ten years. He worked on global energy trading desks at companies such as Centrica, Gazprom and RWE to deploy funds into advanced proprietary fundamental-backed trading strategies. Outside of the trading world, he is a committed angel investor and Ironman triathlete. Ross brings a wealth of both non-traditional and traditional asset trading and commercial experience as well as connections to the alternative finance space. Ross holds a BSc in economics.
Join the thousands already learning crypto!