Optimistic Rollup
Optimistic Rollup is a Layer 2 scaling solution for Ethereum. It improves throughput and reduces transaction costs by executing transactions and smart contract operations off-chain, and then submitting the results to the Ethereum main chain (Layer 1). The key concept of this approach is "optimistic," which means adopting an optimistic strategy during the process of verifying result correctness.
Technical Principles
Off-chain Execution
The working principle of Optimistic Rollup is to execute transactions and smart contract operations off-chain and then submit the results to the Ethereum main chain (Layer 1). This means that transactions and smart contract executions no longer need to be broadcast across the entire Ethereum network, reducing network congestion and transaction costs.
Rollup Chain Structure
Although executed off-chain, these operations are recorded in a structure called the Rollup chain. This chain tracks all off-chain state changes and organizes them in the form of a Merkle tree.
Batching
Optimistic Rollup technology bundles multiple off-chain operations into one or more batches and then submits these batches to the main chain. To reduce the size of on-chain data, only the Merkle root is included when submitting.
Optimistic Verification
The key concept of Optimistic Rollup is "optimistic verification." When the operator of the Rollup chain submits batches to the main chain, the system assumes these operations are correct by default. However, there is a time window called the "dispute period" during this process that allows other users to challenge these operations. Challengers must provide evidence to prove that an operation is invalid. If the challenge is successful, the challenger is rewarded, the operator is penalized, and the correct state is restored.
Optimistic Rollup vs zkRollup
Optimistic Rollup and zkRollup are both Ethereum Layer 2 scaling solutions, with the main difference being verification: the former uses optimistic verification, while the latter uses zero-knowledge proof verification. The performance differences between the two are manifested in the following factors:
Layer2 Technical | Optimistic Rollup | zkRollup |
Confirmation Time | Using a provable security model, transactions can be confirmed quickly. | Using zero-knowledge proofs, the confirmation time is slower as it requires proof generation time. |
Security | There is a possibility of being attacked, and a challenge period is necessary to prevent attacks. | Security is relatively higher. |
Scalability | Limited by the challenge period, scalability is relatively smaller. | Scalability is relatively higher, as a single rollup can contain more transactions. |
Complexity | Implementation is relatively simple. | Implementation is more complex, requiring dedicated zero-knowledge proofs. |
Ethereum Compatibility | Implementation is simpler and more easily compatible with the existing Ethereum ecosystem. | Proprietary zero-knowledge proofs are not entirely compatible with the Ethereum Virtual Machine. |
The comparison shows that Optimistic Rollup has advantages in confirmation time, implementation complexity, and Ethereum compatibility. zkRollup is superior in security and scalability.