EIPs Explained

EIP-7664 · Withdrawn · Core · 2024-03-27

EIP-7664: Access-Key opcode

Withdrawn proposal for an ACCESS_KEY opcode that would let a contract read the storage keys declared for it in the transaction's access list, as a way to receive static, pre-declared inputs.

What problem does it solve?

Some applications want to be sure that certain inputs were declared statically in the transaction itself, visible to block builders and verifiers before execution, rather than computed during execution. Historically, contracts approximated this by checking tx.origin to force a top-level call, which conflicts with account abstraction and bundlers.

EIP-2930 access lists already let a transaction pre-declare (address, storageKeys[]), but they only affect gas costs; a contract cannot read them. EIP-7664 proposed making them readable, so the access list could double as a channel for read-only, pre-declared data such as witnesses.

How it works

  • New opcode ACCESS_KEY at byte 0x4B, costing a fixed 3 gas, the same as BLOBHASH from EIP-4844.
  • It pops an index and pushes tx.access_list[address][index], where address is the currently executing contract. If the contract has no entry, or the index is out of range, it pushes zero.
  • Only keys explicitly listed in the transaction count. Addresses warmed for other reasons, such as the fee recipient, are not part of the list.
  • No change to transaction types, encoding or intrinsic gas. The value cannot change during a transaction: like TLOAD from EIP-1153, it is global to the transaction, but strictly read-only.

Sample code

How a contract would have used it (EVM pseudocode; 0x4B was never activated, so this does not compile or run today):

PUSH1 0x00        // index 0
ACCESS_KEY        // 0x4B: push tx.access_list[ADDRESS][0], or 0 if absent
PUSH1 0xaa
EQ                // was the expected key declared for this contract?

The matching transaction would carry the value in its access list (JSON-RPC form):

{
  "type": "0x1",
  "to": "0xContract...",
  "accessList": [
    {
      "address": "0xContract...",
      "storageKeys": ["0x00000000000000000000000000000000000000000000000000000000000000aa"]
    }
  ]
}

Things to know

  • Status: Withdrawn. The stated reason is that it is a niche use case, better implemented with EIP-7702.
  • ACCESS_KEY was never activated on any network; do not rely on opcode 0x4B behaving this way.
  • Each access-list key still pays intrinsic gas under EIP-2930, so passing data this way was never free.

#evm #opcode #access-list #core #withdrawn

Details

Authors
Diederik Loerakker (@protolambda)
Status
Withdrawn
Type
Standards Track / Core
Created
2024-03-27
Requires

Machine-readable: Markdown · JSON