{"eip":8117,"title":"Anti-Poisoning Compact EVM Address Format","description":"Subscript (0x0₈) and ASCII (0x0(8)) notation for leading-zero EVM addresses to prevent address-poisoning by surfacing the unique suffix.","authors":["Zainan Victor Zhou (@xinbenlv)"],"status":"Draft","type":"Standards Track","category":"ERC","created":"2025-12-30","requires":[55,1191],"discussionsTo":"https://ethereum-magicians.org/t/erc-8117-compressed-display-format-for-evm-addresses/27360","repo":"ERCs","label":"ERC-8117","officialUrl":"https://eips.ethereum.org/EIPS/eip-8117","sourceUrl":"https://github.com/ethereum/ERCs/blob/master/ERCS/erc-8117.md","url":"https://eips.huatuo.xyz/eip-8117/","tldr":{"en":"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.","ja":"アドレスの先頭に連続するゼロを個数に折りたたむ表示専用の表記（0x0₈… または 0x0(8)…）。ユーザーがアドレスの固有部分に気づきやすくなり、アドレスポイズニングの似せたアドレスに騙されにくくなる。","ko":"주소 앞부분에 연속된 0을 개수로 접어서 보여 주는 표시 전용 표기(0x0₈… 또는 0x0(8)…). 사용자가 주소의 고유한 부분을 알아차리기 쉬워지고, 주소 포이즈닝의 비슷한 주소에 덜 속게 된다.","zh":"一种仅用于显示的记法，把地址开头连续的零折叠成一个计数（0x0₈… 或 0x0(8)…），让用户注意到地址中独特的部分，更难被地址投毒的相似地址欺骗。"},"tags":["erc","wallet","ux","security","address"],"explainers":{"en":{"lang":"en","tldr":"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.","tags":["erc","wallet","ux","security","address"],"related":[55,1191,4337],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-8117/","markdown":"## What problem does it solve?\n\nWallets 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.\n\nOne 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.\n\n## How it works\n\n- **Trigger:** apply the notation when the address body has `n \u003e= 4` leading zero nibbles after `0x`. `n` is the *total* number of leading zeros.\n- **Mode A, subscript (UI):** keep the literal `0x0`, then write `n` with Unicode subscript digits (U+2080–U+2089), then the rest of the address from the first non-zero nibble. `0x00000000abcd…` becomes `0x0₈abcd…`.\n- **Mode B, parenthesis (ASCII):** same idea for logs, terminals and bot messages: `0x0(8)abcd…`.\n- **Casing:** all non-compressed characters keep their original case, so [EIP-55](/eip-55/) / [EIP-1191](/eip-1191/) checksums still apply to what is shown.\n- **Scope:** only leading zeros. Middle or trailing repeats are out of scope.\n\nThis 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.\n\n## Sample code\n\nA small TypeScript formatter following the spec's rules:\n\n```ts\nconst SUB = \"₀₁₂₃₄₅₆₇₈₉\";\n\nexport function formatAddress(addr: string, mode: \"unicode\" | \"ascii\" = \"unicode\", truncate = false): string {\n  const body = addr.slice(2);\n  const n = body.match(/^0*/)![0].length;\n  if (n \u003c 4) return addr;                       // below threshold: unchanged\n\n  const count = mode === \"unicode\"\n    ? [...String(n)].map((d) =\u003e SUB[Number(d)]).join(\"\")\n    : `(${n})`;\n  const rest = body.slice(n);\n  const shown = truncate \u0026\u0026 rest.length \u003e 8 ? `${rest.slice(0, 4)}…${rest.slice(-4)}` : rest;\n  return `0x0${count}${shown}`;\n}\n\nformatAddress(\"0x0000000071727De22E5E9d8BAf0edAc6f37da032\");\n// \"0x0₇71727De22E5E9d8BAf0edAc6f37da032\"\nformatAddress(\"0x0000000000000000000000000000000000000001\", \"ascii\");\n// \"0x0(39)1\"\n```\n\n## Things to know\n\n- Status: **Draft**. Details such as the threshold or notation could still change.\n- The spec requires the subscript to be clearly legible: `0x0₇` must never be renderable as `0x07` because of font choice.\n- Apps that accept address input must either offer to expand the notation explicitly or reject it; they should never guess.\n- 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.\n- Well-known contracts already use mined zero-prefix addresses, for example the [ERC-4337](/eip-4337/) EntryPoint at `0x0000000071727De22E5E9d8BAf0edAc6f37da032` (7 leading zeros).\n"},"ja":{"lang":"ja","tldr":"アドレスの先頭に連続するゼロを個数に折りたたむ表示専用の表記（0x0₈… または 0x0(8)…）。ユーザーがアドレスの固有部分に気づきやすくなり、アドレスポイズニングの似せたアドレスに騙されにくくなる。","tags":["erc","wallet","ux","security","address"],"related":[55,1191,4337],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-8117/","markdown":"## 何を解決するのか\n\nウォレットはたいていアドレスを `0xd28b…6922` のように省略して表示し、ユーザーはその数文字だけを確認するようになります。**アドレスポイズニング**攻撃では、攻撃者が見える先頭と末尾が同じ似せたアドレスを生成し、ゼロ値の送金を送って履歴に表示させ、あなたが間違ったアドレスをコピーするのを待ちます。\n\n防御策の 1 つは、先頭に多くのゼロを持つアドレス（たとえば CREATE2 でマイニングしたもの）を使うことです。ゼロが 1 つ増えるごとに、攻撃者の探索コストは 16 倍になります。しかし、これは人間が 11 個のゼロと 10 個のゼロを一目で見分けられる場合にしか役立たず、`0x00000000000C2E…` ではそれが困難です。ERC-8117 は、ゼロの個数をコンパクトに表示する方法を標準化し、アドレスのエントロピーの高い部分が前面に出るようにします。\n\n## 仕組み\n\n- **トリガー:** アドレス本体が `0x` の後に `n \u003e= 4` 個の先頭ゼロのニブルを持つときに、この表記を適用します。`n` は先頭のゼロの*合計*個数です。\n- **モード A、下付き文字（UI 向け）:** リテラルの `0x0` を残し、その後に `n` を Unicode の下付き数字（U+2080–U+2089）で書き、最初のゼロでないニブルからアドレスの残りを続けます。`0x00000000abcd…` は `0x0₈abcd…` になります。\n- **モード B、括弧（ASCII 向け）:** ログ、ターミナル、ボットのメッセージ向けの同じ考え方です: `0x0(8)abcd…`。\n- **大文字小文字:** 圧縮されない文字はすべて元の大文字小文字を保つため、表示されているものには [EIP-55](/eip-55/) / [EIP-1191](/eip-1191/) のチェックサムがそのまま適用されます。\n- **対象範囲:** 先頭のゼロのみです。途中や末尾の繰り返しは対象外です。\n\nこれは純粋に表示上のものです。ウォレットは、署名やブロードキャストの前に、表記を完全な 16 進数に展開し直さなければなりません。下付き数字も括弧も有効な 16 進数ではないため、表記付きのアドレスを従来のシステムに貼り付けても、黙って誤った宛先に送られることはなく、「無効なアドレス」として失敗します。\n\n## サンプルコード\n\n仕様のルールに従った小さな TypeScript のフォーマッター:\n\n```ts\nconst SUB = \"₀₁₂₃₄₅₆₇₈₉\";\n\nexport function formatAddress(addr: string, mode: \"unicode\" | \"ascii\" = \"unicode\", truncate = false): string {\n  const body = addr.slice(2);\n  const n = body.match(/^0*/)![0].length;\n  if (n \u003c 4) return addr;                       // below threshold: unchanged\n\n  const count = mode === \"unicode\"\n    ? [...String(n)].map((d) =\u003e SUB[Number(d)]).join(\"\")\n    : `(${n})`;\n  const rest = body.slice(n);\n  const shown = truncate \u0026\u0026 rest.length \u003e 8 ? `${rest.slice(0, 4)}…${rest.slice(-4)}` : rest;\n  return `0x0${count}${shown}`;\n}\n\nformatAddress(\"0x0000000071727De22E5E9d8BAf0edAc6f37da032\");\n// \"0x0₇71727De22E5E9d8BAf0edAc6f37da032\"\nformatAddress(\"0x0000000000000000000000000000000000000001\", \"ascii\");\n// \"0x0(39)1\"\n```\n\n## 知っておくべきこと\n\n- ステータス: **Draft**。しきい値や表記などの詳細は変わる可能性があります。\n- 仕様は、下付き文字がはっきり読めることを求めています。フォントの選択によって `0x0₇` が `0x07` として描画されることがあってはなりません。\n- アドレス入力を受け付けるアプリは、表記を明示的に展開することを提案するか、拒否するかのどちらかにしなければならず、推測してはなりません。\n- この表記が役に立つのは、実際のアドレスが多くの先頭ゼロを持つ場合だけです。通常のアドレスでは、ポイズニングに対抗するために、依然としてアドレス全体を比較する（またはアドレス帳やネームサービスを使う）必要があります。\n- よく知られたコントラクトには、すでにマイニングされたゼロ始まりのアドレスを使うものがあります。たとえば `0x0000000071727De22E5E9d8BAf0edAc6f37da032` にある [ERC-4337](/eip-4337/) の EntryPoint（先頭ゼロが 7 個）です。\n"},"ko":{"lang":"ko","tldr":"주소 앞부분에 연속된 0을 개수로 접어서 보여 주는 표시 전용 표기(0x0₈… 또는 0x0(8)…). 사용자가 주소의 고유한 부분을 알아차리기 쉬워지고, 주소 포이즈닝의 비슷한 주소에 덜 속게 된다.","tags":["erc","wallet","ux","security","address"],"related":[55,1191,4337],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-8117/","markdown":"## 어떤 문제를 해결하나요?\n\n지갑은 보통 주소를 `0xd28b…6922`처럼 줄여서 보여 주고, 사용자는 그 몇 글자만 확인하는 데 익숙해집니다. **주소 포이즈닝(address poisoning)** 공격에서는 공격자가 눈에 보이는 앞부분과 뒷부분이 같은 비슷한 주소를 만들어 0 값 전송을 보내 내역에 나타나게 한 뒤, 여러분이 잘못된 주소를 복사하기를 기다립니다.\n\n방어책 중 하나는 앞에 0이 많은 주소(예: CREATE2로 채굴한 주소)를 쓰는 것입니다. 0이 하나 늘 때마다 공격자의 탐색 비용은 16배가 됩니다. 하지만 이는 사람이 0이 열한 개인지 열 개인지 한눈에 구별할 수 있을 때만 도움이 되는데, `0x00000000000C2E…`에서는 이것이 어렵습니다. ERC-8117은 0의 개수를 간결하게 보여 주는 방법을 표준화해 주소에서 엔트로피가 높은 부분이 전면에 오도록 합니다.\n\n## 어떻게 동작하나요?\n\n- **적용 조건:** 주소 본문이 `0x` 뒤에 `n \u003e= 4`개의 앞쪽 0 니블을 가질 때 이 표기를 적용합니다. `n`은 앞쪽 0의 *전체* 개수입니다.\n- **모드 A, 아래 첨자(UI):** 리터럴 `0x0`을 남기고, 그 뒤에 `n`을 유니코드 아래 첨자 숫자(U+2080–U+2089)로 쓰고, 0이 아닌 첫 번째 니블부터 주소의 나머지를 씁니다. `0x00000000abcd…`는 `0x0₈abcd…`가 됩니다.\n- **모드 B, 괄호(ASCII):** 로그, 터미널, 봇 메시지를 위한 같은 방식입니다: `0x0(8)abcd…`.\n- **대소문자:** 압축되지 않은 모든 문자는 원래의 대소문자를 유지하므로, 표시된 내용에는 [EIP-55](/eip-55/) / [EIP-1191](/eip-1191/) 체크섬이 그대로 적용됩니다.\n- **범위:** 앞쪽 0만 대상입니다. 중간이나 끝의 반복은 범위 밖입니다.\n\n이는 순전히 표시용입니다. 지갑은 서명하거나 브로드캐스트하기 전에 표기를 완전한 16진수로 다시 펼쳐야 합니다. 아래 첨자 숫자도 괄호도 유효한 16진수가 아니므로, 표기된 주소를 기존 시스템에 붙여 넣으면 조용히 엉뚱한 곳으로 보내지는 대신 \"잘못된 주소\"로 실패합니다.\n\n## 샘플 코드\n\n스펙의 규칙을 따르는 작은 TypeScript 포매터:\n\n```ts\nconst SUB = \"₀₁₂₃₄₅₆₇₈₉\";\n\nexport function formatAddress(addr: string, mode: \"unicode\" | \"ascii\" = \"unicode\", truncate = false): string {\n  const body = addr.slice(2);\n  const n = body.match(/^0*/)![0].length;\n  if (n \u003c 4) return addr;                       // below threshold: unchanged\n\n  const count = mode === \"unicode\"\n    ? [...String(n)].map((d) =\u003e SUB[Number(d)]).join(\"\")\n    : `(${n})`;\n  const rest = body.slice(n);\n  const shown = truncate \u0026\u0026 rest.length \u003e 8 ? `${rest.slice(0, 4)}…${rest.slice(-4)}` : rest;\n  return `0x0${count}${shown}`;\n}\n\nformatAddress(\"0x0000000071727De22E5E9d8BAf0edAc6f37da032\");\n// \"0x0₇71727De22E5E9d8BAf0edAc6f37da032\"\nformatAddress(\"0x0000000000000000000000000000000000000001\", \"ascii\");\n// \"0x0(39)1\"\n```\n\n## 알아둘 점\n\n- 상태: **Draft**. 임계값이나 표기 같은 세부 사항은 바뀔 수 있습니다.\n- 스펙은 아래 첨자가 뚜렷하게 읽혀야 한다고 요구합니다. 글꼴 선택 때문에 `0x0₇`이 `0x07`로 렌더링되어서는 안 됩니다.\n- 주소 입력을 받는 앱은 표기를 명시적으로 펼칠 수 있게 하거나 거부해야 하며, 절대 추측해서는 안 됩니다.\n- 이 표기는 실제 주소에 앞쪽 0이 많을 때만 도움이 됩니다. 일반 주소의 경우 포이즈닝에 맞서려면 여전히 전체 주소를 비교하거나(또는 주소록 / 네임 서비스를 사용해야) 합니다.\n- 잘 알려진 컨트랙트 중에는 이미 채굴한 0 접두사 주소를 쓰는 것이 있습니다. 예를 들어 `0x0000000071727De22E5E9d8BAf0edAc6f37da032`의 [ERC-4337](/eip-4337/) EntryPoint(앞쪽 0이 7개)가 그렇습니다.\n"},"zh":{"lang":"zh","tldr":"一种仅用于显示的记法，把地址开头连续的零折叠成一个计数（0x0₈… 或 0x0(8)…），让用户注意到地址中独特的部分，更难被地址投毒的相似地址欺骗。","tags":["erc","wallet","ux","security","address"],"related":[55,1191,4337],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-8117/","markdown":"## 它解决什么问题？\n\n钱包通常以截断形式显示地址，例如 `0xd28b…6922`，用户也逐渐习惯只核对这几个字符。在**地址投毒（address poisoning）**攻击中，攻击者生成一个可见前缀和后缀都相同的相似地址，向你发送一笔零值转账使其出现在你的历史记录中，然后等着你复制错误的地址。\n\n一种防御办法是使用带有大量前导零的地址（例如通过 CREATE2 挖掘）：每多一个零，攻击者的搜索成本就乘以 16。但这只有在人能一眼分辨十一个零和十个零时才有用，而面对 `0x00000000000C2E…` 这很难。ERC-8117 标准化了一种紧凑显示零个数的方式，让地址中高熵的部分处于最显眼的位置。\n\n## 它如何运作\n\n- **触发条件：** 当地址主体在 `0x` 之后有 `n \u003e= 4` 个前导零 nibble 时，应用这种记法。`n` 是前导零的*总*数。\n- **模式 A，下标（UI）：** 保留字面的 `0x0`，然后用 Unicode 下标数字（U+2080–U+2089）写出 `n`，再从第一个非零 nibble 开始写地址的其余部分。`0x00000000abcd…` 变为 `0x0₈abcd…`。\n- **模式 B，括号（ASCII）：** 用于日志、终端和机器人消息的同样思路：`0x0(8)abcd…`。\n- **大小写：** 所有未被压缩的字符保持原有大小写，因此 [EIP-55](/eip-55/) / [EIP-1191](/eip-1191/) 校验和仍适用于所显示的内容。\n- **范围：** 只针对前导零。中间或末尾的重复不在范围内。\n\n这纯粹是展示层面的。钱包在签名或广播之前，必须把这种记法还原为完整的十六进制。由于下标数字和括号都不是有效的十六进制，把带记法的地址粘贴到旧系统中会报“无效地址”，而不会悄悄地发往错误的地方。\n\n## 示例代码\n\n一个遵循规范规则的小型 TypeScript 格式化函数：\n\n```ts\nconst SUB = \"₀₁₂₃₄₅₆₇₈₉\";\n\nexport function formatAddress(addr: string, mode: \"unicode\" | \"ascii\" = \"unicode\", truncate = false): string {\n  const body = addr.slice(2);\n  const n = body.match(/^0*/)![0].length;\n  if (n \u003c 4) return addr;                       // below threshold: unchanged\n\n  const count = mode === \"unicode\"\n    ? [...String(n)].map((d) =\u003e SUB[Number(d)]).join(\"\")\n    : `(${n})`;\n  const rest = body.slice(n);\n  const shown = truncate \u0026\u0026 rest.length \u003e 8 ? `${rest.slice(0, 4)}…${rest.slice(-4)}` : rest;\n  return `0x0${count}${shown}`;\n}\n\nformatAddress(\"0x0000000071727De22E5E9d8BAf0edAc6f37da032\");\n// \"0x0₇71727De22E5E9d8BAf0edAc6f37da032\"\nformatAddress(\"0x0000000000000000000000000000000000000001\", \"ascii\");\n// \"0x0(39)1\"\n```\n\n## 需要注意\n\n- 状态：**Draft**。阈值或记法等细节仍可能变化。\n- 规范要求下标必须清晰易读：`0x0₇` 绝不能因为字体选择而被渲染成 `0x07`。\n- 接受地址输入的应用，要么明确提供展开该记法的选项，要么拒绝它；绝不能去猜测。\n- 只有当真实地址确实带有大量前导零时，这种记法才有帮助；对于普通地址，用户仍然需要比对完整地址（或使用地址簿 / 域名服务）来抵御投毒。\n- 一些知名合约已经使用挖掘得到的零前缀地址，例如位于 `0x0000000071727De22E5E9d8BAf0edAc6f37da032` 的 [ERC-4337](/eip-4337/) EntryPoint（7 个前导零）。\n"}}}
