Recently, the Ethereum network activated the Dencun upgrade, which implemented EIP-4844. This proposal, aimed at introducing a new type of transaction, seeks to reduce the transaction fees for rollups, thereby advancing the scaling of Ethereum.
This provides an excellent opportunity for me to explore the characteristics of transaction fees on Optimism in this blog post. Notably, as OP Mainnet is a rollup, it benefits from the Dencun upgrade. Before diving into a detailed explanation, let's start with a simple experiment.
The purpose of this experiment is to elucidate the characteristics of Optimism's transaction fees by measuring the fees of various types of transactions. In particular, we will consider the correlation between the gas usage by the transactions (the horizontal axis) and the transaction fees (the vertical axis). If the transaction fees are calculated as a product of gas usage and gas price, similar to Ethereum, then the plot should represent a straight line passing through the origin.
The measurements were taken before and after the Dencun upgrade. This will also help us understand the impact of EIP-4844 on the characteristics of transaction fees.
The transactions measured are of the following three types:
A transaction sending 0 ETH to one's own account.
A transaction similar to the first, but with the string "1234567890" encoded as input data.
A transaction like the first, but with a longer string "1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" encoded as input data.

The gas price set for issuing these transactions is 0.1 Gwei. The input data, limited to human-readable strings (pre-encoding) due to Rabby Wallet's specifications, were added to the transactions.
To minimize the impact of Ethereum mainnet's Base Fee fluctuations, the transactions were measured in the sequence '1→2→3→1→2→3→1→2→3', repeating each three times, and the average values were used as the data. Due to the limited number of measurements, no analysis using standard deviation was conducted. Instead, I made sure that the variation in each measurement was sufficiently small before I calculated the averages.
The first set of measurements was conducted on February 12, 2024, before the Dencun upgrade. The results are plotted as shown in Figure 2. As mentioned, Ethereum's transaction fees typically plot a straight line through the origin, so I set the horizontal axis range starting at zero to confirm the origin.

From Figure 2, it is evident that the plot does not form a straight line through the origin. Instead, the fees for transactions 2 and 3 surged significantly.
The second set of measurements was conducted on March 18, 2024, after the Dencun upgrade. The results are plotted in Figure 3. Compared to Figure 2, this plot appears more linear and seems to pass through the origin. A linear approximation of this plot is shown in Figure 4. Still, the fees for transactions 2 and 3 tended to be higher relative to the gas usage. This trend might be attributed to the string input in these transactions.


From these results, I can infer the following:
Optimism's transaction fees did not proportionally align with the gas usage.
The length and presence of input strings in the transactions might be a factor causing this discrepancy.
This tendency was more pronounced before the Dencun Upgrade.
Was the insight gained from the experiment accurate? Let's trace the mechanics of Optimism's transaction fees to deepen our understanding.
Optimism's transaction fees consist of the following two components:
Execution Gas Fee
L1 Data Fee
The Execution Gas Fee is the cost for executing a transaction on L2. Optimism uses a fee model compliant with EIP-1559, similar to L1, where the Base Fee rises with increased demand. For more details, please refer to my previous blog post.
https://mirror.xyz/hashigo%F0%9F%94%B4.eth/sZ42ZTmmEzC99gTQ7djtkec6AOXcoJNxgLO6wpHfDXA
The 0.1 Gwei value specified in the experiment refers to this Execution Gas Fee.
On the other hand, the L1 Data Fee is the cost necessary to publish Optimism's transactions on Ethereum. As OP Mainnet is an Optimistic Rollup, its transactions must be made public on L1, and this incurs the L1 Data Fee. This fee is automatically deducted from the user's account at the time of transaction execution.
Let's look at the types of transactions OP Mainnet is sending to L1 to sustain itself. The "Transaction Flow" page on Optimism's documentation can be very informative. Let's reference a diagram from there.

As Figure 5 illustrates, the op-batcher submits batches of compressed transactions, and the op-proposer submits state commitments to L1. Naturally, both incur ETH payments on L1.
Let's examine this on the explorer. The op-batcher submits transaction batches to this address. For transactions before the Ecotone upgrade (Optimism's upgrade to accommodate EIP-4844), you can see data written in calldata. After Ecotone, blobs are used, and the writing of data can be seen on blobscan. Similarly, the op-proposer's submission of state roots can be observed here.
Next, let's look at how much is being paid. This Dune dashboard shows the breakdown of OP Mainnet's on-chain costs. Before Ecotone, about 98% was comprised of L1 Calldata Fees, but after Ecotone, L1 Overhead Fees and L1 State Outputs take up most of the total. In other words, before Ecotone, the L1 Data Fee was a significant burden, but after Ecotone, the L1 Data Fee almost disappeared. These on-chain costs were transferred to users through a set formula, hence the characteristic appearance in transaction fees.

The experiment showed a surge in the cost of transactions with inputted strings, especially in the measurements taken on February 12, 2024. Before the Ecotone, OP Mainnet had to compress and submit these transactions to L1, including the data of inputted strings. As L1 Calldata Fees constituted most of the on-chain costs, and these were transferred to users, the fees for transactions with input strings surged, resulting in a plot like Figure 2.
After Ecotone, blobs began to be used for storing these data, significantly reducing the L1 Data Fee and leading to a plot like Figure 3. However, some on-chain costs still occurred, requiring a degree of cost transfer to the users, hence the plot not being a straight line through the origin.
In this blog post, I have clarified the characteristics of Optimism's transaction fees and how the EIP-4844 and Dencun upgrade affected these characteristics. The results from the experiment suggest that Optimism's transaction fees behave differently from Ethereum's.
Particularly intriguing was the impact of the amount of data input into transactions on the fees. The Ecotone upgrade significantly reduced the cost of transactions (especially those with large data), which is not only beneficial for users but also contributes greatly to Ethereum's scaling.
I have not yet decided on the date for the next blog update, but I will continue to cover Optimism in this blog series, so stay tuned.
Stay Optimistic🔴✨️
Transaction Fees on OP Mainnet, https://docs.optimism.io/stack/transactions/fees .
Transaction Flow, https://docs.optimism.io/stack/protocol/transaction-flow .
oplabspbc, Share of Total Onchain Costs by Contributor (Dune dashboard), https://dune.com/queries/2453515/5930935.
For official resources on Optimism, author attribution has been omitted.

