-
Notifications
You must be signed in to change notification settings - Fork 17
docs: ENS Resolutions page #2273
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
6604d08
1aa7883
1e24a14
3164af3
c554d83
0e844fb
e8f6f0b
a562608
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| --- | ||
| title: ENS Resolution | ||
| description: Forward, reverse, and complete resolution in the Omnigraph — interpreted profiles, raw protocol records, and address-to-profile lookup in a single GraphQL query. | ||
| --- | ||
|
|
||
| import { LinkCard } from "@astrojs/starlight/components"; | ||
| import OmnigraphStaticExampleSet from "@components/organisms/OmnigraphStaticExampleSet.astro"; | ||
|
|
||
| The ENS protocol defines two forms of resolution: | ||
|
|
||
| - **Forward resolution** — given a name (`vitalik.eth`), resolve its records: avatar, bio, links, multichain addresses, and more. | ||
| - **Reverse resolution** — given an address, resolve its **primary name** on a chain ([ENSIP-19](https://docs.ens.domains/ensip/19)). | ||
|
|
||
| One of the most common patterns when building on ENS is to combine both: given an address, first perform **reverse resolution** to get the primary name, then perform **forward resolution** on that name to fetch its avatar, social handles, and other display details. Because this pattern is so common, the Omnigraph provides support for it as **complete resolution** — reverse and forward in a single query with no extra round trip. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It'd be cool to highlight the complete resolution form here. For example, we could add a heading before we share detailed description of what the complete resolution is. Just to make it really clear that the complete resolution is a major thing to know of. |
||
|
|
||
| Moreover, the Omnigraph handles the underlying protocol complexity for you — resolver contracts, coin-type encoding, inconsistent text-record keys, and avatar formats that may be URLs, IPFS paths, or NFT references — and **returns clean, structured results** for all three patterns. | ||
|
|
||
| ## Forward resolution — interpreted `profile` | ||
|
|
||
| When you have a name and need display-ready data, query `domain.resolve.profile`. This is where the Omnigraph does the heavy lifting: instead of decoding coin types, normalizing text-record keys, and chasing avatar formats yourself, you get a consumer-shaped view of the most common display fields — ready to drop into a UI or hand straight to an AI agent. | ||
|
|
||
| <OmnigraphStaticExampleSet id="domain-profile" hideBackToExamples /> | ||
|
|
||
| What you get in `resolve.profile`: | ||
|
|
||
| - **Addresses** — keyed by chain (`ethereum`, `solana`, `base`, …) in chain-native encodings. | ||
| - **Social accounts** — `{ handle, httpUrl }` pairs, ready to link. | ||
| - **Avatar and header images** — `httpUrl` values you can use directly in `<img src="…" />`, including derivation from NFT references per [ENSIP-12](https://docs.ens.domains/ensip/12). | ||
| - **Missing or invalid records** — `null`, so you can render without extra guards. | ||
|
|
||
| The same predictable shape works well for AI agents — structured fields and `null` for anything missing or invalid, without decoding resolver data in the prompt. | ||
|
|
||
| <LinkCard | ||
| title="AI/LLM Tooling 🤖" | ||
| href="/docs/integrate/ai-llm" | ||
| /> | ||
|
|
||
| ## Forward resolution — raw `records` | ||
|
|
||
| `resolve.records` returns protocol-accurate resolver data: numeric coin types, arbitrary text keys, and unparsed bytes. This is the shape you would work with if you decoded resolver storage yourself — or if you need records that `profile` does not model. | ||
|
|
||
| <OmnigraphStaticExampleSet id="domain-records" hideBackToExamples /> | ||
|
|
||
| ## Reverse resolution — `primaryName` | ||
|
|
||
| Given an address, reverse resolution answers: _what name does this address want to be known by?_ If the address has not set a primary name, the result is `null` — safe to render like any other missing field. | ||
|
|
||
| Primary names are stored linked to coin-types, but Omnigraph allows using friendly chain names like `ETHEREUM` or `BASE`. `beautified` is ready for UI rendering; `interpreted` is the stable form for lookups and links. See [Beautified Name](/docs/reference/terminology#beautified-name). | ||
|
|
||
| <OmnigraphStaticExampleSet id="account-primary-names" hideBackToExamples /> | ||
|
|
||
| ## Complete resolution | ||
|
|
||
| Complete resolution is the pattern most wallets and explorers actually implement: given an address, resolve its primary name and then immediately forward-resolve the records on that name. | ||
|
|
||
| <OmnigraphStaticExampleSet id="account-primary-name-records" hideBackToExamples /> | ||
|
|
||
| Breaking down the example above: | ||
|
|
||
| - **Start from an address** — pass any wallet address; the query looks up that account's primary name. | ||
| - **Pick a chain** — primary names are per-chain (e.g. Ethereum mainnet). Use friendly chain names like `ETHEREUM` or `BASE` instead of raw coin types. | ||
| - **Display the name** — `beautified` is ready for UI rendering; `interpreted` is the stable form for lookups and links. | ||
| - **Load the records in the same request** — avatar, bio, and social links are forward-resolved from the primary name. The response shape is the same `resolve.profile` structure from the forward resolution section above. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,6 @@ | ||
| --- | ||
| title: Account Events | ||
| description: Indexed events involving an address across ENS contracts. | ||
| sidebar: | ||
| order: 11 | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. looks like it's redundant since we define order in sidebar config already |
||
| --- | ||
|
|
||
| import OmnigraphStaticExampleSet from "@components/organisms/OmnigraphStaticExampleSet.astro"; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,7 @@ | ||
| --- | ||
| title: Account Primary Name | ||
| sidebar: | ||
| order: 10 | ||
| --- | ||
|
|
||
| import OmnigraphStaticExampleSet from "@components/organisms/OmnigraphStaticExampleSet.astro"; | ||
|
|
||
| <OmnigraphStaticExampleSet id="account-primary-name" /> | ||
| <OmnigraphStaticExampleSet id="account-primary-name-records" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to render
segments of Example's description