EIP-3091 Block explorer API paths (Block Explorer API Routes)
No call decision · Other · EIP status Stagnant · created 2020-11-02
A proposal to standardize the URL path format block explorers use to point to block, transaction, account, and token pages, so wallets and apps can connect to any chain's explorer the same way.
Why it is needed
When users want to see more detail about a transaction, block, account, or token, wallets and dapps show links that connect to block explorer pages. However, the URL format of these links differs from explorer to explorer. As more chains and layer 2s (L2s) proliferate beyond Ethereum mainnet, wallet and app developers must separately investigate the URL rules of the explorer used by each chain and add code for it whenever they support a new chain. As a result, the maintenance burden grows as chains multiply, and the user experience becomes less consistent. This EIP proposes standardizing the URL paths that point to blocks, transactions, accounts, and tokens to reduce this inconvenience.
What changes
Today
- The URL paths pointing to blocks, transactions, accounts, and tokens differ from explorer to explorer.
- For wallets and apps to support a new chain or layer 2, they must separately investigate that explorer's URL rules.
After EIP-3091
- The paths are unified: blocks use /block/<hash or height>, transactions use /tx/<hash>, accounts use /address/<address>, and tokens use /token/<token address>.
- Explorers that used different paths previously can support this format by adding redirects.
Who is affected
- Wallet & app developers: Connections can be made via common path rules instead of managing each chain's explorer URLs separately.
- Block explorer operators: If the existing path differs, this standard can be supported by adding a redirect.
- Users: No matter which chain's explorer is used, block, transaction, account, and token information can be found in a similar way.
In depth
Why standardization is needed
Wallets and dapps frequently show links that connect transactions or accounts to block explorer web pages. However, as chains and layer 2 solutions proliferate, URL paths differ from explorer to explorer, making it hard to maintain a consistent user experience. Each time support for a new chain or layer 2 is added, the work becomes harder because that explorer's endpoint rules differ. This EIP proposes standardizing block explorer API paths to improve interoperability between wallets and explorers.
The four path specifications
The source defines the path format block explorers should follow for four data types. Blocks use <BLOCK_EXPLORER_URL>/block/<BLOCK_HASH_OR_HEIGHT>, transactions use <BLOCK_EXPLORER_URL>/tx/<TX_HASH>, accounts use <BLOCK_EXPLORER_URL>/address/<ACCOUNT_ADDRESS>, and tokens use <BLOCK_EXPLORER_URL>/token/<TOKEN_ADDRESS>. For blocks, either hash or height can be used as the identifier.
Why these paths were chosen
The source gives as the basis for choosing these four paths that most existing block explorers already use a similar format, giving high compatibility. Rather than creating an entirely new rule, it adopts the pattern currently most widely used as the standard.
How existing explorers can apply this
A block explorer already using a different URL structure can support the standard without immediately changing its existing paths, by redirecting requests that come in on the paths defined by this EIP to its own existing pages.
Security considerations
The source does not specify separate security considerations, stating only 'None.' This proposal concerns URL path naming conventions and does not change protocol or consensus logic.
Current status
This EIP's status is marked Stagnant, so it is not currently being actively discussed or progressed. The call records referenced contain no decisions or debate surrounding this proposal.