{"eip":205,"title":"ENS support for contract ABIs","description":"This EIP proposes a mechanism for storing ABI definitions in ENS, for easy lookup of contract interfaces by callers.","authors":["Nick Johnson \u003cnick@ethereum.org\u003e"],"status":"Stagnant","type":"Standards Track","category":"ERC","created":"2017-02-06","requires":[137,181],"repo":"ERCs","label":"ERC-205","officialUrl":"https://eips.ethereum.org/EIPS/eip-205","sourceUrl":"https://github.com/ethereum/ERCs/blob/master/ERCS/erc-205.md","url":"https://eips.huatuo.xyz/eip-205/","tldr":{"en":"Lets an ENS name publish its contract's ABI, so a caller can look up both the address and the interface of a contract from one name.","ja":"ENS の名前がコントラクトの ABI を公開できるようにし、呼び出し側が 1 つの名前からコントラクトのアドレスとインターフェースの両方を調べられるようにする。","ko":"ENS 이름이 자신의 컨트랙트 ABI를 게시할 수 있게 해, 호출자가 하나의 이름으로 컨트랙트의 주소와 인터페이스를 모두 조회할 수 있게 한다.","zh":"让 ENS 名称发布其合约的 ABI，调用者只需一个名称就能同时查到合约的地址和接口。"},"tags":["ens","abi","resolver","metadata"],"explainers":{"en":{"lang":"en","tldr":"Lets an ENS name publish its contract's ABI, so a caller can look up both the address and the interface of a contract from one name.","tags":["ens","abi","resolver","metadata"],"related":[137,181,634,3668],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-205/","markdown":"## What problem does it solve?\n\nTo call a contract you need its address and its ABI, the JSON description of its functions and events. [ENS](/eip-137/) solved the address part: `mytoken.eth` resolves to an address. The ABI, though, still had to come from somewhere else, such as a website, a GitHub repo or a block explorer. That is awkward for one-off interactions and for contracts whose interface changes over time.\n\nABIs are small. The spec notes that even The DAO's large ABI was about 9.4 KB of raw JSON and about 1.1 KB compressed. So ERC-205 proposes storing them right in ENS, next to the address.\n\n## How it works\n\nERC-205 defines a new **resolver profile**:\n\n```solidity\nfunction ABI(bytes32 node, uint256 contentTypes) view returns (uint256, bytes);\n```\n\nIts ERC-165 interface ID is `0x2203ab56`.\n\n`contentTypes` is a bitmask of the encodings the caller can handle. The resolver returns one of them, or `(0, \"\")` if it has nothing suitable.\n\n| ID | Encoding | Notes |\n| --- | --- | --- |\n| 1 | JSON | Standard, but the largest |\n| 2 | zlib-compressed JSON | Small, easy to decode off-chain |\n| 4 | CBOR | Compact and easier to parse in the EVM |\n| 8 | URI | Points elsewhere (HTTP, IPFS, Swarm…) |\n\n**Lookup order:** first ask the resolver for the name itself, such as `mytoken.eth`. If that returns nothing, do a reverse lookup ([ERC-181](/eip-181/)) on the address the name points to, and ask that record. A contract can publish its own canonical ABI on its reverse record, and individual names can override it, for example with a trimmed ABI.\n\n## Sample code\n\nFetching a JSON ABI via ENS with ethers v6:\n\n```ts\nimport { Contract, JsonRpcProvider, namehash, toUtf8String } from \"ethers\";\n\nconst provider = new JsonRpcProvider(process.env.RPC_URL);\nconst name = \"example.eth\";\n\nconst resolverInfo = await provider.getResolver(name);\nif (!resolverInfo) throw new Error(\"no resolver\");\n\nconst resolver = new Contract(\n  resolverInfo.address,\n  [\"function ABI(bytes32 node, uint256 contentTypes) view returns (uint256, bytes)\"],\n  provider,\n);\n\nconst [type, data] = await resolver.ABI(namehash(name), 1); // accept JSON only\nif (type === 1n) {\n  const abi = JSON.parse(toUtf8String(data));\n  const target = new Contract((await provider.resolveName(name))!, abi, provider);\n}\n```\n\n## Things to know\n\n- This ERC is **Stagnant**. It never reached Final, but the `ABI` record does appear in ENS resolver implementations.\n- In practice, most developers still get ABIs from verified source on block explorers or from package artifacts, not from ENS.\n- Uncompressed JSON is expensive to write on-chain. Prefer compressed, CBOR or URI forms for large ABIs.\n- Other ENS record types follow the same resolver-profile pattern, for example text records in [ERC-634](/eip-634/). Off-chain resolution is possible with [ERC-3668](/eip-3668/) (CCIP Read).\n"},"ja":{"lang":"ja","tldr":"ENS の名前がコントラクトの ABI を公開できるようにし、呼び出し側が 1 つの名前からコントラクトのアドレスとインターフェースの両方を調べられるようにする。","tags":["ens","abi","resolver","metadata"],"related":[137,181,634,3668],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-205/","markdown":"## 何を解決するのか\n\nコントラクトを呼び出すには、そのアドレスと ABI（関数とイベントを記述した JSON）が必要です。[ENS](/eip-137/) はアドレスの部分を解決しました。`mytoken.eth` はアドレスに解決されます。しかし ABI は、ウェブサイト、GitHub リポジトリ、ブロックエクスプローラーなど別の場所から入手する必要がありました。単発のやり取りや、インターフェースが時間とともに変わるコントラクトでは不便です。\n\nABI は小さなものです。仕様によると、The DAO の大きな ABI でも生の JSON で約 9.4 KB、圧縮すると約 1.1 KB でした。そこで ERC-205 は、アドレスの隣に ABI を ENS 内へ直接保存することを提案しています。\n\n## 仕組み\n\nERC-205 は新しい**リゾルバプロファイル**を定義します。\n\n```solidity\nfunction ABI(bytes32 node, uint256 contentTypes) view returns (uint256, bytes);\n```\n\nその ERC-165 インターフェース ID は `0x2203ab56` です。\n\n`contentTypes` は、呼び出し側が扱えるエンコーディングのビットマスクです。リゾルバはそのうち 1 つを返し、適切なものがなければ `(0, \"\")` を返します。\n\n| ID | エンコーディング | 備考 |\n| --- | --- | --- |\n| 1 | JSON | 標準的だが最も大きい |\n| 2 | zlib 圧縮された JSON | 小さく、オフチェーンでデコードしやすい |\n| 4 | CBOR | コンパクトで、EVM 内でもパースしやすい |\n| 8 | URI | 別の場所（HTTP、IPFS、Swarm など）を指す |\n\n**検索の順序:** まず `mytoken.eth` のような名前そのものについてリゾルバに尋ねます。何も返らなければ、その名前が指すアドレスで逆引き（[ERC-181](/eip-181/)）を行い、そのレコードを尋ねます。コントラクトは自分の正規の ABI を逆引きレコードに公開でき、個々の名前はそれを上書きできます。たとえば、絞り込んだ ABI を設定できます。\n\n## サンプルコード\n\nethers v6 で ENS 経由で JSON の ABI を取得する例:\n\n```ts\nimport { Contract, JsonRpcProvider, namehash, toUtf8String } from \"ethers\";\n\nconst provider = new JsonRpcProvider(process.env.RPC_URL);\nconst name = \"example.eth\";\n\nconst resolverInfo = await provider.getResolver(name);\nif (!resolverInfo) throw new Error(\"no resolver\");\n\nconst resolver = new Contract(\n  resolverInfo.address,\n  [\"function ABI(bytes32 node, uint256 contentTypes) view returns (uint256, bytes)\"],\n  provider,\n);\n\nconst [type, data] = await resolver.ABI(namehash(name), 1); // accept JSON only\nif (type === 1n) {\n  const abi = JSON.parse(toUtf8String(data));\n  const target = new Contract((await provider.resolveName(name))!, abi, provider);\n}\n```\n\n## 知っておくべきこと\n\n- この ERC は **Stagnant** です。Final には到達しませんでしたが、`ABI` レコードは ENS のリゾルバ実装に存在します。\n- 実際には、ほとんどの開発者は今でも ABI を ENS ではなく、ブロックエクスプローラーの検証済みソースやパッケージの成果物から入手しています。\n- 非圧縮の JSON はオンチェーンへの書き込みコストが高くなります。大きな ABI には、圧縮、CBOR、URI 形式を推奨します。\n- 他の ENS レコードタイプも同じリゾルバプロファイルのパターンに従います。たとえば [ERC-634](/eip-634/) のテキストレコードがあります。[ERC-3668](/eip-3668/)（CCIP Read）でオフチェーン解決も可能です。\n"},"ko":{"lang":"ko","tldr":"ENS 이름이 자신의 컨트랙트 ABI를 게시할 수 있게 해, 호출자가 하나의 이름으로 컨트랙트의 주소와 인터페이스를 모두 조회할 수 있게 한다.","tags":["ens","abi","resolver","metadata"],"related":[137,181,634,3668],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-205/","markdown":"## 어떤 문제를 해결하나요?\n\n컨트랙트를 호출하려면 주소와 ABI, 즉 함수와 이벤트를 설명하는 JSON이 필요합니다. [ENS](/eip-137/)는 주소 부분을 해결했습니다. `mytoken.eth`는 주소로 해석됩니다. 하지만 ABI는 웹사이트, GitHub 저장소, 블록 익스플로러 같은 다른 곳에서 가져와야 했습니다. 일회성 상호작용이나 인터페이스가 시간에 따라 바뀌는 컨트랙트에는 불편합니다.\n\nABI는 작습니다. 명세에 따르면 The DAO의 큰 ABI조차 원본 JSON으로 약 9.4 KB, 압축하면 약 1.1 KB였습니다. 그래서 ERC-205는 ABI를 주소 옆에 ENS 안에 바로 저장하자고 제안합니다.\n\n## 어떻게 동작하나요?\n\nERC-205는 새로운 **리졸버 프로필**을 정의합니다.\n\n```solidity\nfunction ABI(bytes32 node, uint256 contentTypes) view returns (uint256, bytes);\n```\n\nERC-165 인터페이스 ID는 `0x2203ab56`입니다.\n\n`contentTypes`는 호출자가 처리할 수 있는 인코딩의 비트마스크입니다. 리졸버는 그중 하나를 반환하고, 적합한 것이 없으면 `(0, \"\")`를 반환합니다.\n\n| ID | 인코딩 | 비고 |\n| --- | --- | --- |\n| 1 | JSON | 표준이지만 가장 큼 |\n| 2 | zlib으로 압축한 JSON | 작고 오프체인에서 디코딩하기 쉬움 |\n| 4 | CBOR | 간결하고 EVM에서 파싱하기 더 쉬움 |\n| 8 | URI | 다른 곳(HTTP, IPFS, Swarm 등)을 가리킴 |\n\n**조회 순서:** 먼저 `mytoken.eth` 같은 이름 자체에 대해 리졸버에 묻습니다. 아무것도 반환되지 않으면 그 이름이 가리키는 주소에 대해 역방향 조회([ERC-181](/eip-181/))를 하고 그 레코드를 묻습니다. 컨트랙트는 자신의 정식 ABI를 역방향 레코드에 게시할 수 있고, 개별 이름은 이를 덮어쓸 수 있습니다. 예를 들어 간추린 ABI를 둘 수 있습니다.\n\n## 샘플 코드\n\nethers v6로 ENS를 통해 JSON ABI를 가져오는 예:\n\n```ts\nimport { Contract, JsonRpcProvider, namehash, toUtf8String } from \"ethers\";\n\nconst provider = new JsonRpcProvider(process.env.RPC_URL);\nconst name = \"example.eth\";\n\nconst resolverInfo = await provider.getResolver(name);\nif (!resolverInfo) throw new Error(\"no resolver\");\n\nconst resolver = new Contract(\n  resolverInfo.address,\n  [\"function ABI(bytes32 node, uint256 contentTypes) view returns (uint256, bytes)\"],\n  provider,\n);\n\nconst [type, data] = await resolver.ABI(namehash(name), 1); // accept JSON only\nif (type === 1n) {\n  const abi = JSON.parse(toUtf8String(data));\n  const target = new Contract((await provider.resolveName(name))!, abi, provider);\n}\n```\n\n## 알아둘 점\n\n- 이 ERC는 **Stagnant** 상태입니다. Final에 도달한 적은 없지만, `ABI` 레코드는 ENS 리졸버 구현에 실제로 존재합니다.\n- 실제로는 대부분의 개발자가 여전히 ENS가 아니라 블록 익스플로러의 검증된 소스나 패키지 산출물에서 ABI를 얻습니다.\n- 압축하지 않은 JSON은 온체인에 쓰는 비용이 큽니다. 큰 ABI에는 압축, CBOR, URI 형식을 권장합니다.\n- 다른 ENS 레코드 유형도 같은 리졸버 프로필 패턴을 따릅니다. 예를 들어 [ERC-634](/eip-634/)의 텍스트 레코드가 있습니다. [ERC-3668](/eip-3668/)(CCIP Read)로 오프체인 해석도 가능합니다.\n"},"zh":{"lang":"zh","tldr":"让 ENS 名称发布其合约的 ABI，调用者只需一个名称就能同时查到合约的地址和接口。","tags":["ens","abi","resolver","metadata"],"related":[137,181,634,3668],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-205/","markdown":"## 它解决什么问题？\n\n调用合约需要它的地址和 ABI，也就是对函数和事件的 JSON 描述。[ENS](/eip-137/) 解决了地址这部分：`mytoken.eth` 可以解析为地址。但 ABI 仍然得从别处获取，比如网站、GitHub 仓库或区块浏览器。对于一次性的交互，以及接口会随时间变化的合约，这很不方便。\n\nABI 很小。规范指出，即便是 The DAO 那个庞大的 ABI，原始 JSON 也只有约 9.4 KB，压缩后约 1.1 KB。因此 ERC-205 提议把它们直接存放在 ENS 中，紧挨着地址。\n\n## 它如何运作\n\nERC-205 定义了一种新的**解析器配置（resolver profile）**：\n\n```solidity\nfunction ABI(bytes32 node, uint256 contentTypes) view returns (uint256, bytes);\n```\n\n它的 ERC-165 接口 ID 是 `0x2203ab56`。\n\n`contentTypes` 是调用者能处理的编码的位掩码。解析器返回其中一种，如果没有合适的就返回 `(0, \"\")`。\n\n| ID | 编码 | 说明 |\n| --- | --- | --- |\n| 1 | JSON | 标准格式，但体积最大 |\n| 2 | zlib 压缩的 JSON | 体积小，便于链下解码 |\n| 4 | CBOR | 紧凑，在 EVM 中更易解析 |\n| 8 | URI | 指向别处（HTTP、IPFS、Swarm……） |\n\n**查找顺序：** 先向解析器查询名称本身，例如 `mytoken.eth`。如果没有返回内容，就对该名称所指向的地址做反向查询（[ERC-181](/eip-181/)），再查询那条记录。合约可以在自己的反向记录上发布其规范 ABI，而单个名称可以覆盖它，例如使用精简过的 ABI。\n\n## 示例代码\n\n用 ethers v6 通过 ENS 获取 JSON ABI：\n\n```ts\nimport { Contract, JsonRpcProvider, namehash, toUtf8String } from \"ethers\";\n\nconst provider = new JsonRpcProvider(process.env.RPC_URL);\nconst name = \"example.eth\";\n\nconst resolverInfo = await provider.getResolver(name);\nif (!resolverInfo) throw new Error(\"no resolver\");\n\nconst resolver = new Contract(\n  resolverInfo.address,\n  [\"function ABI(bytes32 node, uint256 contentTypes) view returns (uint256, bytes)\"],\n  provider,\n);\n\nconst [type, data] = await resolver.ABI(namehash(name), 1); // accept JSON only\nif (type === 1n) {\n  const abi = JSON.parse(toUtf8String(data));\n  const target = new Contract((await provider.resolveName(name))!, abi, provider);\n}\n```\n\n## 需要注意\n\n- 这个 ERC 处于 **Stagnant**（停滞）状态。它从未达到 Final，但 `ABI` 记录确实出现在 ENS 解析器的实现中。\n- 实际上，大多数开发者仍然从区块浏览器上已验证的源码或包的构建产物中获取 ABI，而不是从 ENS。\n- 未压缩的 JSON 写入链上成本很高。较大的 ABI 建议使用压缩、CBOR 或 URI 形式。\n- 其他 ENS 记录类型遵循同样的解析器配置模式，例如 [ERC-634](/eip-634/) 中的文本记录。借助 [ERC-3668](/eip-3668/)（CCIP Read）也可以实现链下解析。\n"}}}
