diff --git a/docs/web/resolution.mdx b/docs/web/resolution.mdx index c2892abaa..2c767f61c 100644 --- a/docs/web/resolution.mdx +++ b/docs/web/resolution.mdx @@ -1,13 +1,14 @@ {/* * @type {import('@/lib/mdxPageProps').MdxMetaProps} */} export const meta = { - description: '', - emoji: '🔍', - contributors: [ - 'lucemans' - ] +description: 'Learn how to resolve blockchain addresses from human-readable names with ENS.', +emoji: '🔍', +contributors: [ +'lucemans', +'gskril' +] }; -# Lookup Address +# Address Lookup The ENS Protocol aims to make it easy to use Ethereum. It does this by providing a simple way to use human-readable names instead of long machine-readable addresses. @@ -95,31 +96,31 @@ alchemy.core.resolveName("vitalik.eth").then(console.log); ``` ```ts {{ variant: 'ensjs', link: 'https://github.com/ensdomains/ensjs-v3/blob/feat/viem/docs/basics/fetching-a-profile.md' }} -import { http } from 'viem' -import { mainnet } from 'viem/chains' -import { createEnsPublicClient } from '@ensdomains/ensjs' +import { http } from "viem"; +import { mainnet } from "viem/chains"; +import { createEnsPublicClient } from "@ensdomains/ensjs"; const client = createEnsPublicClient({ - chain: mainnet, - transport: http(), -}) + chain: mainnet, + transport: http(), +}); -const subgraphRecords = client.getSubgraphRecords({ name: 'ens.eth' }) +const subgraphRecords = client.getSubgraphRecords({ name: "ens.eth" }); const records = client.getRecords({ - name: 'ens.eth', - records: { - coins: [...(subgraphRecords?.coins || []), 'BTC', 'ETH', 'ETC', 'SOL'], - texts: [ - ...(subgraphRecords?.texts || []), - 'avatar', - 'email', - 'description', - ], - contentHash: true, - abi: true, - }, -}) + name: "ens.eth", + records: { + coins: [...(subgraphRecords?.coins || []), "BTC", "ETH", "ETC", "SOL"], + texts: [ + ...(subgraphRecords?.texts || []), + "avatar", + "email", + "description", + ], + contentHash: true, + abi: true, + }, +}); ``` ```python {{ variant: 'web3py' }} @@ -137,9 +138,10 @@ To learn what happens under the hood when you do a forward lookup, read the [res ## Multi-Chain Addresses (BTC, LTC, etc) {{ navtitle: 'Multi-Chain Addresses', label: 'Multi-Chain', id: 'multi-chain', tag: '', }} -ENS Names aren't just limited to storing Ethereum Addresses, -Names can be queried with any [SLIP-0044](https://github.com/satoshilabs/slips/blob/master/slip-0044.md) coin type, -meaning you can also get addresses such as BTC, LTC. In addition to the above, Ethereum Chain specific addresses can also be queried using [ENSIP-11](/ensip/11). +ENS Names aren't just limited to storing Ethereum addresses. +Any blockchain address (BTC, LTC, SOL, etc.) can be queried by [SLIP-0044](https://github.com/satoshilabs/slips/blob/master/slip-0044.md) coin type or a value derived from an EVM Chain ID (specified in [ENSIP-11](/ensip/11)). This includes Ethereum L2 networks such as OP Mainnet and Base. + +For EVM Chains, always use its [ENSIP-11](/ensip/11) coin type, irrespective of being included in SLIP-0044 (like Ether Classic). The standardization of multichain addresses was first introduced in [ENSIP-9](/ensip/9), and also [EIP-2304](https://eips.ethereum.org/EIPS/eip-2304). @@ -172,14 +174,17 @@ const btcAddress = await resolver?.getAddress(0); -| Chain / Network | ID | -| --------------- | --- | -| BTC | 0 | -| LTC | 2 | -| DOGE | 3 | -| Solana | 501 | -| Optimism | 614 | -| Polygon (Matic) | 966 | +| Network | Coin Type | +| ------------ | ---------- | +| Bitcoin | 0 | +| Litecoin | 2 | +| Dogecoin | 3 | +| Ethereum | 60 | +| Solana | 501 | +| OP Mainnet | 2147483658 | +| Polygon | 2147483785 | +| Base | 2147492101 | +| Arbitrum One | 2147525809 |