Introduction
Hi, I'm cardene, a software engineer and technical writer focused on blockchain and AI.
I've also authored Japanese technical books on specification-driven development with LLMs and decentralized application (DApp) development.
I also build and publish a variety of tools, libraries, and open-source projects.
EIP-1884 reprices several resource-intensive EVM instructions and introduces SELFBALANCE, a low-cost instruction for obtaining a contract's own ETH balance. Its objective is to align gas accounting more closely with the resources consumed by Ethereum nodes.
This article translates, summarizes, and explains the original proposal.
Other EIP proposals are covered here.
Overview
EIP-1884 adjusts the gas costs of several Ethereum opcodes. Gas is the unit used to meter computation and other resources consumed when executing smart contracts and transactions. An opcode is an instruction executed by the EVM, with an associated gas cost.
As Ethereum's state grew, some instructions began consuming considerably more resources than originally anticipated, including processing time and memory or storage access. EIP-1884 increases their gas costs to restore a closer relationship between gas accounting and the actual workload imposed on the network.
Motivation
Ethereum uses gas to account for transaction execution costs. Ideally, an opcode's gas cost should reflect the resources required to execute it, including CPU time and memory usage.
However, as Ethereum's state grows, instructions that were once inexpensive can become considerably more demanding. When their gas costs do not reflect that change, several problems arise.
First, underpriced instructions create opportunities for denial-of-service attacks. Blocks containing many such instructions may take disproportionately long for nodes to process. This can delay synchronization and increase security risks.
Second, underpricing undermines the usefulness of the block gas limit, which caps the total gas consumed by transactions in a block. Two blocks consuming the same amount of gas may require very different amounts of processing time, making execution workloads less predictable.
Third, setting an appropriate block gas limit becomes more difficult. When gas costs accurately reflect resource consumption, it is easier to reason about how much work a block contains and maintain more consistent processing times. This matters for Ethereum's overall performance.
EIP-1884 therefore raises the cost of selected instructions to better reflect their resource requirements.
Specification
Background and objectives
EIP-1884 adjusts the gas costs of several EVM opcodes and introduces SELFBALANCE. These changes aim to improve the relationship between resource consumption and gas accounting.
The numbers below describe the historical gas schedule introduced by EIP-1884 at the Istanbul hard fork, not the complete current Ethereum gas schedule. Later EIPs, notably EIP-2929, changed the accounting for state access.
Opcode repricing
An opcode's gas cost may no longer reflect actual resource usage as state grows. EIP-1884 increases the costs of the following three instructions.
Repricing SLOAD (0x54)
SLOAD reads a value from a contract's storage slot. Its cost increased from 200 gas to 800 gas under EIP-1884. Storage access had become a particularly significant component of node workload, motivating the adjustment.
Repricing BALANCE (0x31)
BALANCE retrieves the ETH balance of an address. Its cost increased from 400 to 700 gas to better reflect the resources required to access account information.
Repricing EXTCODEHASH (0x3F)
EXTCODEHASH retrieves the code hash associated with an address. Its cost likewise increased from 400 to 700 gas. Accessing account information can involve disk I/O, motivating its inclusion in the repricing.
Introducing the SELFBALANCE opcode
The proposal also introduces SELFBALANCE (opcode 0x47). This instruction retrieves the ETH balance of the currently executing account, corresponding to address(this) in Solidity, and pushes the result onto the stack.
SELFBALANCE takes no stack arguments and pushes exactly one value. Its gas cost is 5, making it an inexpensive alternative to using BALANCE to retrieve the executing account's own balance.
This is useful when a contract needs to inspect its own balance, for example before transferring ETH.
Rationale
Why opcode repricing was necessary

Analysis of full synchronization data from Geth, an Ethereum client, showed that certain opcodes contributed substantially to block processing time.

The charts aggregate opcode execution times by block range. Instructions including SLOAD, BALANCE, and EXTCODEHASH illustrate the significant workload associated with state-dependent operations.
The historical cost of SLOAD

SLOAD reads contract storage. This operation can involve disk I/O and become expensive as the state grows. EIP-150 had already increased its cost from 50 to 200 gas.
For background on EIP-150, see:
[EIP-150] Increasing the Gas Costs of EVM Opcodes
The chart derived from Geth synchronization logs tracks SLOAD execution time over intervals of 10,000 blocks. It shows a substantial reduction after EIP-150, followed by a gradual increase. By block seven million, execution times had exceeded their pre-EIP-150 levels.
The rationale for quadrupling the cost from 200 to 800 gas was to bring the measured processing time back toward approximately 40 on the chart's scale. This was an estimate based on historical measurements, not a guaranteed processing-time target. As the state continued to grow, further repricing could become necessary. EIP-1884 was therefore an interim adjustment rather than a permanent solution.
The cost of BALANCE and the rationale for a new opcode

