{"eip":3091,"title":"Block Explorer API Routes","description":"API Routes for Blockchain explorers","authors":["Pedro Gomes (@pedrouid)","ligi (@ligi)"],"status":"Stagnant","type":"Standards Track","category":"Interface","created":"2020-11-02","discussionsTo":"https://ethereum-magicians.org/t/eip-3091-block-explorer-api-routes/4907","repo":"EIPs","label":"EIP-3091","officialUrl":"https://eips.ethereum.org/EIPS/eip-3091","sourceUrl":"https://github.com/ethereum/EIPs/blob/master/EIPS/eip-3091.md","url":"https://eips.huatuo.xyz/eip-3091/","tldr":{"en":"Standardizes four block explorer URL paths (/block, /tx, /address, /token) so wallets and dapps can link to any chain's explorer knowing only its base URL.","ja":"ブロックエクスプローラーの 4 つの URL パス（/block、/tx、/address、/token）を標準化し、ウォレットや dapp がベース URL だけを知っていればどのチェーンのエクスプローラーにもリンクできるようにする。","ko":"블록 탐색기의 URL 경로 네 개(/block, /tx, /address, /token)를 표준화해, 지갑과 dapp이 기본 URL만 알면 어떤 체인의 탐색기에든 링크할 수 있게 한다.","zh":"规范区块浏览器的四条 URL 路径（/block、/tx、/address、/token），让钱包和 dapp 只需知道基础 URL 就能链接到任何链的浏览器。"},"tags":["block-explorer","interface","urls","wallet","ux"],"explainers":{"en":{"lang":"en","tldr":"Standardizes four block explorer URL paths (/block, /tx, /address, /token) so wallets and dapps can link to any chain's explorer knowing only its base URL.","tags":["block-explorer","interface","urls","wallet","ux"],"related":[3085,1193],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-3091/","markdown":"## What problem does it solve?\n\nWallets and dapps constantly link out to block explorers: \"view this transaction\", \"see this address\". With one chain and one dominant explorer, hardcoding the URL format was fine. As more chains and layer-2 networks appeared, each explorer could choose its own paths, so a wallet adding a new network had to learn yet another URL scheme, and links broke or pointed to the wrong page.\n\nEIP-3091 fixes that by agreeing on a common set of routes. If an explorer follows it, a wallet only needs the explorer's base URL.\n\n## How it works\n\nGiven a base URL such as `https://explorer.example.org`, a compliant explorer serves:\n\n| Resource | Route |\n| --- | --- |\n| Block | `\u003cBLOCK_EXPLORER_URL\u003e/block/\u003cBLOCK_HASH_OR_HEIGHT\u003e` |\n| Transaction | `\u003cBLOCK_EXPLORER_URL\u003e/tx/\u003cTX_HASH\u003e` |\n| Account | `\u003cBLOCK_EXPLORER_URL\u003e/address/\u003cACCOUNT_ADDRESS\u003e` |\n| Token | `\u003cBLOCK_EXPLORER_URL\u003e/token/\u003cTOKEN_ADDRESS\u003e` |\n\nThe paths were picked to match what most explorers already used, so many were compliant from the start. An explorer with a different layout can comply by redirecting these paths to its own routes.\n\nThe base URL itself usually comes from chain metadata, for example the `blockExplorerUrls` field a dapp passes to `wallet_addEthereumChain` ([EIP-3085](/eip-3085/)).\n\n## Sample code\n\nBuilding explorer links in TypeScript:\n\n```ts\ntype Kind = \"block\" | \"tx\" | \"address\" | \"token\";\n\nexport function explorerLink(baseUrl: string, kind: Kind, id: string | number): string {\n  const base = baseUrl.replace(/\\/+$/, \"\"); // strip trailing slash\n  return `${base}/${kind}/${id}`;\n}\n\nexplorerLink(\"https://etherscan.io\", \"tx\", \"0xabc...\");          // https://etherscan.io/tx/0xabc...\nexplorerLink(\"https://etherscan.io\", \"block\", 19_000_000);       // https://etherscan.io/block/19000000\nexplorerLink(\"https://etherscan.io/\", \"address\", \"0x1234...\");   // https://etherscan.io/address/0x1234...\n```\n\nUsing it with chain metadata a wallet already has:\n\n```ts\nconst chain = { chainId: \"0x1\", blockExplorerUrls: [\"https://etherscan.io\"] };\nwindow.open(explorerLink(chain.blockExplorerUrls[0], \"tx\", txHash));\n```\n\n## Things to know\n\n- **Status: Stagnant.** It was not finalized, but the four routes match the de facto convention used by many popular explorers.\n- The EIP only defines web page routes for humans, not a data API. Explorers' JSON APIs are separate and still differ.\n- Nothing forces an explorer to follow these paths, so wallets that support many networks may still need per-explorer exceptions.\n- Block routes accept either a hash or a height; your code should pass whichever you have without assuming one.\n"},"ja":{"lang":"ja","tldr":"ブロックエクスプローラーの 4 つの URL パス（/block、/tx、/address、/token）を標準化し、ウォレットや dapp がベース URL だけを知っていればどのチェーンのエクスプローラーにもリンクできるようにする。","tags":["block-explorer","interface","urls","wallet","ux"],"related":[3085,1193],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-3091/","markdown":"## 何を解決するのか\n\nウォレットや dapp は、「このトランザクションを見る」「このアドレスを見る」のように、ブロックエクスプローラーへ頻繁にリンクします。チェーンが 1 つでエクスプローラーも 1 つが主流だった頃は、URL の形式をハードコードしても問題ありませんでした。チェーンやレイヤー 2 ネットワークが増えると、各エクスプローラーが独自のパスを選べるようになり、新しいネットワークを追加するウォレットは、また別の URL 体系を学ぶ必要が生じ、リンクが壊れたり誤ったページを指したりしました。\n\nEIP-3091 は、共通のルートの集合に合意することでこれを解決します。エクスプローラーがこれに従っていれば、ウォレットに必要なのはエクスプローラーのベース URL だけです。\n\n## 仕組み\n\n`https://explorer.example.org` のようなベース URL があるとき、準拠したエクスプローラーは次を提供します。\n\n| リソース | ルート |\n| --- | --- |\n| ブロック | `\u003cBLOCK_EXPLORER_URL\u003e/block/\u003cBLOCK_HASH_OR_HEIGHT\u003e` |\n| トランザクション | `\u003cBLOCK_EXPLORER_URL\u003e/tx/\u003cTX_HASH\u003e` |\n| アカウント | `\u003cBLOCK_EXPLORER_URL\u003e/address/\u003cACCOUNT_ADDRESS\u003e` |\n| トークン | `\u003cBLOCK_EXPLORER_URL\u003e/token/\u003cTOKEN_ADDRESS\u003e` |\n\nパスは、ほとんどのエクスプローラーがすでに使っていたものに合わせて選ばれたため、多くは最初から準拠していました。異なる構成のエクスプローラーも、これらのパスを自前のルートにリダイレクトすれば準拠できます。\n\nベース URL 自体は通常、チェーンのメタデータから得られます。たとえば dapp が `wallet_addEthereumChain`（[EIP-3085](/eip-3085/)）に渡す `blockExplorerUrls` フィールドです。\n\n## サンプルコード\n\nTypeScript でエクスプローラーのリンクを組み立てる例:\n\n```ts\ntype Kind = \"block\" | \"tx\" | \"address\" | \"token\";\n\nexport function explorerLink(baseUrl: string, kind: Kind, id: string | number): string {\n  const base = baseUrl.replace(/\\/+$/, \"\"); // strip trailing slash\n  return `${base}/${kind}/${id}`;\n}\n\nexplorerLink(\"https://etherscan.io\", \"tx\", \"0xabc...\");          // https://etherscan.io/tx/0xabc...\nexplorerLink(\"https://etherscan.io\", \"block\", 19_000_000);       // https://etherscan.io/block/19000000\nexplorerLink(\"https://etherscan.io/\", \"address\", \"0x1234...\");   // https://etherscan.io/address/0x1234...\n```\n\nウォレットがすでに持っているチェーンのメタデータと組み合わせて使う例:\n\n```ts\nconst chain = { chainId: \"0x1\", blockExplorerUrls: [\"https://etherscan.io\"] };\nwindow.open(explorerLink(chain.blockExplorerUrls[0], \"tx\", txHash));\n```\n\n## 知っておくべきこと\n\n- **ステータス：Stagnant。** 確定はしませんでしたが、4 つのルートは多くの人気エクスプローラーが使っている事実上の慣習に一致しています。\n- この EIP が定義するのは人間向けの Web ページのルートだけで、データ API ではありません。エクスプローラーの JSON API は別物で、今も違いがあります。\n- エクスプローラーにこれらのパスに従うことを強制するものは何もないので、多くのネットワークに対応するウォレットは、エクスプローラーごとの例外処理が引き続き必要になることがあります。\n- ブロックのルートはハッシュまたは高さのどちらも受け付けます。コードは、どちらか一方を前提とせず、手元にあるほうをそのまま渡すべきです。\n"},"ko":{"lang":"ko","tldr":"블록 탐색기의 URL 경로 네 개(/block, /tx, /address, /token)를 표준화해, 지갑과 dapp이 기본 URL만 알면 어떤 체인의 탐색기에든 링크할 수 있게 한다.","tags":["block-explorer","interface","urls","wallet","ux"],"related":[3085,1193],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-3091/","markdown":"## 어떤 문제를 해결하나요?\n\n지갑과 dapp은 \"이 트랜잭션 보기\", \"이 주소 보기\"처럼 블록 탐색기로 끊임없이 링크를 겁니다. 체인이 하나이고 지배적인 탐색기도 하나이던 때는 URL 형식을 하드코딩해도 괜찮았습니다. 더 많은 체인과 레이어 2 네트워크가 등장하면서 탐색기마다 자기만의 경로를 고를 수 있게 되었고, 새 네트워크를 추가하는 지갑은 또 다른 URL 체계를 익혀야 했으며 링크가 깨지거나 엉뚱한 페이지를 가리켰습니다.\n\nEIP-3091은 공통 경로 집합에 합의함으로써 이를 해결합니다. 탐색기가 이를 따르면 지갑에 필요한 것은 탐색기의 기본 URL뿐입니다.\n\n## 어떻게 동작하나요?\n\n`https://explorer.example.org` 같은 기본 URL이 주어지면, 준수하는 탐색기는 다음을 제공합니다.\n\n| 리소스 | 경로 |\n| --- | --- |\n| 블록 | `\u003cBLOCK_EXPLORER_URL\u003e/block/\u003cBLOCK_HASH_OR_HEIGHT\u003e` |\n| 트랜잭션 | `\u003cBLOCK_EXPLORER_URL\u003e/tx/\u003cTX_HASH\u003e` |\n| 계정 | `\u003cBLOCK_EXPLORER_URL\u003e/address/\u003cACCOUNT_ADDRESS\u003e` |\n| 토큰 | `\u003cBLOCK_EXPLORER_URL\u003e/token/\u003cTOKEN_ADDRESS\u003e` |\n\n이 경로들은 대부분의 탐색기가 이미 쓰던 것에 맞춰 골랐기 때문에, 많은 탐색기가 처음부터 준수 상태였습니다. 구성이 다른 탐색기는 이 경로들을 자체 경로로 리디렉션하는 방식으로 준수할 수 있습니다.\n\n기본 URL 자체는 보통 체인 메타데이터에서 가져옵니다. 예를 들어 dapp이 `wallet_addEthereumChain`([EIP-3085](/eip-3085/))에 전달하는 `blockExplorerUrls` 필드입니다.\n\n## 샘플 코드\n\nTypeScript로 탐색기 링크 만들기:\n\n```ts\ntype Kind = \"block\" | \"tx\" | \"address\" | \"token\";\n\nexport function explorerLink(baseUrl: string, kind: Kind, id: string | number): string {\n  const base = baseUrl.replace(/\\/+$/, \"\"); // strip trailing slash\n  return `${base}/${kind}/${id}`;\n}\n\nexplorerLink(\"https://etherscan.io\", \"tx\", \"0xabc...\");          // https://etherscan.io/tx/0xabc...\nexplorerLink(\"https://etherscan.io\", \"block\", 19_000_000);       // https://etherscan.io/block/19000000\nexplorerLink(\"https://etherscan.io/\", \"address\", \"0x1234...\");   // https://etherscan.io/address/0x1234...\n```\n\n지갑이 이미 가진 체인 메타데이터와 함께 사용하기:\n\n```ts\nconst chain = { chainId: \"0x1\", blockExplorerUrls: [\"https://etherscan.io\"] };\nwindow.open(explorerLink(chain.blockExplorerUrls[0], \"tx\", txHash));\n```\n\n## 알아둘 점\n\n- **상태: Stagnant.** 확정되지는 않았지만, 네 경로는 많은 인기 탐색기가 쓰는 사실상의 관례와 일치합니다.\n- 이 EIP는 사람을 위한 웹 페이지 경로만 정의할 뿐 데이터 API가 아닙니다. 탐색기의 JSON API는 별개이며 여전히 서로 다릅니다.\n- 탐색기가 이 경로를 따르도록 강제하는 것은 아무것도 없으므로, 많은 네트워크를 지원하는 지갑은 여전히 탐색기별 예외 처리가 필요할 수 있습니다.\n- 블록 경로는 해시나 높이 중 어느 쪽이든 받습니다. 코드는 한쪽만 가정하지 말고 가지고 있는 것을 그대로 전달해야 합니다.\n"},"zh":{"lang":"zh","tldr":"规范区块浏览器的四条 URL 路径（/block、/tx、/address、/token），让钱包和 dapp 只需知道基础 URL 就能链接到任何链的浏览器。","tags":["block-explorer","interface","urls","wallet","ux"],"related":[3085,1193],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-3091/","markdown":"## 它解决什么问题？\n\n钱包和 dapp 经常要链接到区块浏览器：\"查看这笔交易\"、\"查看这个地址\"。只有一条链和一个占主导地位的浏览器时，硬编码 URL 格式没有问题。随着更多链和二层网络出现，每个浏览器都可以自选路径，添加新网络的钱包就得再学一种 URL 方案，链接会失效或指向错误的页面。\n\nEIP-3091 通过约定一组通用路由来解决这个问题。只要浏览器遵循它，钱包只需要浏览器的基础 URL。\n\n## 它如何运作\n\n给定类似 `https://explorer.example.org` 的基础 URL，合规的浏览器提供：\n\n| 资源 | 路由 |\n| --- | --- |\n| 区块 | `\u003cBLOCK_EXPLORER_URL\u003e/block/\u003cBLOCK_HASH_OR_HEIGHT\u003e` |\n| 交易 | `\u003cBLOCK_EXPLORER_URL\u003e/tx/\u003cTX_HASH\u003e` |\n| 账户 | `\u003cBLOCK_EXPLORER_URL\u003e/address/\u003cACCOUNT_ADDRESS\u003e` |\n| 代币 | `\u003cBLOCK_EXPLORER_URL\u003e/token/\u003cTOKEN_ADDRESS\u003e` |\n\n这些路径是按照大多数浏览器已有的用法选定的，所以很多浏览器一开始就是合规的。布局不同的浏览器可以通过把这些路径重定向到自己的路由来实现合规。\n\n基础 URL 本身通常来自链的元数据，例如 dapp 传给 `wallet_addEthereumChain`（[EIP-3085](/eip-3085/)）的 `blockExplorerUrls` 字段。\n\n## 示例代码\n\n用 TypeScript 构建浏览器链接：\n\n```ts\ntype Kind = \"block\" | \"tx\" | \"address\" | \"token\";\n\nexport function explorerLink(baseUrl: string, kind: Kind, id: string | number): string {\n  const base = baseUrl.replace(/\\/+$/, \"\"); // strip trailing slash\n  return `${base}/${kind}/${id}`;\n}\n\nexplorerLink(\"https://etherscan.io\", \"tx\", \"0xabc...\");          // https://etherscan.io/tx/0xabc...\nexplorerLink(\"https://etherscan.io\", \"block\", 19_000_000);       // https://etherscan.io/block/19000000\nexplorerLink(\"https://etherscan.io/\", \"address\", \"0x1234...\");   // https://etherscan.io/address/0x1234...\n```\n\n配合钱包已有的链元数据使用：\n\n```ts\nconst chain = { chainId: \"0x1\", blockExplorerUrls: [\"https://etherscan.io\"] };\nwindow.open(explorerLink(chain.blockExplorerUrls[0], \"tx\", txHash));\n```\n\n## 需要注意\n\n- **状态：Stagnant。** 它没有最终确定，但这四条路由与许多流行浏览器使用的事实惯例一致。\n- 这份 EIP 只定义了面向人类的网页路由，而不是数据 API。浏览器的 JSON API 是另一回事，而且仍然各不相同。\n- 没有任何机制强制浏览器遵循这些路径，所以支持多个网络的钱包可能仍需为个别浏览器做例外处理。\n- 区块路由既接受哈希也接受高度；你的代码应传入手头有的那个，而不要假定只用其中一种。\n"}}}
