An Access List is a feature introduced in Ethereum's EIP-2930 that allows a transaction sender to declare the exact set of state keys—specifically, account addresses and storage slots—that the transaction will access. By providing this list upfront, the protocol can waive the cold storage access penalty for those pre-declared items. This mechanism transforms what would be a costly 2,100 gas cold access into a cheaper 100 gas warm access, providing predictable and often reduced total gas costs for complex transactions involving multiple contract calls.
Access List
What is an Access List?
An Access List is a data structure used in Ethereum transactions to specify in advance which storage slots and addresses a transaction will interact with, enabling gas cost optimizations.
The primary technical motivation for Access Lists is to mitigate the gas cost unpredictability introduced by EIP-2929, which increased the cost of accessing cold storage. Without an Access List, the first time a transaction touches a new storage slot or address, it incurs a high cold access fee. By pre-declaring these accesses, the transaction effectively 'warms up' the slots, locking in lower costs. This is particularly beneficial for complex DeFi interactions, batched transactions, and smart contract wallets that may call multiple external contracts in a single execution.
In practice, an Access List is constructed as an array of objects, where each object contains an address and an optional array of storageKeys. Wallets and developers can simulate a transaction first to see which storage slots it touches, then generate and attach the corresponding list. While it adds a minor gas overhead for the list itself, the net effect is often a reduction in total cost for suitable transactions. This tool provides a direct way for sophisticated users to optimize gas expenditure through explicit state declaration.
How Does an Access List Work?
An access list is a transaction parameter in Ethereum that pre-declares the specific storage slots and addresses a transaction will interact with, allowing for more predictable gas costs and mitigating the risk of sudden price spikes.
An access list is a feature introduced by EIP-2930 that allows a transaction sender to specify a list of addresses and storage keys they plan to access. By declaring these interactions upfront, the Ethereum Virtual Machine (EVM) can perform a one-time warm-up of these storage locations. This mechanism directly addresses the gas cost irregularities introduced by EIP-2929, which increased the cost of accessing cold storage (first-time access) while reducing the cost for warm access (subsequent access within the same transaction). The access list essentially pre-pays to warm the specified slots, making the final gas cost more predictable and shielding users from unexpected mid-execution price increases.
The primary function of an access list is gas optimization and cost predictability. Without an access list, a complex transaction that touches many new storage slots could see its gas cost rise dynamically as it executes, potentially leading to an out-of-gas error. By specifying an access list, the transaction pays a fixed, upfront cost to warm all declared slots. While this adds a base cost to the transaction, it often results in an overall net reduction in total gas used, especially for transactions that perform multiple reads or writes to the same pre-warmed storage locations. This is crucial for smart contract interactions involving complex state changes, such as multi-step DeFi operations.
From a technical perspective, an access list is a JSON-like array included in the transaction payload. Each entry contains a address and an array of storageKeys (the 32-byte slots). Wallets and developers can generate these lists by simulating a transaction first to see which storage slots it accesses. It's important to note that an access list is optional; transactions can be sent without one, but they forgo the gas savings and cost certainty. Furthermore, an incorrectly specified access list that omits a needed slot does not cause the transaction to fail—it simply means that slot will be accessed as cold, incurring the higher gas fee at the point of use.
Key Features of Access Lists
Access Lists are a transaction type feature introduced in Ethereum's Berlin hard fork, allowing users to specify and pre-pay for storage access, mitigating gas cost surprises.
Gas Cost Predictability
The primary function of an Access List is to provide gas cost certainty for transactions that interact with smart contract storage. By declaring which storage slots will be accessed, the transaction pre-pays for the cold storage access cost (2,100 gas) upfront, preventing unexpected gas spikes if those slots are accessed later in execution. This eliminates the risk of out-of-gas errors due to unanticipated cold accesses.
Mechanism: Warm vs. Cold Storage
EVM storage slots are either cold (first access) or warm (subsequent access).
- Cold Access: Costs 2,100 gas.
- Warm Access: Costs 100 gas. An Access List declares specific contract addresses and storage keys, warming them at the start of transaction execution. This converts what would be a variable, execution-path-dependent cost into a fixed, upfront cost.
Transaction Structure
An Access List is a structured field within an EIP-2930 transaction. It is an array of objects specifying:
address: The smart contract address to be accessed.storageKeys: An array of the specific 32-byte storage slots (hashed keys) that will be read or written to. This structure is verified and processed before the main execution begins.
Use Case: Complex DeFi Interactions
Access Lists are particularly valuable for transactions that interact with sophisticated DeFi protocols like Uniswap V3 or Compound, where execution paths may touch many storage slots. Wallets and services (e.g., MetaMask, Blocknative) can simulate a transaction, generate an optimal Access List for the predicted path, and attach it to reduce gas cost variance for the user.
Potential for Gas Savings
While the primary goal is predictability, Access Lists can also lead to net gas savings in specific scenarios. If the same storage slot is accessed multiple times within a transaction, pre-warming it via the list saves 2,000 gas per subsequent access (2,100 - 100). However, if slots in the list are never accessed, the gas used to warm them is wasted.
Related Concept: State Access Opcodes
Access Lists work in tandem with specific EVM opcodes that read or write state:
- SLOAD: Reads a storage slot.
- SSTORE: Writes to a storage slot.
- EXTCODESIZE, BALANCE, etc.: Access account state. The list pre-warms the targets of these operations, making their first invocation cheaper. This is a key part of Ethereum's broader gas cost reform efforts.
Gas Cost Mechanics: Cold vs. Warm Access
An explanation of how the Ethereum Virtual Machine (EVM) charges different gas costs for accessing storage slots based on prior interaction, a critical concept for contract optimization.
In the Ethereum Virtual Machine (EVM), cold storage access refers to the first read or write to a specific storage slot within a transaction, incurring a higher gas cost (e.g., 2,100 gas for a cold SLOAD). A subsequent access to the same slot within the same transaction is a warm access, which is significantly cheaper (e.g., 100 gas). This two-tiered pricing model, formalized in EIP-2929, was introduced to mitigate the risk of denial-of-service attacks that could exploit previously cheap storage operations.
The mechanism relies on an internal accessed addresses and accessed storage keys list maintained during transaction execution. When the EVM first touches a storage slot, it is marked as 'accessed' and moved from the cold to the warm state. This state is reset at the start of each new transaction. The primary purpose is to reflect the real-world cost of loading data into memory or cache; the first access is expensive, but cached data is cheap to reuse.
Access lists, introduced in EIP-2930, allow transactions to pre-declare which storage slots they will interact with. By including these slots in an access list, the transaction pays the cold access cost upfront, making all subsequent accesses warm. This can lead to overall gas savings for complex transactions that repeatedly interact with the same state, as it avoids paying the high cold access fee multiple times for slots accessed in different parts of the execution.
For developers, understanding this distinction is crucial for gas optimization. Code patterns that minimize first-time accesses to disparate storage locations and instead batch operations on the same data can reduce costs. For example, a function that loops through an array of user balances stored in separate slots will incur a cold access charge for each new user, making it gas-inefficient compared to using a mapping or a different data structure.
The cold/warm mechanic interacts with other opcode pricing. For instance, transaction CALL operations to new contract addresses also follow a similar pattern, with the first call being a cold address access. This creates a holistic gas model where the cost of execution is tied to the 'working set' of state a transaction touches, incentivizing smaller, more predictable state footprints and enhancing network security and performance.
Ecosystem Usage and Adoption
An Access List is a pre-declared list of storage slots and addresses that a transaction plans to interact with, introduced in EIP-2930 to optimize gas costs on Ethereum. This section details its practical applications and impact on network efficiency.
Gas Cost Optimization
The primary purpose of an Access List is to reduce transaction costs for operations involving cold storage access. On Ethereum, accessing a state element for the first time incurs a higher cost (2,100 gas) than subsequent accesses (100 gas). By pre-declaring these slots, the transaction pays the warm access cost upfront, eliminating the penalty for the first touch. This is crucial for complex smart contract interactions, such as multi-step DeFi transactions, where it can lead to significant gas savings.
Transaction Pre-Verification
Access Lists enable clients and nodes to perform pre-execution validation. By specifying the exact storage locations a transaction will read or write to, validators can quickly check for potential conflicts or state inconsistencies before the transaction is included in a block. This enhances network reliability and can help prevent certain classes of front-running and reentrancy attacks by making a transaction's intended state changes more transparent upfront.
Wallet & Developer Tooling
Major wallets (e.g., MetaMask) and developer libraries (e.g., ethers.js, web3.py) have integrated support for generating and attaching Access Lists. Key tools include:
eth_createAccessListRPC method: Allows developers to simulate a transaction and receive a recommended Access List.- Wallet estimation: Wallets can use this simulation to suggest optimized transactions to users.
- Hardhat & Foundry: Testing frameworks provide utilities to build and verify Access Lists during contract development and gas profiling.
Impact on Rollups & Layer 2s
Access Lists are particularly beneficial for Layer 2 rollups (Optimistic Rollups, ZK-Rollups) that batch transactions and post data to Ethereum Mainnet. By minimizing the gas cost of proving and verifying state changes on L1, Access Lists reduce the overall cost of data availability and settlement. This directly contributes to lower fees for end-users on rollups and improves the economic scalability of the broader Ethereum ecosystem.
EIP-2930: The Specification
Access Lists were formally introduced by EIP-2930, which created a new transaction type (0x01). The structure includes:
addresses: A list of account addresses to be accessed.storageKeys: For each address, a list of specific storage slots. This transaction type must be used with the Berlin hard fork (April 2021) or later. It is a foundational upgrade that paved the way for subsequent EIPs like EIP-1559.
Use Case: Complex DeFi Swaps
A practical example is a multi-hop token swap on a DEX aggregator. Without an Access List, the transaction would incur multiple cold storage access penalties when interacting with various liquidity pools and router contracts for the first time. With an Access List, these costs are optimized. For instance, a swap involving Uniswap, SushiSwap, and a lending protocol to flash loan collateral can see gas savings of 10-30%, making sophisticated DeFi strategies more economically viable.
Security Considerations and Benefits
An Access List is a transaction parameter that specifies which storage slots a contract call is permitted to access, mitigating state-access risks and optimizing gas costs on Ethereum and other EVM chains.
Mitigating State Access Risks
The primary security benefit is protecting users from unexpected state access. Without an access list, a malicious contract could force a transaction to interact with a high-gas-cost storage slot, leading to failed transactions and lost gas. By pre-declaring accessed slots, the transaction is guaranteed to have sufficient gas for those specific operations, preventing this denial-of-service vector.
Gas Cost Optimization (EIP-2930)
Introduced in EIP-2930, access lists can reduce gas costs for complex transactions. The EVM charges less gas (warm_access vs. cold_access) for storage slots that have been pre-declared. For transactions that repeatedly access the same contracts, submitting an access list makes the first access cheaper, potentially lowering the overall transaction fee.
Implementation & Transaction Flow
An access list is an array of address-storage key pairs included in a transaction type 0x01 (EIP-2930).
- Wallets & Clients: Tools like MetaMask or Ethers.js can generate lists by simulating a transaction.
- Node Requirement: Full nodes use the list to pre-load the specified state, changing the gas accounting.
- Invalid List: If the transaction accesses an undeclared slot, it reverts, ensuring strict access control.
Trade-off: Simplicity vs. Cost
There is a key trade-off between upfront cost and execution cost.
- Adding Slots: Including a storage slot in the list has a fixed gas cost.
- Net Benefit: The access list only saves gas if the transaction would have otherwise triggered many cold storage accesses. For simple one-off calls, the cost of the list may outweigh the savings, making simulation essential.
Use Case: Interacting with Complex DeFi
Access lists are critical for secure interactions with large DeFi protocols like Uniswap V3 or Aave, which have intricate state trees. Example: A flash loan transaction that touches multiple pools and price oracles can be pre-simulated to generate an access list, ensuring it won't fail due to gas estimation errors and locking in predictable costs.
Related Concept: EIP-2929
Access lists are enabled by EIP-2929, which increased the gas cost of first-time (cold) access to storage slots and addresses. This change made gas estimation unpredictable and created the need for EIP-2930's access lists to re-introduce predictability. Understanding this pairing is key to analyzing post-London Upgrade transaction economics.
Transaction Structure and EIP-2930
An access list is an optional transaction component introduced by EIP-2930 that specifies a set of storage slots and addresses a transaction plans to access, enabling more predictable gas costs.
An access list is a feature of EIP-2930 that defines a set of addresses and storage keys a transaction intends to interact with. By declaring these accesses upfront, the transaction pays a one-time warm storage access cost, rather than the more expensive cold access cost for each interaction during execution. This mechanism was introduced to mitigate the gas cost increases and unpredictability caused by EIP-2929, which raised the cost of accessing previously untouched state. The primary benefit is more predictable gas estimation for complex transactions involving multiple contract calls.
The structure of an access list is an array of objects, where each object contains an address and an array of storageKeys. For example, a transaction interacting with a Uniswap pool might include the pool's contract address and the specific storage slots for its reserves in its access list. This pre-declaration signals to the Ethereum Virtual Machine (EVM) that these state items should be loaded into a "warmed" state before execution begins. Transactions without an access list are still valid but will incur the full, higher cold access cost for each first-time state read or write.
From a practical standpoint, access lists are most beneficial for transactions that interact with multiple contracts or specific, known storage slots, such as complex DeFi operations or batched calls. Wallets and developers can use the eth_createAccessList RPC method to simulate a transaction and generate an optimal list. While adding an access list increases the intrinsic calldata cost of a transaction, this is often offset by the significant savings on execution gas, leading to lower total costs for suitable operations. This design represents a key evolution in Ethereum's fee market, balancing security with economic efficiency for power users.
Comparison: Transactions With vs. Without Access List
Key differences in transaction behavior, cost, and state access when using the optional Access List feature.
| Feature / Metric | Transaction With Access List | Standard Transaction (No Access List) |
|---|---|---|
Pre-Declaration of Accessed Slots | ||
Primary Purpose | Mitigate state access cost increases post-EIP-2929 | Standard contract interaction |
Upfront Gas Cost (Flat Fee) | 21000 + 1900 per storage key + 2400 per address | 21000 |
Potential Execution Gas Savings | Up to ~10-20% for complex calls | 0% (Baseline) |
Transaction Size | Larger (contains list payload) | Smaller |
Optimal Use Case | Complex, predictable multi-contract calls | Simple transfers or single calls |
Risk of Out-of-Gas Errors | Reduced for pre-declared accesses | Standard risk |
Mandatory After London Upgrade? |
Frequently Asked Questions (FAQ)
Access Lists are a mechanism on Ethereum to pre-declare storage slots a transaction will access, enabling gas savings. This section answers common developer questions about their function, implementation, and trade-offs.
An Access List is a transaction parameter that pre-declares the addresses and storage keys a transaction will interact with, allowing the Ethereum Virtual Machine (EVM) to optimize gas costs by warming up these storage slots. Introduced in EIP-2930, it mitigates the gas cost increase from the Berlin hard fork's EIP-2929, which raised the cost of accessing 'cold' storage for the first time. By specifying an access list, a transaction pays a flat fee to warm the listed slots, making subsequent accesses cheaper. This is particularly beneficial for complex smart contract interactions, such as multi-step DeFi transactions, where the same storage is read multiple times.
Common Misconceptions
Access lists are a key Ethereum gas optimization feature, but their purpose and impact are often misunderstood. This section clarifies how they work and dispels frequent myths about their cost and utility.
An access list is a transaction parameter that pre-declares the specific storage slots and addresses a transaction will access, allowing the Ethereum Virtual Machine (EVM) to optimize gas costs. It works by moving the cold storage access cost (2,100 gas) to the transaction's intrinsic cost, while subsequent accesses to those same slots within the transaction are charged at the cheaper warm storage access cost (100 gas). This is a form of gas optimization for complex transactions interacting with multiple contracts. The list is specified using the accessList field in EIP-2930 transactions.
Example Structure:
json{ "accessList": [ { "address": "0xde0b295669a9fd93d5f28d9ec85e40f4cb697bae", "storageKeys": ["0x0"] } ] }
Quick Summary: Access List
An Access List is an optional transaction parameter introduced in EIP-2930 that specifies the exact storage slots and addresses a transaction will interact with, allowing for more predictable gas costs and enabling certain state accesses to be refunded.
Core Purpose
The primary goal is to solve the "gas cost re-pricing" problem. Before EIP-2930, if a transaction accessed a storage slot for the first time, it paid a high cost (2,100 gas). A second access to the same slot was cheaper (100 gas). This created unpredictable final costs. An Access List declares these accesses upfront, so all accesses are charged the lower, predictable rate.
How It Works
A transaction includes an accessList field, which is an array of objects. Each object contains:
- An
address(the smart contract to be accessed). - An array of
storageKeys(the specific storage slots within that contract). The Ethereum client uses this list during pre-execution to warm up these addresses and slots, making their subsequent access cheaper.
Gas Implications & Refund
Using an Access List involves a trade-off:
- Upfront Cost: You pay a base gas fee for each address and storage slot listed.
- Execution Savings: Every read/write to a pre-declared slot uses the cheaper warm access cost (100 gas) instead of the expensive cold access cost (2,100 gas).
- Net Effect: For complex transactions touching many new slots, the savings outweigh the upfront cost, leading to a net gas reduction.
Related Concepts
- EIP-2930: The Ethereum Improvement Proposal that standardized Access Lists.
- EIP-1559: The fee market change that occurred in the same hard fork (London). Access Lists are part of the TransactionType 1 format.
- State Access: Refers to reading or writing to the Ethereum state, which is stored in a Merkle Patricia Trie.
- Warm vs Cold Storage: Key distinction in the gas pricing model post-EIP-2929.
Developer Implementation
To use an Access List, you must construct a Type 1 (EIP-2930) or Type 2 (EIP-1559) transaction. In libraries like ethers.js or web3.py, you populate the accessList field. Most developers rely on node providers (e.g., Alchemy, Infura) or their own node to call eth_createAccessList to generate the list automatically based on a simulated transaction execution.
Get In Touch
today.
Our experts will offer a free quote and a 30min call to discuss your project.