Risk Warning: Beware of illegal fundraising in the name of 'virtual currency' and 'blockchain'. — Five departments including the Banking and Insurance Regulatory Commission
Information
Discover
Search
Login
简中
繁中
English
日本語
한국어
ภาษาไทย
Tiếng Việt
BTC
ETH
HTX
SOL
BNB
View Market
Interpreting L2 trading pricing from an algorithmic perspective: The impact of revenue, costs, and agreements.
深潮TechFlow
特邀专栏作者
2023-08-02 10:30
This article is about 3950 words, reading the full article takes about 6 minutes
L2 Token's first step in achieving value accumulation is the decentralized sequencer, which is not easy, but allows L2 token holders to participate in the value generated through the construction and proposal process.

Original Author: 0x Mlze, Salve Boccaccio & 0x Munehisa

Original Compilation: Deep Tide TechFlow

Second Layer Solutions

The Ethereum mainnet currently processes an average of 12 transactions per second. During periods of high network activity, transaction costs have reached levels that are unacceptable to most users. This scalability issue arises from the fact that each node in the network needs to store and validate all transactions that occur on the network.

To address this problem and scale Ethereum, second layer solutions (L2) were invented. The second layer is an independent blockchain that extends Ethereum and inherits its security guarantees. The second layer is essentially a separate blockchain where users can conduct transactions outside the main chain (Ethereum). Each second layer solution has its own security guarantees and trade-offs. The most popular form of second layer scalability on Ethereum is Rollups (Arbitrum, Optimism, zkSync).

Rollups

