EIPs Explained

EIP-7708 · Last Call · Core · 2024-05-17

EIP-7708: ETH transfers emit a log

Makes every non-zero ETH transfer, including those from contracts, emit an ERC-20-style Transfer log, so ETH movements can be tracked the same way as token transfers.

What problem does it solve?

Wallets, exchanges and indexers track ERC-20 tokens by watching Transfer logs. ETH has no such log. A transfer from an EOA is visible in the block's transaction list, but ETH sent by a smart contract (a CALL with value, a SELFDESTRUCT, a contract creation with endowment) leaves no log at all. Finding it requires tracing every transaction.

This has caused real problems: early exchanges often failed to credit deposits from smart contract wallets, or credited them only after long delays. EIP-7708 gives ETH one uniform, cheap-to-query record.

How it works

The protocol automatically emits a log identical to a LOG3 for:

  • a transaction that sends non-zero value to a different account (emitted before any other logs in that transaction);
  • a CALL with non-zero value to a different account;
  • a SELFDESTRUCT sending non-zero value to a different account;
  • a CREATE / CREATE2 with non-zero value to the new account.
Field Value
emitting address 0xfffffffffffffffffffffffffffffffffffffffe (the SYSTEM_ADDRESS from EIP-4788)
topics[0] keccak256("Transfer(address,address,uint256)")
topics[1] from, left-padded to 32 bytes
topics[2] to, left-padded to 32 bytes
data amount in wei, big-endian uint256

This matches the ERC-20 Transfer event, so existing tooling can decode it. The special emitter address separates protocol-generated logs from logs emitted by user contracts.

Not logged: zero-value transfers, reverted calls, priority-fee payments to the block producer, the base fee burn, and withdrawals. Those are already derivable from headers, receipts or block data.

Sample code

Watching ETH transfers to an address with ethers v6:

import { JsonRpcProvider, id, zeroPadValue, getAddress, formatEther, AbiCoder } from "ethers";

const SYSTEM_ADDRESS = "0xfffffffffffffffffffffffffffffffffffffffe";
const TRANSFER = id("Transfer(address,address,uint256)");

const provider = new JsonRpcProvider(process.env.RPC_URL);
const me = getAddress(process.env.MY_ADDRESS!);

const logs = await provider.getLogs({
  address: SYSTEM_ADDRESS,
  topics: [TRANSFER, null, zeroPadValue(me, 32)],
  fromBlock: -100,
});

for (const log of logs) {
  const from = getAddress("0x" + log.topics[1].slice(26));
  const [amount] = AbiCoder.defaultAbiCoder().decode(["uint256"], log.data);
  console.log(`${formatEther(amount)} ETH from ${from} in tx ${log.transactionHash}`);
}

Things to know

  • Status: Last Call (deadline 2026-11-01). Logs appear only on chains that have activated the EIP; do not rely on them before then.
  • Ordering: the transaction-level transfer log comes first, and logs from nested calls appear in the order the calls happen.
  • It requires EIP-8246, which removes ETH burning via SELFDESTRUCT, so that edge case no longer needs special handling.
  • The spec argues there is no DoS risk: a value transfer already costs at least 6,700 gas, far more than a LOG3 (1,500 gas). It does raise the average number of logs per block.
  • Indexers that sum both ERC-20 logs and these logs must filter by emitter address so ETH is not confused with a token.

#eth #logs #indexing #core #transfers

Details

Authors
Vitalik Buterin (@vbuterin), Peter Davies (@petertdavies), Etan Kissling (@etan-status), Gajinder Singh (@g11tech), Carson (@carsons-eels), Jared Wasinger (@jwasinger)
Status
Last Call
Type
Standards Track / Core
Created
2024-05-17
Requires
Required by

Machine-readable: Markdown · JSON