What is the L1 data fee?

2 min read

Short answer

The L1 data fee is the part of a transaction's cost on an OP Stack chain, such as Base or OP Mainnet, that pays for publishing the transaction's data to Ethereum. It comes on top of the execution gas fee, so gas used × gas price alone undercounts what the transaction cost.

On this page
The cost of a transaction on an OP Stack chain such as Base: the L2 execution fee plus the L1 data fee, which together make up blockchain.tx.fee.

Where does it come from?

OP Stack chains publish their transaction data to Ethereum, so anyone can download it and re-execute the chain. Publishing costs Ethereum gas. The L1 data fee passes that cost on to each transaction’s sender (OP Stack fee docs).

So the total cost has two main parts:

Part Pays for Depends on
Execution gas fee Running the transaction on the L2 Gas used × (base fee + priority fee)
L1 data fee Publishing its data to Ethereum Compressed size of the transaction, Ethereum’s base fee and blob base fee

Since the Isthmus upgrade, a chain operator can also configure an operator fee. It’s a third, separate part.

Why should agents care?

Base’s own docs say the L1 fee is typically higher than the L2 execution fee (Base network fees).

That changes the math for an agent with a wallet:

  • Budgets drift. A spend limit built on gas used × gas price misses most of the cost.
  • Same gas, different price. Two transactions with identical gas usage can cost different amounts, because the data fee depends on their size and on Ethereum’s prices at that moment.
  • Hard to spot later. The block explorer shows the total, but not which agent step paid it.

How do I see it?

Before sending, estimate it. viem has estimateL1Fee for OP Stack chains.

After the transaction is mined, the receipt on an OP Stack chain carries the actual amount in an extra l1Fee field. That’s the number to record.

FAQ

Is the L1 data fee part of gasUsed?

No. Gas used times the effective gas price gives only the execution fee. The L1 data fee is a separate amount that OP Stack chains report on the receipt.

Why does the same transaction cost different amounts at different times?

The execution fee follows the L2's own base fee. The L1 data fee follows Ethereum's base fee or blob base fee. The two move independently.

Can I estimate it before sending?

Yes. viem's OP Stack actions include estimateL1Fee, and Base exposes a GasPriceOracle contract with getL1Fee. The final amount is on the receipt.

Go further

Type to search the docs, Learn topics and the blog.