ERC-8117 · Draft · ERC · 2025-12-30
ERC-8117: Anti-Poisoning Compact EVM Address Format
A display-only notation that collapses an address's run of leading zeros into a count (0x0₈… or 0x0(8)…), so users notice the unique part of the address and are harder to fool with address-poisoning lookalikes.
What problem does it solve?
Wallets usually show addresses truncated, like 0xd28b…6922, and users learn to check only those few characters. In an address-poisoning attack, someone generates a lookalike address with the same visible prefix and suffix, sends you a zero-value transfer so it appears in your history, and waits for you to copy the wrong address.
One defence is to use addresses with many leading zeros (for example mined with CREATE2): each extra zero multiplies an attacker's search cost by 16. But that only helps if a human can tell eleven zeros from ten at a glance, which is hard with 0x00000000000C2E…. ERC-8117 standardises a compact way to show the zero count so the high-entropy part of the address is front and centre.
How it works
- Trigger: apply the notation when the address body has
n >= 4leading zero nibbles after0x.nis the total number of leading zeros. - Mode A, subscript (UI): keep the literal
0x0, then writenwith Unicode subscript digits (U+2080–U+2089), then the rest of the address from the first non-zero nibble.0x00000000abcd…becomes0x0₈abcd…. - Mode B, parenthesis (ASCII): same idea for logs, terminals and bot messages:
0x0(8)abcd…. - Casing: all non-compressed characters keep their original case, so EIP-55 / EIP-1191 checksums still apply to what is shown.
- Scope: only leading zeros. Middle or trailing repeats are out of scope.
This is purely presentational. Wallets must expand the notation back to full hex before signing or broadcasting. Because neither subscript digits nor parentheses are valid hex, pasting a notated address into a legacy system fails as "invalid address" rather than silently sending to the wrong place.
Sample code
A small TypeScript formatter following the spec's rules:
const SUB = "₀₁₂₃₄₅₆₇₈₉";
export function formatAddress(addr: string, mode: "unicode" | "ascii" = "unicode", truncate = false): string {
const body = addr.slice(2);
const n = body.match(/^0*/)![0].length;
if (n < 4) return addr; // below threshold: unchanged
const count = mode === "unicode"
? [...String(n)].map((d) => SUB[Number(d)]).join("")
: `(${n})`;
const rest = body.slice(n);
const shown = truncate && rest.length > 8 ? `${rest.slice(0, 4)}…${rest.slice(-4)}` : rest;
return `0x0${count}${shown}`;
}
formatAddress("0x0000000071727De22E5E9d8BAf0edAc6f37da032");
// "0x0₇71727De22E5E9d8BAf0edAc6f37da032"
formatAddress("0x0000000000000000000000000000000000000001", "ascii");
// "0x0(39)1"
Things to know
- Status: Draft. Details such as the threshold or notation could still change.
- The spec requires the subscript to be clearly legible:
0x0₇must never be renderable as0x07because of font choice. - Apps that accept address input must either offer to expand the notation explicitly or reject it; they should never guess.
- The notation helps only when the real address actually has many leading zeros; for ordinary addresses, users still need to compare the full address (or use an address book / name service) to resist poisoning.
- Well-known contracts already use mined zero-prefix addresses, for example the ERC-4337 EntryPoint at
0x0000000071727De22E5E9d8BAf0edAc6f37da032(7 leading zeros).