You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: pages/stack/transactions/fees.mdx
+83-12Lines changed: 83 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,6 +15,7 @@ categories:
15
15
- gas
16
16
- l1-data-fee
17
17
- execution-gas-fee
18
+
- operator-fee
18
19
- eip-1559
19
20
- sequencer-fee-vault
20
21
is_imported_content: 'false'
@@ -26,7 +27,7 @@ import { Callout } from 'nextra/components'
26
27
The OP Stack maintains a distinct gas limit compared to the Ethereum mainnet.
27
28
While both chains use the same underlying transaction formats, Optimism's gas limits are tailored for optimal Layer 2 performance and scalability.
28
29
As a result, transactions on Optimism may behave differently from the mainnet regarding gas usage and fee estimation.
29
-
For a detailed comparison of gas limits between Optimism and Ethereum, see the [Optimism Chain Differences documentation](https://docs.optimism.io/chain/differences?utm_source=op-docs&utm_medium=docs#transaction-fees).
30
+
For a detailed comparison of gas limits between Optimism and Ethereum, see the [Differences between Ethereum and OP Stack Chains](https://docs.optimism.io/chain/differences?utm_source=op-docs\&utm_medium=docs#transaction-fees).
30
31
</Callout>
31
32
32
33
# Transaction fees on OP Mainnet
@@ -35,8 +36,23 @@ OP Mainnet is designed to be [EVM equivalent](https://web.archive.org/web/202311
35
36
However, transaction fees on all Layer 2 systems need to diverge from Ethereum to some extent for a number of reasons.
36
37
This page provides a detailed look at exactly how transaction fees work on OP Mainnet so you can properly account for them in your application.
37
38
38
-
OP Mainnet transaction fees are composed of an [Execution Gas Fee](#execution-gas-fee) and an [L1 Data Fee](#l1-data-fee).
39
-
The total cost of a transaction is the sum of these two fees.
39
+
OP Mainnet transaction fees are composed of an [Execution gas fee](#execution-gas-fee), an [L1 data fee](#l1-data-fee), and after the [Isthmus upgrade](/notices/upgrade-14#operator-fee), an [operator fee](#operator-fee).
40
+
The total cost of a transaction is the sum of these fee components:
Continue reading to learn more about exactly how each of these fee components are charged.
41
57
42
58
## Execution gas fee
@@ -112,7 +128,7 @@ the L1 Data Fee are generally quite small and should not impact the average tran
112
128
113
129
<Callout>
114
130
The L1 Data Fee formula changed with the Ecotone upgrade.
115
-
Refer to the [Network Upgrade Overview](/operators/node-operators/network-upgrades) for network upgrade activation timestamps for OP Sepolia and OP Mainnet.
131
+
Refer to the [Network upgrade overview](/operators/node-operators/network-upgrades) for network upgrade activation timestamps for OP Sepolia and OP Mainnet.
116
132
</Callout>
117
133
118
134
Prior to the Ecotone upgrade, the L1 Data Fee is calculated based on the following parameters:
The new cost function takes into account the compression ratio, so chain operators will need to adjust their `baseFeeScalar` and `blobFeeScalar` to account for any previous compression ratios that they encountered on their chains. Chain operators can use the [Fjord fee parameter calculator](https://docs.google.com/spreadsheets/d/1V3CWpeUzXv5Iopw8lBSS8tWoSzyR4PDDwV9cu2kKOrs/edit#gid=186414307) to get a better estimate of scalar values to use for their chain.
226
242
227
-
## Sequencer Fee Vault
243
+
## Operator fee
244
+
245
+
<Callout>
246
+
The Operator fee is introduced with the [Isthmus upgrade](/notices/upgrade-14#operator-fee) and provides OP Stack chains with more flexible pricing models.
247
+
Refer to the [Network upgrade overview](/operators/node-operators/network-upgrades) for network upgrade activation timestamps.
248
+
</Callout>
249
+
250
+
The Operator fee is a new fee component introduced with the Isthmus upgrade that enables more customizable fee structures for OP Stack chains. This fee is integrated directly into the EVM alongside the standard gas fee and L1 data fee, allowing chain operators to implement additional revenue models or cover specific operational costs.
251
+
252
+
### Mechanism
253
+
254
+
The Operator fee is automatically charged for any transaction that is included in a block after the Isthmus activation. This fee is deducted directly from the address that sent the transaction and follows the same semantics as existing fees charged in the EVM. The collected operator fees are sent to the **Operator Fee Vault**, a new vault similar to existing fee vaults.
255
+
256
+
<Callout>
257
+
**Deposit transactions do not get charged operator fees.** For all deposit transactions, regardless of the operator fee parameter configuration, the operator fee is always zero.
258
+
</Callout>
259
+
260
+
### Formula
261
+
262
+
The Operator fee is calculated using the following formula:
*`gas` is the amount of gas that the transaction used
271
+
*`operatorFeeScalar` is a `uint32` scalar set by the chain operator, scaled by 1e6
272
+
*`operatorFeeConstant` is a `uint64` scalar set by the chain operator
273
+
274
+
### Configuration
275
+
276
+
The `operatorFeeScalar` and `operatorFeeConstant` parameters can be accessed in two ways:
277
+
278
+
1.**From deposited L1 attributes** of the current L2 block
279
+
2.**From the L1 Block Info contract** (`0x4200000000000000000000000000000000000015`):
280
+
* Using solidity getter functions (`operatorFeeScalar`, `operatorFeeConstant`)
281
+
* Using direct storage reads:
282
+
* Operator fee scalar as big-endian `uint32` in slot `8` at offset `0`
283
+
* Operator fee constant as big-endian `uint64` in slot `8` at offset `4`
284
+
285
+
### EVM Integration
286
+
287
+
The Operator fee follows standard EVM fee semantics:
288
+
289
+
1.**Pre-execution validation**: Account must have enough ETH to cover worst-case gas + L1 data fees + worst-case operator fee
290
+
2.**Gas purchase**: Account is charged the worst-case operator fee before execution
291
+
3.**Refunds**: After execution, unused operator fee gas is refunded to the account
292
+
4.**Fee distribution**: The spent operator fee is sent to the Operator Fee Vault
293
+
294
+
### Transaction pool impact
295
+
296
+
Transaction pools must account for the additional operator fee when validating transactions. Transactions without sufficient balance to cover the worst-case total cost (including operator fee) will be rejected.
297
+
298
+
## Sequencer fee vault
228
299
229
-
The Sequencer Fee Vault collects and holds transaction fees paid to the sequencer during block production on OP Mainnet. These fees cover the cost of posting transaction data to L1, ensuring network sustainability and data availability.
300
+
The Sequencer fee vault collects and holds transaction fees paid to the sequencer during block production on OP Mainnet. These fees cover the cost of posting transaction data to L1, ensuring network sustainability and data availability.
230
301
231
-
### Fee Collection and Distribution
302
+
### Fee collection and distribution
232
303
233
-
***Purpose**: The sequencer deposits collected fees into the Sequencer Fee Vault. These fees reimburse the sequencer for gas costs when submitting transaction batches to L1.
234
-
***Vault Address**: The Sequencer Fee Vault is predeployed at the address `0x4200000000000000000000000000000000000011` on the OP Mainnet.
235
-
***Fee Usage**: Stored fees are eventually transferred to a designated recipient address (e.g., a treasury or distribution contract).
304
+
***Purpose**: The sequencer deposits collected fees into the Sequencer fee vault. These fees reimburse the sequencer for gas costs when submitting transaction batches to L1.
305
+
***Vault address**: The Sequencer fee vault is predeployed at the address `0x4200000000000000000000000000000000000011` on the OP Mainnet.
306
+
***Fee usage**: Stored fees are eventually transferred to a designated recipient address (e.g., a treasury or distribution contract).
236
307
237
308
### How it works
238
309
239
-
1.**Fee Collection**: During the processing of transactions, the sequencer collects fees from users as part of their transaction costs. These fees are primarily used to cover the gas expenses of posting transaction data to Ethereum L1.
240
-
2.**Storage**: Collected fees are deposited into the Sequencer Fee Vault contract.
310
+
1.**Fee collection**: During the processing of transactions, the sequencer collects fees from users as part of their transaction costs. These fees are primarily used to cover the gas expenses of posting transaction data to Ethereum L1.
311
+
2.**Storage**: Collected fees are deposited into the Sequencer fee vault contract.
241
312
3.**Distribution**: The fees are later distributed to the appropriate recipient, typically covering operational costs like L1 gas fees for data availability.
242
313
243
314
This system ensures effective fee management, maintaining the security and operation of the Optimism network.
0 commit comments