Rollups are L2 solutions that process transactions on L1 before returning to L1. Standard transactions on Ethereum are typically 156 bytes long, with the signature being the most data-dense part. Therefore, Rollups process multiple transactions within the L2 execution environment, bundle them into a single transaction, and submit it to L1 for regular state verification. Bundling multiple transactions into one transaction can reduce the gas fees paid per transaction because gas fees are distributed among multiple transactions, not just one. However, not all Rollups are the same, and there are many different types of Rollups:

  • Smart Contract Rollups: Optimistic Rollups (Arbitrum, Optimism), Zero-knowledge Rollups (Matic's zkEVM, zkSync, Scroll);

  • Celestiums;

  • Enshrined Rollups;

  • Sovereign Rollups.

Smart Contract Rollups

Smart contract Rollups are Rollup smart contracts where users send funds to L1, and the smart contract manages transactions and state changes.

A crucial component of Rollups and blockchains is the Merkle tree. The Merkle tree is a data structure that stores the financial state and transactions of each individual, allowing L1 to verify the state on L2 without downloading the entire state. In simple terms, users interact and transact on L2 (changing the state), and L2 periodically sends the Merkle root of the state to L1 for verification.

In addition to publishing the Merkle root on L1, L2 must also publish enough Merkle tree change data for users to fully reconstruct the Merkle tree. If L2 stops running for some reason, users would be trapped on L2 without this data. Therefore, L1 smart contracts have an "emergency function" that allows users to withdraw their funds from the smart contract Rollup when L2 stops running.

L1 needs some form of proof to ensure the Merkle root sent by L2 is valid, which is the difference between the two main types of smart contract Rollups. The two main proofs used are fraud proofs and zero-knowledge proofs.

Optimistic Rollup

Optimistic Rollups like Arbitrum and Optimism use fraud proofs for final state confirmation. The working principle of fraud proofs is as follows:

  1. L2 nodes publish the Merkle root along with a small deposit to the L1 smart contract.

  2. The L1 smart contract defaults to trust the L2 nodes, hence the term "Optimistic" - L1 takes an optimistic approach towards L2 updates.

  3. However, these state changes are not finally confirmed within 7 days.

  4. During these 7 days, anyone can submit proof that proves the submitted Merkle root was fraudulent, which will revert the update and penalize the L2 node by giving the deposit to the person reporting the fraudulent update.

  5. The reporter is able to prove the update is fraudulent by verifying all transactions that occurred in the state root change and confirming that each signature on those transactions is valid. This is possible because the L2 node published the Merkle root and enough Merkle change data to recreate the Merkle tree.

  6. If no objections are raised during the 7-day dispute period, the update will be finally confirmed and considered immutable.

ZK Rollup

ZK Rollup uses zero-knowledge proofs. Here's how they work:

  1. Layer 2 nodes publish the Merkle root along with the proof to the L1 smart contract, proving that L2 correctly processed the transactions and generated a new Merkle root.

  2. If a Layer 2 node attempts to publish a fraudulent update, they won't be able to generate a valid zero-knowledge proof, so the L1 smart contract will not accept the new Merkle root.

  3. Once the zero-knowledge proof is verified, the state update is immediately completed.

Sequencers

Sequencers are the mechanism in which L2 collects and publishes transactions back to the Ethereum base chain. In their current centralized state, here's how they work:

  1. Users submit transactions on L2 - DeFi, NFTs, sending/receiving, etc.

  2. These transactions are collected by centralized sequencers.

  3. Then, the sequencers (block builders) arrange these transactions (call data/state differences) in order into a single block or batch of transactions.

  4. Currently, L2 sequencers use a first-in-first-out (FIFO) sorting method for these transactions.

  5. Then, the sequencers submit this batch of transactions back to the Ethereum mainnet to be included in a block.

In the current state, Rollup's sequencers are centralized and controlled by an entity (Arbitrum's Offchain Labs and Optimism's Optimism PBC). This centralization creates a single point of failure for Rollup and may result in liveness issues (as well as lack of censorship resistance) - if the sequencers fail, L2 won't be able to operate properly.

For example, in early June, Arbitrum's sequencer encountered an error that caused a batch to roll back on-chain, resulting in gas cost losses for the batch. During that time, batch submitters were left without gas and couldn't properly send transactions to Ethereum.

L2 Gas Fees

Now let's take a look at how these two main smart contract Rollups calculate the gas fees users will pay and their impact on centralized sequencers.

On Arbitrum and Optimism, users need to pay two fees when making transactions:

  1. L2 Gas/Execution Fees;

  2. L1 Call Data/Security Fees.

L2 Gas/Execution Fees

L2 Gas fees are similar to Ethereum's Gas fees. Every transaction on L2 requires the payment of a gas/execution fee, which is equal to the amount of gas used in the transaction multiplied by the current gas price.

L1 Call Data/Security Fees

L1 Call Data fees are paid to cover the cost of publishing the transaction back to Ethereum. This fee exists because sequencers or batch submitters need to pay L1 gas fees to publish transactions to Ethereum.

Sequencer Revenue Model

In the current form, Optimistic Rollup (ORU) generates revenue through the operation of a single centralized sequencer. In the future, it is expected that ORU will eventually achieve decentralization, which will open the door to other revenue streams such as MEV (Maximizing Ethereum Value) or requiring sequencer operators to stake native tokens/share revenue.

But for now, in the simplest representation, we can consider that the sequencer charges L2 transaction fees from ORU users (sequencer revenue), and there is a need to pay L1 gas fees to batch submit users' L2 transaction data to the Ethereum network (cost 1), as well as pay for the operational costs of operating the sequencer (cost 2).

Furthermore, we can break down the revenue and costs into specific components. Although different ORUs (such as Arbitrum, Optimism) do not have identical pricing formulas, they follow a common framework:


Revenue (L2 Gas Fees)

Fees = L1_gas_price_estimate * (L1_calldata_size + L1_buffer) + L2_gas_price * L2_gas_used

Costs

Costs = L1_actual_gas_price * L1_calldata_size + Sequencer_operational_costs

L2 Fee Pricing

In all ORUs, L2 fee pricing is a function of L1 computation scale, L1 computation cost, L2 computation scale, and L2 computation cost.

Since all L2 sequencers incur costs when batching/proving to the L1 mainnet, it makes sense to pass on the dynamically calculated cost of settling on the mainnet to users when performing L2 transactions.

Arbitrum and Optimism have different pricing mechanisms for L2 fees. A crucial difference between the two lies in how they calculate L1 computation costs. Arbitrum uses an oracle to price L1 computation, meaning that without governance voting, the oracle prices L1 computation in the same way as before 4844. However, Optimism's L1 computation includes a dynamic overhead (scalar) variable that can be adjusted by the Optimism team to modify L1 computation costs.

Arbitrum

Arbitrum's L2 fee pricing includes the concept of "two-dimensional Gas fees," where the gas limit is a function of the Gas units used on L2, the Gas units used on L1, and the estimated L1 Gas price.

From this, we can conclude the following:

  • L2 gas limit decreases as L2 gas price increases.

  • L2 gas limit increases with increases in L2 computation, L1 gas price, and L1 computation.

Optimism

Similar to Arbitrum, Optimism considers the costs of L1 and L2 computation when calculating transaction fees. They refer to these as L2 execution costs and L1 data/security costs.

Note:

  • The dynamic_overhead variable is set by the Optimism team to ensure that their sequencer is adequately compensated for the gas costs incurred when submitting batches of transactions back to the L1 network.

  • Currently, it is set to 0.684, which means the sorter is subsidizing the Gas cost.

  • Historically, this value has mainly been set above 1, indicating that the sorter is charging extra to maintain the L1 settlement Gas buffer.

Dynamic Management Fee / L1 Scalar Fee Over Time

EIP-4844 

Currently, Optimistic Rollup has lower costs for Layer-2 execution and storage, but publishing data to Layer-1 remains expensive for users in order to comply with data availability.

Data is published to Ethereum's Layer-1 using the calldata opcode, and as a result, both Arbitrum and Optimism have implemented calldata compression algorithms such as Zlib and brotli compression algorithms. This data publishing cost is high and occupies 80-90% of the transaction fees paid by L2 users.

However, from October 2023 to February 2024, the highly anticipated Ethereum Improvement Proposal (EIP-4844, Proto-danksharding) is planned for release. EIP-4844 proposes to add a new transaction type to Ethereum that allows for the acceptance of "data blocks". These "data blocks" are removed or pruned approximately two weeks later, unlike existing calldata which is permanently stored. These data blocks are designed to be small enough to reduce storage expenses on the mainnet chain.

High transaction fees on Ethereum Layer 1 (L1) are the main costs for L2 Rollups when publishing batches and proofs. The impact of EIP-4844 is to significantly reduce the cost overhead on L1 while allowing batch data to be available for a sufficient amount of time to publish any fraud proofs. Current estimates peg this cost-saving factor anywhere from 10x to 100x less than the current L1 batch publishing cost.

Advanced Overview of the Impact on Sorter Revenue

Before diving into the changes we expect to see in Arbitrum and Optimism, it's important to consider the differences between Arbitrum and Optimism in terms of L1 computation pricing (as explained in the previous section on L2 fee pricing). Given Arbitrum's L1 pricing oracle, we now know that it is likely to pass on 100% of the fees to the users (unless we see governance voting). The situation is different for Optimism, as they still control the dynamic expenditure variable.

The table below provides potential outcomes after EIP-4844.

Arbitrum

Considering the current financial situation of Arbitrum discussed in the above section, we explore possible variations in Arbitrum valuation under certain assumptions. With the expected significant cost reduction after EIP-4844, people anticipate an increase in profit and profit margin while keeping the revenue unchanged.

Based on this, we have created a table showing various possible outcomes, including different combinations of cost savings passed onto users (Y-axis) and factors of cost reduction from EIP-4844 (X-axis, higher number = higher cost savings from EIP-4844).

We have shaded the combinations that we deem most likely to occur after EIP-4844.

If 100% of the savings are passed onto users, we can speculate that this cost saving could potentially increase the number of transactions on Arbitrum (new types of dApps, more users).

Making some assumptions:

  • Keeping the current price-to-earnings ratio (P/E);

  • Assuming a 10-fold decrease in costs;

  • Increase in transaction volume due to cost savings.

We can calculate the impact of these changes on the prices of ARB and OP. For example, if transaction volume increases by 40% and only 90% of the cost savings are passed onto users, then the price of ARB would be $2.10.

Optimism

For the same calculation as Optimism, we get the following results.

L2 Token Economics and Valuation

Currently, the only value accrual for Arbitrum and Optimism is governance; this is the sole function of ARB and OP. However, the value accrual for ARB and OP may come from two additional sources: transaction fees and MEV.

In their current state, both L2 solutions heavily rely on their centralized sequencer, with all the profits from these centralized block construction and proposed sent to the Arbitrum Foundation and Optimism Foundation. However, both solutions have committed to moving towards decentralized sequencer mechanisms, where the foundation is not the sole entity constructing and proposing L2 blocks. The first step in realizing value accrual for L2 tokens is the decentralized sequencer, which is not easy but can allow L2 token holders to participate in the value generated through the construction and proposal process.

The decentralization of the sequencer is likely to be achieved through a PoS mechanism, where users stake native L2 tokens. If the stakers fail to fulfill their responsibilities or engage in malicious behavior, their staked tokens will be slashed. Stakers can receive a portion of transaction fees, MEV (in a post-FIFO world), or staking rewards in the form of native tokens.

The importance of a decentralized sequencer is that a centralized sequencer may result in user transactions being censored, excessive rent extraction, or harmful MEV, all of which negatively impact users.


Layer 2
Arbitrum
Optimism
Welcome to Join Odaily Official Community