A Brief Understanding of the Operating Mechanism and Progress of Ethereum Layer 2 Solution Optimism
Original Title: "Plain Language Interpretation of Optimism's Operating Mechanism", Author: 0xRafi, Compiled by: ETH Chinese Station
1/ Due to the Optimism team's announcement that the mainnet launch will be advanced, I believe it is necessary for everyone to understand what the Ethereum Layer 2 solution Optimism is, how it works, and what it will bring to Ethereum.
2/ The reason everyone is so eager is that L2 solutions like Optimism help to: increase Ethereum's throughput (transactions per second); shorten transaction packaging wait times (the time it takes to confirm a transaction); and significantly reduce gas fees. Moreover, this is done without sacrificing the security of the Ethereum mainnet.
3/ This is the main difference between a true Layer 2 solution and a "pure sidechain" solution (like @0xPolygon or @xdaichain). Sidechain solutions have their own consensus mechanisms and security, and cannot benefit from the security of Ethereum Layer 1, while Layer 2 solutions can maintain the security of the Ethereum Layer 1 network.
4/ For example, if we use Optimism: when a user submits a transaction on the Ethereum mainnet (or Layer 1), the transaction data will be stored on L1, but the smart contract computation will be processed on the sidechain (i.e., Layer 2), and the final computation result will be sent back to Layer 1.
5/ Since the computation process is the most time-consuming and costly part of a transaction, processing computations on Layer 2 greatly reduces the computational demands on Layer 1, thereby increasing network throughput and lowering transaction fees. L1 only receives transaction data, sends it to L2, and then receives the computation results from L2.
6/ Optimism is a relatively "general" solution. Any Solidity smart contract on L1 (i.e., any L1 app) can run on Optimism's Layer 2 without needing to build additional functionalities.
7/ The following diagram shows how Optimistic Rollup works, with the two large boxes representing the Optimistic Rollup contract and the Optimistic Virtual Machine (OVM). The Rollup is for L1 smart contracts, responsible for receiving transaction data, sending data to L2, and receiving computation results. However, the interesting part happens in L2.
8/ On L2, transactions are submitted to a "Sequencer" (which can be thought of as miners on L2). It will immediately respond, generating a signed receipt to guarantee the execution and ordering of the transaction. However, what happens if the sequencer acts maliciously, fails to execute the transaction correctly, or front-runs the transaction?
9/ In such cases, users can submit the signed receipt to the adjudicator contract on L1, and if it is confirmed that the sequencer did not fulfill its obligations correctly, it will be penalized (i.e., lose its staked funds). Therefore, L2 can be considered a small PoS system.
10/ But when disputes arise, the adjudicator contract on L1 should be able to compute just like on L2 and obtain exactly the same computation results. This requires the use of OVM.
11/ OVM can be seen as an L2 adapter on L1, ensuring that the Ethereum Virtual Machine (EVM) on L1 processes L2 computations just like it does on L2. The purpose of this is to allow any computation on L2 to be verified on L1 (if needed). This is very important.
12/ The term "Optimistic" comes from the assumption that all computations performed on L2 are correct until someone raises a dispute. If a dispute arises, the adjudicator on L1 will rerun the computation on the Ethereum network and check the results.
13/ To incentivize users to act as "watchtowers" and verify computation results, Optimism is set up so that anyone who discovers dishonest behavior and raises an objection can receive a portion of the penalty from the malicious sequencer. Even if users do not verify all their transactions themselves, other users will help verify.
14/ The best part is that once enough Ethereum apps are running on Optimism's Layer 2 network, most users will spend the majority of their time on L2 without needing to return to L1 (unless there is a dispute that needs resolution, or users have withdrawal needs).
15/ At this point, readers may feel that this will render Ethereum L1 ineffective. However, in fact, this will further expand Ethereum's ecosystem, allowing Ethereum to support new, higher-throughput applications, which is currently unachievable given the network's capacity.
16/ Another great point about Optimism is that it has "account abstraction" functionality. This means that each account can be modified as a "contract" account, allowing for various transaction conditions, such as multi-signature or other gas payment methods.
17/ So, what is the current application status of Optimism? First, Synthetix is currently running Optimism on a private mainnet. Once the implementation is complete, Synthetix plans to fully migrate its staking and mining functions to L2 while retaining trading functionality on both L1 and L2.
18/ @Uniswap ran a gamified proof of concept (Unipig) using Optimistic Rollups on October 19, and once Optimism launches its mainnet, Uniswap will be one of their first users. @chainlink also announced its collaboration with Optimism, and @coinbase wallet has added native support for the Optimism testnet…
19/ @compoundfinance is also expected to support Optimism (not yet confirmed), and @RariCapital will integrate Optimism into their platform. Many more projects will join in the future, which will have a significant impact on Ethereum's network speed and transaction fees.
20/ What this means for us: Synthetix's tests show that using Optimism can reduce gas fees by up to 143 times, with transaction confirmation times as low as 200 milliseconds; while Unipig tests show that gas fees can be reduced by up to 100 times, with transaction confirmation times as low as 169 milliseconds.
21/ Optimistic Rollups are also very suitable for the Ethereum 2.0 ecosystem. Because Ethereum 2.0 will first launch data scalability solutions, followed by computation scalability solutions. In the early stages, Rollup will primarily ensure scalability in computation and coexist with Ethereum 2.0.
22/ Optimistic Rollups are also very suitable for the Ethereum 2.0 ecosystem. Because Ethereum 2.0 will first launch data scalability solutions, followed by computation scalability solutions. In the early stages, Rollup will primarily ensure scalability in computation and coexist with Ethereum 2.0.
23/ The last great idea proposed by the Optimism team is to use MEVA (Miner Extractable Value Auction) to select sequencers. Karl published an article on ethresear.ch titled "MEV Auction: Solving the MEV Problem by Auctioning Transaction Ordering Rights" to explain this.
24/ Finally, here are some other links:
Optimistic Rollup Introduction
@kelvinfichter's Video Introduction to Optimism
Blockcrunch Podcast, guest @kevinjho:
Synthetix announces Migration to Optimism