BALANCE retrieves an account's ETH balance and can require access to the state trie. EIP-150 had raised its cost from 20 to 400 gas, but the historical measurements showed that its gas cost still did not fully reflect resource consumption.
The difficulty is that BALANCE serves two different use cases: retrieving the currently executing account's balance and retrieving an arbitrary account's balance. The latter may require a more expensive trie lookup.
EIP-1884 therefore introduces SELFBALANCE, a dedicated low-cost instruction for the first use case. Under the Istanbul gas schedule, BALANCE costs 700 gas while SELFBALANCE costs a fixed 5 gas.
Technical considerations for SELFBALANCE
SELFBALANCE (0x47) obtains the balance of the currently executing account. Its stack behavior is simple: it consumes no arguments and pushes the balance as one stack item. Conventional BALANCE, by contrast, consumes an address argument.
The proposal assigns SELFBALANCE to the 0x4X opcode range rather than the 0x3X range associated with instructions such as BALANCE, where the available opcode slots were constrained.
The rationale for charging 5 rather than 2 gas is that accessing the balance is not equivalent to reading a simple execution-context constant. Even when the implementation uses cached state, accessing account state has a cost. The balance can also change during transaction execution, unlike context values such as gasPrice or timestamp.
Aligning EXTCODEHASH and BALANCE costs
EXTCODEHASH obtains the code hash associated with an account. EIP-1052 introduced it in the Constantinople hard fork with a cost of 400 gas, matching BALANCE, because both instructions require access to account information.
When EIP-1884 increased BALANCE to 700 gas, it applied the same cost to EXTCODEHASH to maintain consistency in the accounting of their resource consumption.
For background on EIP-1052, see:
[EIP-1052] Introducing the EXTCODEHASH Opcode
Test cases
Tests should verify that SELFBALANCE pushes the ETH balance of the executing account onto the stack. Its result should match that of executing BALANCE for the current account's address.
Tests should also verify that the existing BALANCE instruction preserves its functional behavior under the new gas schedule and that SELFBALANCE consumes no stack arguments. The historical reference to the existing gas cost must be understood in the context of the repricing: the Istanbul cost of BALANCE is 700 gas rather than 400.
The new gas costs of SLOAD, BALANCE, EXTCODEHASH, and SELFBALANCE should be tested as well.
Finally, SELFBALANCE is an invalid opcode before the Istanbul activation block. Tests should cover execution on both sides of the fork boundary. Some of these tests were provided as state tests in the following repository.
Implementation example
The historical Geth (go-ethereum) implementation of SELFBALANCE is shown below.
func opSelfBalance(pc *uint64, interpreter *EVMInterpreter, contract *Contract, memory *Memory, stack *Stack) ([]byte, error) {
stack.push(interpreter.intPool.get().Set(interpreter.evm.StateDB.GetBalance(contract.Address())))
return nil, nil
}The implementation retrieves the balance associated with contract.Address() from StateDB and pushes it onto the stack. Unlike BALANCE, it does not pop an address argument. This provides a simple way to retrieve the balance of the current execution context.
Security considerations
The behavior of SELFBALANCE is based on an operation already defined by the EVM: retrieving the balance of the executing account. The instruction itself does not introduce a new authorization mechanism.
The repricing, however, has important compatibility implications. Contracts and compiler-generated code that assume hard-coded opcode costs may behave unexpectedly after a gas schedule change. Code that checks available gas or relies on a fixed gas budget can fail where it previously succeeded.
A practical example is a contract receiving ETH through CALL and attempting to emit a log. A LOG instruction consumes 375 base gas plus 375 gas per topic, as well as data and any applicable memory costs. Adding a repriced SLOAD can cause a receiver operating under a tight gas budget to run out of gas. In particular, contracts relying on the 2,300-gas stipend require careful consideration.
Citation
Martin Holst Swende (@holiman), "EIP-1884: Repricing for trie-size-dependent opcodes," Ethereum Improvement Proposals, no. 1884, March 2019. [Online serial]. Available: https://eips.ethereum.org/EIPS/eip-1884.
Conclusion
EIP-1884 reprices resource-intensive EVM opcodes and introduces SELFBALANCE as an inexpensive instruction for retrieving the executing account's ETH balance. It illustrates why Ethereum's gas schedule must adapt as the resource requirements of state-dependent instructions change.
Questions are welcome through Twitter direct messages.
I also publish on the following platforms.



