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.