Skip to content

OP Rollup

Optimistic Rollup

You should already have some understanding of Ethereum scaling solutions and Layer 2.

Optimistic Rollup (OP Rollup) is a Layer 2 scaling solution that moves computation and state off-chain and optimistically assumes that off-chain transactions are valid, only performing verification when there is a dispute. This mechanism significantly improves Ethereum's transaction throughput and reduces transaction costs while maintaining decentralization and high security.

OP Rollup Operating Mechanism

1. Transaction Batch Processing

  • Collecting Transactions: Optimistic Rollup collects multiple transactions submitted by users and batches them together. These transactions are processed off-chain, including operations such as account balance updates and smart contract calls.
  • Off-chain Processing: Off-chain, all transaction state changes are computed and recorded, including account balance updates, smart contract state modifications, and more.

2. Generating and Submitting Batches

  • Generating Transaction Batches: After off-chain operations are completed, the Rollup submitter (Sequencer) packages a batch of transaction results and generates the batch's state root.
  • Submitting to the Main Chain: The batch's state root and transaction data or their summaries are submitted to the Ethereum main chain (via Calldata or blob). The submitted data typically contains compressed forms of transactions to reduce on-chain storage requirements.

3. Dispute Period Awaiting Challenges

  • Optimistic Assumption: The system assumes all submitted transaction batches are valid, so in the absence of disputes, transaction batches are accepted by default. This mechanism significantly improves system efficiency and throughput.
  • Fraud Proof: If someone discovers an invalid transaction in a batch, they can submit a fraud proof during the dispute period. The fraud proof is a specific computational step demonstrating that a certain transaction in the batch is invalid. It requires providing relevant computational data and steps to prove that the submitter submitted invalid transactions. After successful fraud verification, the system rolls back the invalid transaction, penalizes the Rollup submitter who submitted the invalid transaction, and updates the state root to reflect the correct state.

For developers, the advantage of Optimistic Rollups lies in their compatibility with the Ethereum Virtual Machine (EVM) (or better yet, equivalence). EVM-compatible Rollups conform to the specifications in the Ethereum Yellow Paper and support the EVM at the bytecode level. Therefore, existing decentralized applications can be easily ported to Optimistic Rollups or new decentralized applications can be created using Ethereum development tools.