EIP-2780 · Last Call · Core · 2020-07-11
EIP-2780: Resource-based intrinsic transaction gas
Breaks the flat 21,000-gas transaction base cost into priced parts (sender, recipient, value, account creation), so simple calls get cheaper and state-growing transfers pay for the state they add.
What problem does it solve?
Every Ethereum transaction pays a flat 21,000 gas before any code runs. That single number ignores what the transaction actually does. A zero-value call to an existing account and an ETH transfer that creates a brand-new account both pay 21,000, even though the second writes an extra balance and permanently grows the state. Simple transactions overpay; state-creating ones underpay.
EIP-2780 replaces the constant with a sum of named primitives, each priced from measured client run times, and charges state-dependent costs only when they actually happen.
How it works
Intrinsic gas (computable from the transaction alone; the only input to validity):
| Part | Gas | When |
|---|---|---|
TX_BASE_COST |
12,000 | Always: signature recovery, sender access/write, inclusion |
COLD_ACCOUNT_ACCESS |
3,000 | Recipient that is not the sender |
TX_VALUE_COST |
6,000 | Non-zero value to a different account (balance write + transfer log) |
CREATE_ACCESS |
12,000 | Contract-creation transactions, instead of the two above |
So a plain ETH transfer to an existing account still costs 21,000, a zero-value call costs 15,000, and a self-transfer costs 12,000. Recipient access is always charged at the cold rate, even if an EIP-2930 access list lists it.
Runtime gas (state-dependent, charged just before the first call frame):
- Sending value to a non-existent account, or deploying to a fresh address, pays a new-account state gas charge (
STATE_BYTES_PER_NEW_ACCOUNT × CPSB, 183,600 at current parameters from EIP-8037). - Calling an EIP-7702 delegated account pays for loading the delegation target (3,000 cold / 100 warm).
- 7702 authorizations pay a fixed per-authorization base intrinsically, plus new-account, first-write and delegation-byte charges only when they apply.
If runtime gas runs out, the transaction is not invalid: it is included, the sender pays for gas used, the nonce increments, and pre-execution state changes (including delegations) are reverted — like an out-of-gas inside a call.
Sample code
Pseudocode for the intrinsic base (calldata, access-list and authorization charges are unchanged and omitted):
TX_BASE_COST = 12_000
COLD_ACCOUNT_ACCESS = 3_000
TX_VALUE_COST = 6_000
CREATE_ACCESS = 12_000
def intrinsic_base(tx) -> int:
gas = TX_BASE_COST
if tx.to is None: # contract creation
return gas + CREATE_ACCESS
if tx.to == tx.sender: # self-transfer
return gas
gas += COLD_ACCOUNT_ACCESS
if tx.value > 0:
gas += TX_VALUE_COST
return gas
assert intrinsic_base(Tx(sender=A, to=B, value=1)) == 21_000
assert intrinsic_base(Tx(sender=A, to=B, value=0)) == 15_000
Things to know
- Status is Last Call. It depends on several other proposals still in Last Call — notably EIP-8037 (state gas) and EIP-8038 (access costs) — and its numbers move if theirs do.
- It is a consensus change that needs a network upgrade. Wallets and gas estimators that hard-code 21,000 must be updated, especially for transfers that create new accounts, which become far more expensive.
- The EIP-7623 calldata floor is rebased on the decomposed base instead of the fixed 21,000.
- Calldata and access-list pricing are not changed.