{"eip":1062,"title":"Formalize IPFS hash into ENS(Ethereum Name Service) resolver","description":"To specify the mapping protocol between resources stored on IPFS and ENS(Ethereum Naming Service).","authors":["Phyrex Tsai \u003cphyrex@portal.network\u003e","Portal Network Team"],"status":"Stagnant","type":"Standards Track","category":"ERC","created":"2018-05-02","discussionsTo":"https://ethereum-magicians.org/t/eip-1062-formalize-ipfs-hash-into-ens-ethereum-name-service-resolver/281","repo":"ERCs","label":"ERC-1062","officialUrl":"https://eips.ethereum.org/EIPS/eip-1062","sourceUrl":"https://github.com/ethereum/ERCs/blob/master/ERCS/erc-1062.md","url":"https://eips.huatuo.xyz/eip-1062/","tldr":{"en":"An early proposal for storing IPFS content hashes in an ENS resolver, so a human-readable name like mysite.eth could point to a decentralized website.","ja":"IPFS のコンテンツハッシュを ENS リゾルバーに保存するための初期の提案。mysite.eth のような人が読める名前で、分散型ウェブサイトを指せるようにする。","ko":"IPFS 콘텐츠 해시를 ENS 리졸버에 저장하기 위한 초기 제안. mysite.eth 같은 사람이 읽을 수 있는 이름으로 탈중앙화 웹사이트를 가리킬 수 있게 한다.","zh":"一项早期提案，用于把 IPFS 内容哈希存入 ENS 解析器，让 mysite.eth 这样人类可读的名称可以指向去中心化网站。"},"tags":["ens","ipfs","resolver","storage","naming"],"explainers":{"en":{"lang":"en","tldr":"An early proposal for storing IPFS content hashes in an ENS resolver, so a human-readable name like mysite.eth could point to a decentralized website.","tags":["ens","ipfs","resolver","storage","naming"],"related":[137,1577],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-1062/","markdown":"## What problem does it solve?\n\nIPFS addresses content by its hash, a long Base58 string such as `QmXo...`. That is great for integrity but useless for humans: nobody remembers or types it. ENS ([EIP-137](/eip-137/)) already maps readable names like `mysite.eth` to data stored in a resolver contract.\n\nERC-1062 proposed a standard way to put an IPFS hash into an ENS resolver and get it back out, so a browser or extension could type an `.eth` name and load a fully decentralized site. The goal was a simple bridge between human-readable names and content-addressed storage.\n\n## How it works\n\nThe main difficulty is encoding. IPFS shows hashes as Base58 strings, while Ethereum contracts and JSON-RPC deal in raw bytes shown as hex. The proposal bridges the two through the underlying binary *multihash*:\n\n1. **Store:** decode the Base58 IPFS hash into bytes, then write those bytes to the resolver.\n2. **Read:** read the bytes from the resolver and encode them back into Base58 to get the IPFS hash.\n\nIt relies on two resolver methods:\n\n| Function | Purpose |\n| --- | --- |\n| `setMultihash(bytes32 node, bytes hash)` | Owner of the ENS name stores the multihash bytes |\n| `multihash(bytes32 node)` | Anyone reads the stored bytes back |\n\n`node` is the usual ENS namehash of the name. Only the owner of that node may call the setter.\n\nA classic IPFS (CIDv0) hash decodes to bytes starting with `0x12 0x20`: `0x12` means SHA-256 and `0x20` means a 32-byte digest, followed by the digest itself.\n\n## Sample code\n\nConverting between Base58 and hex with ethers v6 (the spec's own examples use the `multihashes` npm library):\n\n```ts\nimport { decodeBase58, encodeBase58, getBytes, toBeHex } from \"ethers\";\n\n// IPFS Base58 hash -\u003e 0x-hex bytes for the resolver\nexport const toHex = (ipfsHash: string): string =\u003e toBeHex(decodeBase58(ipfsHash));\n\n// 0x-hex bytes from the resolver -\u003e IPFS Base58 hash\nexport const toBase58 = (hex: string): string =\u003e encodeBase58(getBytes(hex));\n```\n\nThe resolver interface as described:\n\n```solidity\n// SPDX-License-Identifier: CC0-1.0\npragma solidity ^0.8.20;\n\ninterface IMultihashResolver {\n    function setMultihash(bytes32 node, bytes calldata hash) external; // only node owner\n    function multihash(bytes32 node) external view returns (bytes memory);\n}\n```\n\n## Things to know\n\n- **Status: Stagnant.** This proposal was never finalized.\n- The ecosystem standardized on the `contenthash` resolver field from [EIP-1577](/eip-1577/) instead. It can hold IPFS, Swarm and other content identifiers with a self-describing prefix, and is what ENS-aware wallets, gateways and libraries read today (for example ethers' `resolver.getContentHash()`).\n- `multihash` stores only the hash, without saying which storage network it belongs to. That limitation is one reason a more general field was preferred.\n- If you are publishing a site behind an ENS name today, set `contenthash`, not `multihash`.\n"},"ja":{"lang":"ja","tldr":"IPFS のコンテンツハッシュを ENS リゾルバーに保存するための初期の提案。mysite.eth のような人が読める名前で、分散型ウェブサイトを指せるようにする。","tags":["ens","ipfs","resolver","storage","naming"],"related":[137,1577],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-1062/","markdown":"## 何を解決するのか\n\nIPFS はコンテンツをそのハッシュ、つまり `QmXo...` のような長い Base58 文字列でアドレス指定します。完全性の面では優れていますが、人間には役に立ちません。誰もそれを覚えたり入力したりしないからです。ENS（[EIP-137](/eip-137/)）はすでに、`mysite.eth` のような読みやすい名前を、リゾルバーコントラクトに保存されたデータに対応づけています。\n\nERC-1062 は、IPFS ハッシュを ENS リゾルバーに入れ、取り出すための標準的な方法を提案しました。ブラウザや拡張機能が `.eth` の名前を入力するだけで、完全に分散化されたサイトを読み込めるようにするためです。目標は、人が読める名前とコンテンツアドレス方式のストレージとの間を、シンプルにつなぐことでした。\n\n## 仕組み\n\n主な難しさはエンコーディングです。IPFS はハッシュを Base58 文字列として表示しますが、Ethereum のコントラクトと JSON-RPC は、16 進で表示される生のバイト列を扱います。提案は、その根底にあるバイナリの*マルチハッシュ*を介して両者をつなぎます。\n\n1. **保存:** IPFS の Base58 ハッシュをバイト列にデコードし、そのバイト列をリゾルバーに書き込みます。\n2. **読み取り:** リゾルバーからバイト列を読み取り、Base58 にエンコードし直して IPFS ハッシュを得ます。\n\n2 つのリゾルバーメソッドを利用します。\n\n| 関数 | 役割 |\n| --- | --- |\n| `setMultihash(bytes32 node, bytes hash)` | ENS 名の所有者がマルチハッシュのバイト列を保存する |\n| `multihash(bytes32 node)` | 誰でも、保存されたバイト列を読み戻せる |\n\n`node` は、その名前の通常の ENS namehash です。セッターを呼び出せるのは、その node の所有者だけです。\n\n従来の IPFS（CIDv0）のハッシュは、`0x12 0x20` で始まるバイト列にデコードされます。`0x12` は SHA-256、`0x20` は 32 バイトのダイジェストを意味し、その後にダイジェスト本体が続きます。\n\n## サンプルコード\n\nethers v6 で Base58 と 16 進を相互変換する例です（仕様書自身の例は `multihashes` の npm ライブラリを使っています）。\n\n```ts\nimport { decodeBase58, encodeBase58, getBytes, toBeHex } from \"ethers\";\n\n// IPFS Base58 hash -\u003e 0x-hex bytes for the resolver\nexport const toHex = (ipfsHash: string): string =\u003e toBeHex(decodeBase58(ipfsHash));\n\n// 0x-hex bytes from the resolver -\u003e IPFS Base58 hash\nexport const toBase58 = (hex: string): string =\u003e encodeBase58(getBytes(hex));\n```\n\n説明にあるリゾルバーのインターフェース:\n\n```solidity\n// SPDX-License-Identifier: CC0-1.0\npragma solidity ^0.8.20;\n\ninterface IMultihashResolver {\n    function setMultihash(bytes32 node, bytes calldata hash) external; // only node owner\n    function multihash(bytes32 node) external view returns (bytes memory);\n}\n```\n\n## 知っておくべきこと\n\n- **ステータス: Stagnant。** この提案は確定したことがありません。\n- エコシステムは、代わりに [EIP-1577](/eip-1577/) の `contenthash` リゾルバーフィールドで標準化しました。これは、自己記述的なプレフィックスを付けて IPFS、Swarm、その他のコンテンツ識別子を保持でき、現在の ENS 対応ウォレット、ゲートウェイ、ライブラリが読み取るのもこれです（たとえば ethers の `resolver.getContentHash()`）。\n- `multihash` はハッシュだけを保存し、それがどのストレージネットワークのものかは示しません。この制約が、より汎用的なフィールドが選ばれた理由の 1 つです。\n- 今日、ENS 名の背後でサイトを公開するなら、`multihash` ではなく `contenthash` を設定してください。\n"},"ko":{"lang":"ko","tldr":"IPFS 콘텐츠 해시를 ENS 리졸버에 저장하기 위한 초기 제안. mysite.eth 같은 사람이 읽을 수 있는 이름으로 탈중앙화 웹사이트를 가리킬 수 있게 한다.","tags":["ens","ipfs","resolver","storage","naming"],"related":[137,1577],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-1062/","markdown":"## 어떤 문제를 해결하나요?\n\nIPFS는 콘텐츠를 그 해시, 즉 `QmXo...` 같은 긴 Base58 문자열로 주소 지정합니다. 무결성에는 훌륭하지만 사람에게는 쓸모가 없습니다. 아무도 그것을 기억하거나 입력하지 않기 때문입니다. ENS([EIP-137](/eip-137/))는 이미 `mysite.eth` 같은 읽기 쉬운 이름을 리졸버 컨트랙트에 저장된 데이터로 매핑해 줍니다.\n\nERC-1062는 IPFS 해시를 ENS 리졸버에 넣고 다시 꺼내는 표준적인 방법을 제안했습니다. 브라우저나 확장 프로그램이 `.eth` 이름을 입력하는 것만으로 완전히 탈중앙화된 사이트를 불러올 수 있게 하려는 것입니다. 목표는 사람이 읽을 수 있는 이름과 콘텐츠 주소 방식 스토리지 사이를 잇는 단순한 다리였습니다.\n\n## 어떻게 동작하나요?\n\n주된 어려움은 인코딩입니다. IPFS는 해시를 Base58 문자열로 보여 주지만, 이더리움 컨트랙트와 JSON-RPC는 16진수로 표시되는 원시 바이트를 다룹니다. 제안은 그 밑바탕의 바이너리 *멀티해시*를 통해 둘을 연결합니다.\n\n1. **저장:** Base58 IPFS 해시를 바이트로 디코딩한 뒤, 그 바이트를 리졸버에 씁니다.\n2. **읽기:** 리졸버에서 바이트를 읽어 다시 Base58로 인코딩해 IPFS 해시를 얻습니다.\n\n리졸버의 두 메서드를 사용합니다.\n\n| 함수 | 역할 |\n| --- | --- |\n| `setMultihash(bytes32 node, bytes hash)` | ENS 이름의 소유자가 멀티해시 바이트를 저장 |\n| `multihash(bytes32 node)` | 누구나 저장된 바이트를 다시 읽음 |\n\n`node`는 해당 이름의 일반적인 ENS namehash입니다. setter는 그 node의 소유자만 호출할 수 있습니다.\n\n전형적인 IPFS(CIDv0) 해시는 `0x12 0x20`으로 시작하는 바이트로 디코딩됩니다. `0x12`는 SHA-256, `0x20`은 32바이트 다이제스트를 뜻하며, 그 뒤에 다이제스트 자체가 이어집니다.\n\n## 샘플 코드\n\nethers v6로 Base58과 16진수 사이를 변환하는 예시입니다(명세의 예시는 `multihashes` npm 라이브러리를 사용합니다).\n\n```ts\nimport { decodeBase58, encodeBase58, getBytes, toBeHex } from \"ethers\";\n\n// IPFS Base58 hash -\u003e 0x-hex bytes for the resolver\nexport const toHex = (ipfsHash: string): string =\u003e toBeHex(decodeBase58(ipfsHash));\n\n// 0x-hex bytes from the resolver -\u003e IPFS Base58 hash\nexport const toBase58 = (hex: string): string =\u003e encodeBase58(getBytes(hex));\n```\n\n설명된 리졸버 인터페이스:\n\n```solidity\n// SPDX-License-Identifier: CC0-1.0\npragma solidity ^0.8.20;\n\ninterface IMultihashResolver {\n    function setMultihash(bytes32 node, bytes calldata hash) external; // only node owner\n    function multihash(bytes32 node) external view returns (bytes memory);\n}\n```\n\n## 알아둘 점\n\n- **상태: Stagnant.** 이 제안은 최종 확정된 적이 없습니다.\n- 생태계는 대신 [EIP-1577](/eip-1577/)의 `contenthash` 리졸버 필드로 표준화했습니다. 자기 기술적인 접두사를 붙여 IPFS, Swarm 등 다른 콘텐츠 식별자를 담을 수 있으며, 오늘날 ENS를 지원하는 지갑, 게이트웨이, 라이브러리가 읽는 것도 이것입니다(예: ethers의 `resolver.getContentHash()`).\n- `multihash`는 해시만 저장하고 그것이 어느 스토리지 네트워크에 속하는지는 알려 주지 않습니다. 이 한계가 더 범용적인 필드가 선호된 이유 중 하나입니다.\n- 오늘 ENS 이름 뒤에 사이트를 게시한다면 `multihash`가 아니라 `contenthash`를 설정하세요.\n"},"zh":{"lang":"zh","tldr":"一项早期提案，用于把 IPFS 内容哈希存入 ENS 解析器，让 mysite.eth 这样人类可读的名称可以指向去中心化网站。","tags":["ens","ipfs","resolver","storage","naming"],"related":[137,1577],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-1062/","markdown":"## 它解决什么问题？\n\nIPFS 通过内容的哈希来寻址，哈希是一长串 Base58 字符串，例如 `QmXo...`。这对完整性很有利，但对人类毫无用处：没有人会记住或输入它。ENS（[EIP-137](/eip-137/)）已经能把 `mysite.eth` 这样易读的名称映射到存放在解析器合约中的数据。\n\nERC-1062 提出了一种把 IPFS 哈希放进 ENS 解析器并再取出来的标准方式，这样浏览器或扩展只需输入 `.eth` 名称，就能加载一个完全去中心化的网站。其目标是在人类可读的名称与内容寻址存储之间搭建一座简单的桥梁。\n\n## 它如何运作\n\n主要的难点在于编码。IPFS 以 Base58 字符串显示哈希，而以太坊合约和 JSON-RPC 处理的是以十六进制显示的原始字节。该提案通过底层的二进制*multihash*来连接两者：\n\n1. **存储：** 把 Base58 的 IPFS 哈希解码为字节，再把这些字节写入解析器。\n2. **读取：** 从解析器读取字节，再编码回 Base58，得到 IPFS 哈希。\n\n它依赖解析器的两个方法：\n\n| 函数 | 用途 |\n| --- | --- |\n| `setMultihash(bytes32 node, bytes hash)` | ENS 名称的所有者存入 multihash 字节 |\n| `multihash(bytes32 node)` | 任何人都可以读回存入的字节 |\n\n`node` 是该名称通常的 ENS namehash。只有该 node 的所有者才能调用 setter。\n\n经典的 IPFS（CIDv0）哈希解码后的字节以 `0x12 0x20` 开头：`0x12` 表示 SHA-256，`0x20` 表示 32 字节的摘要，后面跟着摘要本身。\n\n## 示例代码\n\n用 ethers v6 在 Base58 与十六进制之间转换（规范自己的示例使用 `multihashes` npm 库）：\n\n```ts\nimport { decodeBase58, encodeBase58, getBytes, toBeHex } from \"ethers\";\n\n// IPFS Base58 hash -\u003e 0x-hex bytes for the resolver\nexport const toHex = (ipfsHash: string): string =\u003e toBeHex(decodeBase58(ipfsHash));\n\n// 0x-hex bytes from the resolver -\u003e IPFS Base58 hash\nexport const toBase58 = (hex: string): string =\u003e encodeBase58(getBytes(hex));\n```\n\n所述的解析器接口：\n\n```solidity\n// SPDX-License-Identifier: CC0-1.0\npragma solidity ^0.8.20;\n\ninterface IMultihashResolver {\n    function setMultihash(bytes32 node, bytes calldata hash) external; // only node owner\n    function multihash(bytes32 node) external view returns (bytes memory);\n}\n```\n\n## 需要注意\n\n- **状态：Stagnant。** 该提案从未最终确定。\n- 生态系统最终统一采用了 [EIP-1577](/eip-1577/) 的 `contenthash` 解析器字段。它可以用自描述的前缀保存 IPFS、Swarm 和其他内容标识符，也是如今支持 ENS 的钱包、网关和库所读取的字段（例如 ethers 的 `resolver.getContentHash()`）。\n- `multihash` 只存储哈希，不说明它属于哪个存储网络。这一局限是人们更倾向于使用更通用字段的原因之一。\n- 如果你今天要在某个 ENS 名称后发布网站，请设置 `contenthash`，而不是 `multihash`。\n"}},"requiredBy":[2390]}
