EIP-8304 · Draft · Core · 2026-06-17
EIP-8304: Trustless log and transaction index
Proposes that every block commits sorted index tables of its transactions and logs into a system contract, so anyone can get compact proofs that a log or transaction lookup result is correct and complete.
What problem does it solve?
Logs (events) are cheap to emit, but the protocol gives no efficient way to search them. The per-block bloom filters in headers are oversaturated and practically useless today. So users ask an RPC provider "give me all Transfer events to my address", and must simply trust the answer: the provider cannot prove the result is correct, or that nothing was left out.
EIP-8304 adds a cheap-to-maintain index that supports trustless query proofs. The spec also points to cross-chain messaging (prove logs emitted on another chain from a known block hash) and, later, using logs as a cheap, easily expired form of state.
How it works
- Index entries. For each block the client derives entries for every transaction hash, every log's address and each of its topics, and (one block late) the parent block hash. Each entry is
type ‖ value ‖ positionin big-endian bytes, e.g. alog.addressentry is0x0002 ‖ address ‖ block number ‖ tx index ‖ log index(38 bytes). - Index tables. Entries are sorted lexicographically and hashed: each entry is SHA-256'd and the table root is the SSZ root of that
List[Hash32]. Sorting is what makes exclusion provable: you can show there are no further matching entries. - Levels. Tables exist for 1, 4, 16, 64 and 256 blocks. Larger tables are merged from four tables of the level below and are committed with a delay of
table_size / 4blocks, so merging can happen in the background. - System contract. After each block, a system call stores
(first_block, table_size, table_root). Each level keeps a 1024-entry ring buffer, so roughly the last 2^18 blocks are covered by in-protocol tables. Anyone can callget(first_block, table_size)to read a root. - Older history is expected to be covered by much larger tables built off-protocol and proven with ZK proofs in separate "history index contracts" sharing the same
getinterface.
Block header blooms are left unchanged, and LOG gas costs do not increase.
Sample code
Encoding a log.topics[0] entry and reading a table root (the contract address is still TBD in the spec):
def topic0_entry(topic: bytes, block: int, tx_index: int, log_index: int) -> bytes:
# type 3 = log.topics[0]; 2 + 32 + 8 + 4 + 4 = 50 bytes
return (3).to_bytes(2, "big") + topic + block.to_bytes(8, "big") \
+ tx_index.to_bytes(4, "big") + log_index.to_bytes(4, "big")
entry_hash = sha256(topic0_entry(TRANSFER_TOPIC, 42, 0, 1))
// get(): 64 bytes of calldata -> 32-byte table root, reverts if unknown/overwritten
function tableRoot(address index, uint256 firstBlock, uint256 tableSize) view returns (bytes32) {
(bool ok, bytes memory ret) = index.staticcall(abi.encode(firstBlock, tableSize));
require(ok, "no root");
return abi.decode(ret, (bytes32));
}
Things to know
- Status is Draft. The contract address and deployment details are still TBD.
- EIP-7745, by the same author and with the same title, is an earlier, different design that replaces header bloom filters; this proposal leaves blooms alone and focuses on low per-block processing cost.
- After syncing, a client needs at most the last 319 blocks to rebuild the tables it must commit next; no sync protocol change is needed.
- If EIP-8141 frame transactions activate, a 2-byte frame index is added to log positions. After EIP-7708, history could be re-indexed with ETH transfer logs in an alternative index contract.
- Query proofs are larger than state proofs; the spec expects a typical query to need tens of individual table proofs.