eth_createAccessList - Ethereum

This method returns an EIP-2930 access list for a transaction — the list of accounts and storage slots the transaction would touch during execution. Transactions with a pre-declared access list pay lower gas per SLOAD/BALANCE than without one (though the access list itself has a size cost). Nodes and MEV searchers use this to pre-compute optimal access lists.

Parameters

ParameterTypeRequiredDescription
transactionobjectYesTransaction call object — same shape as eth_call transaction object
blockParameterstringNoBlock number in hex, or latest, earliest, pending, finalized, safe. Defaults to latest

Request

bashcurl --location --request POST 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "method": "eth_createAccessList",
    "params": [
        {
            "from": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
            "to": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
            "data": "0x70a08231000000000000000000000000d8da6bf26964af9d7eed9e03e53415d37aa96045"
        },
        "latest"
    ],
    "id": "getblock.io"
}'

example.js

javascriptconst axios = require('axios');

const response = await axios.post('https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/', {
    jsonrpc: '2.0',
    method: 'eth_createAccessList',
    params: [
        {
            "from": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
            "to": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
            "data": "0x70a08231000000000000000000000000d8da6bf26964af9d7eed9e03e53415d37aa96045"
        },
        "latest"
    ],
    id: 'getblock.io'
}, {
    headers: { 'Content-Type': 'application/json' }
});

console.log(response.data.result);

example.py

pythonimport requests

response = requests.post(
    'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/',
    headers={'Content-Type': 'application/json'},
    json={
        'jsonrpc': '2.0',
        'method': 'eth_createAccessList',
        'params': [
        {
            "from": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
            "to": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
            "data": "0x70a08231000000000000000000000000d8da6bf26964af9d7eed9e03e53415d37aa96045"
        },
        "latest"
    ],
        'id': 'getblock.io'
    }
)

print(response.json())

example.rs

rustuse reqwest::Client;
use serde_json::{json, Value};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new();
    
    let response = client
        .post("https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/")
        .header("Content-Type", "application/json")
        .json(&json!({
            "jsonrpc": "2.0",
            "method": "eth_createAccessList",
            "params": [
        {
            "from": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
            "to": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
            "data": "0x70a08231000000000000000000000000d8da6bf26964af9d7eed9e03e53415d37aa96045"
        },
        "latest"
    ],
            "id": "getblock.io"
        }))
        .send()
        .await?
        .json::<Value>()
        .await?;
    
    println!("Result: {}", response["result"]);
    Ok(())
}

Response

json{
    "jsonrpc": "2.0",
    "id": "getblock.io",
    "result": {
        "accessList": [
            {
                "address": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
                "storageKeys": [
                    "0x9b30e0da3d7a1c88b4bcc11f6efe72fcabbb64b1ac0f1a2d4de1abf0feaa1234"
                ]
            }
        ],
        "gasUsed": "0x8ba0"
    }
}

Response Parameters

ParameterTypeDescription
jsonrpcstringJSON-RPC protocol version ("2.0")
idstringRequest identifier matching the request
result.accessListarray of objectThe computed access list — array of {address, storageKeys} entries
result.gasUsedstringTotal gas the transaction would consume with this access list

Use Cases

  • Type-1 Transaction Optimization: Wrap a transaction in a type-1 EIP-2930 transaction with the returned access list for slightly lower gas cost
  • MEV Bundle Optimization: Precompute access lists for bundle transactions to reduce total bundle gas
  • Complex Call Preflight: Understand what state a complex call will touch before executing it on-chain
  • Multi-Contract Access Analysis: Reveal cross-contract state touches for security analysis or gas budgeting

Error Handling

Error CodeMessageDescription
-32602Invalid paramsTransaction object is malformed
3Execution revertedThe transaction would revert during simulation
-32000Execution errorNode failed to compute the access list

Web3 Integration

ethers-example.js

javascriptimport { ethers } from 'ethers';

const provider = new ethers.JsonRpcProvider('https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/');

const result = await provider.send('eth_createAccessList', [
    { from: '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045', to: '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2', data: '0x70a08231000000000000000000000000d8da6bf26964af9d7eed9e03e53415d37aa96045' },
    'latest'
]);
console.log('Access list:', result.accessList);
console.log('Gas used with access list:', result.gasUsed);

viem-example.js

javascriptimport { createPublicClient, http } from 'viem';
import { mainnet } from 'viem/chains';

const client = createPublicClient({
    chain: mainnet,
    transport: http('https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/'),
});

const result = await client.createAccessList({
    account: '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045',
    to: '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2',
    data: '0x70a08231000000000000000000000000d8da6bf26964af9d7eed9e03e53415d37aa96045',
});
console.log('Access list:', result.accessList);
console.log('Gas used:', result.gasUsed);