Part III · Chapter 22 of 43 · London

EIP-3198 & EIP-7516: letting the EVM read its own fee market

EIP-1559 made the base fee a first-class protocol value — computed every block and burned. But a contract couldn't read it: GASPRICE only shows the fused base-plus-priority price the sender paid. EIP-3198 adds BASEFEE; EIP-7516 does the same for blobs. Two tiny opcodes that make the fee market legible on-chain.

Updated Jul 2, 2026 · 6 min
Assumed
  • EIP-1559 (the fee market)
  • EIP-4844 (blobs)

London, August 2021 (and Cancun, March 2024). EIP-1559 turned the gas price into a real protocol variable: every block, the network computes a base fee, and it’s burned. It’s canonical, deterministic, on-chain — and yet, the moment it shipped, a contract had no way to actually read it. That sounds like an oversight, and the fix is almost embarrassingly small; but it’s a clean illustration of a recurring EVM theme — a value can exist in the protocol without existing in the EVM — and it happened twice, once for gas and once for blobs. EIP-3198 and EIP-7516 are the two little reads that close the gap. Let’s derive them together.

1 step A fee you can't read

The problem: the base fee was computed, burned — and invisible to contracts

After EIP-1559, the price a transaction pays splits in two: the burned base fee and the priority tip to the proposer. The only fee value a contract could observe was GASPRICE The opcode (0x3a) returning tx.gasprice — the effective gas price the transaction paid. After EIP-1559 that's base fee + priority tip fused into one number; there was no opcode to recover the base fee component by itself. — which returns the effective price the sender paid, i.e. base fee + tip combined. There was no way to read the base fee on its own. That blocks a surprising amount: a meta-transaction relayer A contract (or smart account) that pays gas on a user's behalf and is reimbursed. To reimburse the exact cost it must know the base fee, not just the fused effective price — otherwise it over- or under-charges. reimbursing a user’s gas needs the base fee to compute the true cost; an on-chain gas oracle wants the base fee as a congestion signal; any contract adapting to network load needs to see it. And later, EIP-4844 introduced a second such value — the blob base fee, with its own EIP-1559-style market — equally computed by the protocol and equally unreadable from the EVM.

the protocol computes fees each block… EIP-1559 base fee EIP-4844 blob base fee computed, burned, on-chain no way in a contract sees only GASPRICE GASPRICE = base + priority, fused — can't read the base fee alone gas oracles & relayers computing refunds are flying blind the fee exists in the protocol but not in the EVM
EIP-1559 computes a base fee each block (and EIP-4844 a blob base fee), both burned and on-chain — but a contract could only read GASPRICE, which fuses base fee and priority tip. Relayers, smart accounts, and gas oracles couldn't read the base fee alone: the fee existed in the protocol but not in the EVM.

→ Step 2: surface each fee as its own opcode.

2 step BASEFEE & BLOBBASEFEE

The fix: two one-instruction reads

Because the values already exist in the block, exposing them is trivial. BASEFEE Opcode 0x48 (EIP-3198, shipped with London alongside EIP-1559): pushes the current block's base fee onto the stack. A single, cheap read of a value the protocol already computes. (0x48), added by EIP-3198 alongside 1559 in London, pushes the current block’s base fee. Later, BLOBBASEFEE Opcode 0x4a (EIP-7516, shipped with Cancun alongside EIP-4844): pushes the current block's blob base fee, the blob-market analogue of BASEFEE. (0x4a), added by EIP-7516 alongside 4844 in Cancun, does exactly the same for the blob base fee. Each is a single, cheap instruction that reads a value the block header already carries — no computation, no new mechanism, just a window into a number that was always there.

just expose the value the protocol already has BASEFEE · 0x48pushes the block's base fee BLOBBASEFEE · 0x4apushes the blob base fee one-instruction reads of a value already computed each block 3198 ships with London/1559 · 7516 ships with Cancun/4844
EIP-3198 adds BASEFEE (0x48) — push the block's base fee; EIP-7516 adds BLOBBASEFEE (0x4a) — push the blob base fee. Each is a one-instruction read of a value the protocol already computes every block. 3198 ships with London/1559; 7516 with Cancun/4844.

→ Step 3: what becomes possible once contracts can see the fees.

3 step Fees, on-chain

The payoff: contracts that understand the fee market

With the base fee readable, relayers and smart accounts can compute gas reimbursements accurately instead of guessing from the fused effective price — important for account abstraction, where a contract front-runs a user’s gas and must be repaid to the wei. On-chain gas oracles and congestion-aware contracts get a first-class signal to key off. And with BLOBBASEFEE, rollup data-availability pricing Rollups post their compressed transaction data as blobs. Reading BLOBBASEFEE lets a rollup contract price its data-availability costs on-chain — passing accurate L1 blob costs through to L2 users. becomes possible on-chain: a rollup can read the current blob base fee and price its data-availability costs precisely, passing real L1 costs through to L2 users. Neither opcode is glamorous — but together they finish the job EIP-1559 and EIP-4844 started, making the fee market not just a protocol mechanism but something the EVM can reason about.

contracts can reason about the fee market on-chain relayers & smart accounts reimburse gas accurately on-chain gas oracles & congestion-aware logic rollups read the blob base fee to price data availability the missing read that completes EIP-1559 and EIP-4844
With the fees readable, relayers and smart accounts reimburse gas accurately, on-chain gas oracles and congestion-aware logic get a first-class signal, and rollups price their data availability against the blob base fee. The small reads that complete EIP-1559 and EIP-4844.
04 Go Deeper Where to take it from here