You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: ensips/23.md
+18-18Lines changed: 18 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
---
2
-
description: An universal entrypoint for resolving ENS names.
2
+
description: Universal entrypoint for resolving ENS names.
3
3
contributors:
4
4
- taytems.eth
5
5
- raffy.eth
@@ -8,17 +8,17 @@ ensip:
8
8
status: draft
9
9
---
10
10
11
-
# ENSIP-X: Universal Resolver
11
+
# ENSIP-23: Universal Resolver
12
12
13
13
## Abstract
14
14
15
-
This ENSIP standardizes [IUniversalResolver](#specification) (UR), an universal entrypoint for resolving ENS names. UR incorporates onchain algorithms for [ENSIP-10](./10#pseudocode), [ENSIP-19](./19#algorithm), [ENSIP-21](./21), and [ENSIP-22](./22) to reduce ENS integration complexities.
15
+
This ENSIP standardizes [IUniversalResolver](#specification) (UR), an universal entrypoint for resolving ENS names. UR incorporates onchain algorithms for [ENSIP-1: ENS](./1), [ENSIP-10: Wildcard Resolution](./10), [ENSIP-19: Multichain Primary Names](./19), [ENSIP-21: Batch Gateway](./21), and [ENSIP-22: Contract Features](./22) to reduce integration complexities.
16
16
17
17
## Motivation
18
18
19
19
The process of resolving ENS names requires multiple onchain calls and in-depth knowledge of the [latest standards](/).
20
20
21
-
Resolution has become more complex over time, especially with the introduction of [wildcard resolution](./10) and [multichain primary names](./19). ENSv2 will also introduce a new registry design and many other improvements.
21
+
Resolution has become more complex over time, especially with the introduction of wildcard resolution and multichain primary names. [ENSv2](https://ens.domains/ensv2) will also introduce a new registry design and many other improvements.
22
22
23
23
Maintaining these changes across multiple client frameworks demands significant development effort. The growth and evolution of the ENS protocol should not be constrained by the pace of client deployments or hindered by outdated libraries.
This function performs onchain [ENSIP-1 § Registry](./#registry-specification) traversal of a DNS-encoded `name`. It returns the first non-null `resolver` address, the namehash of `name` as `node`, and the `resolverOffset` into `name` that corresponds to the resolver. If no resolver is found, `resolver` is null.
107
+
This function performs onchain [registry traversal](./#registry-specification) of a DNS-encoded `name`. It returns the first non-null `resolver` address, the namehash of `name` as `node`, and the `resolverOffset` into `name` that corresponds to the resolver. If no resolver is found, `resolver` is null.
108
108
109
109
`findResolver()` does not perform any validity checks on the resolver and simply returns the value in the registry. The resolver may not be a contract or a resolver.
name =dnsEncode("sub.nick.eth") ="\x03sub\x04nick\x03eth\x00"
@@ -126,18 +126,18 @@ findResolver(name)
126
126
127
127
### resolve
128
128
129
-
This function performs ENS forward resolution using the `resolver` found by [`findResolver()`](#findresolver). It provides a standard interface for interacting [ENSIP-1](./1) and [ENSIP-10](./10) resolvers for onchain and offchain resolution. Provided a DNS-encoded `name` and ABI-encoded `data`, it returns the ABI-encoded resolver `result` and the valid `resolver` address.
129
+
This function performs forward resolution using the `resolver` found by [`findResolver()`](#findresolver). It provides a standard interface for interacting [ENSIP-1](./1) and [ENSIP-10](./10) resolvers for onchain and offchain resolution. Provided a DNS-encoded `name` and ABI-encoded `data`, it returns the ABI-encoded resolver `result` and the valid `resolver` address.
130
130
131
-
UR automatically handles wrapping calldata and unwrapping responses when interacting with an [`IExtendedResolver`](./10#pseudocode) and safely interacts with contracts deployed before [EIP-140](https://eips.ethereum.org/EIPS/eip-140).
131
+
UR automatically handles wrapping calldata and unwrapping responses when interacting with an [`IExtendedResolver`](./10#pseudocode) and safely interacts with contracts deployed before [EIP-140: REVERT Instruction](https://eips.ethereum.org/EIPS/eip-140).
* If the called function was not implemented, reverts `UnsupportedResolverProfile`.
143
143
* If the called function reverted, reverts `ResolverError`.
@@ -146,7 +146,7 @@ UR automatically handles wrapping calldata and unwrapping responses when interac
146
146
147
147
Traditionally, resolvers have been written to answer direct profile requests, eg. `addr()` returns one address. To perform multiple requests, the caller must perform multiple independent requests (in sequence, parallel, or via batched RPC) or utilize an [external multicall contract](https://www.multicall3.com/) which does not support CCIP-Read.
148
148
149
-
UR supports multicall with CCIP-Read and [`eth.ens.resolver.extended.multicall`](./22) feature. To perform multiple calls:
149
+
UR supports multicall with CCIP-Read and [`eth.ens.resolver.extended.multicall`](./22#ethensresolverextendedmulticall--0x96b62db8) feature. To perform multiple calls:
const results =decodeFunctionResult({ functionName: "multicall", data: result });
179
179
```
180
-
The same [resolution errors](#resolve-resolution-errors) apply but [resolver errors](#resolve-resolver-errors) are handled differently. The call **always succeeds** and decodes into an array of results. The number of calls is always equal to the number of results. If `results[i]` is not multiple of 32 bytes, it is an ABI-encoded error for the corresponding `calls[i]`.
180
+
The same [resolution errors](#resolution-errors) apply but [resolver errors](#resolver-errors) are handled differently. The call **always succeeds** and decodes into an array of results. The number of calls is always equal to the number of results. If `results[i]` is not multiple of 32 bytes, it is an ABI-encoded error for the corresponding `calls[i]`.
This function performs ENS primary name resolution according to [ENSIP-19](./19). Provided a [byte-encoded](./9)`lookupAddress` and desired `coinType`, it returns the verified primary `name` and the addresses of forward `resolver` and `reverseResolver`. UR supports CCIP-Read during the forward and reverse phases.
195
+
This function performs multichain primary name resolution according to [ENSIP-19](./19). Provided a [byte-encoded](./9)`lookupAddress` and desired `coinType`, it returns the verified primary `name` and the addresses of forward `resolver` and `reverseResolver`. UR supports CCIP-Read during the forward and reverse phases.
196
196
197
197
If the primary `name` is [unnormalized](./15), eg. `normalize("Nick.eth") != "nick.eth"`, then `name` and `resolver` are invalid.
198
198
199
-
* If [reverse resolution](./19#reverse-resolution) of the reverse name was not successful, reverts a [`resolve()` error](resolve-resolution-errors).
199
+
* If [reverse resolution](./19#reverse-resolution) of the reverse name was not successful, reverts a [`resolve()` error](#resolution-errors).
200
200
* If the resolved primary name was null, returns `("", address(0), <reverseResolver>)`.
201
-
* If [forward resolution](./19#forward-resolution) of the primary name was not successful, also reverts a [`resolve()` error](resolve-resolution-errors).
201
+
* If [forward resolution](./19#forward-resolution) of the primary name was not successful, also reverts a [`resolve()` error](#resolution-errors).
202
202
* If the resolved address of `coinType` doesn't equal the `lookupAddress`, reverts `ReverseAddressMismatch`.
203
203
204
204
`reverse()` is effectively (2) sequential `resolve()` calls.
@@ -231,9 +231,9 @@ It is a **complete replacement** for existing ENS resolution procedures. Client
231
231
232
232
## Security Considerations
233
233
234
-
UR uses a batch gateway to perform CCIP-Read requests. If the client does not support [ENSIP-21](./21), a trustless external batch gateway service is used which adds latency and leaks information.
234
+
UR uses a batch gateway to perform CCIP-Read requests. If the client does not support ENSIP-21, a trustless external batch gateway service is used which adds latency and leaks information.
235
235
236
-
UR is deployed as an immutable contract and as an ENS DAO-managed upgradeable proxy. The main purpose of the proxy is to facilitate a seamless transition to [ENS v2](https://ens.domains/ensv2) and track the latest standards. Client frameworks should default to the proxy so their libraries are future-proof, with the option to specify an alternative implementation.
236
+
UR is deployed as an immutable contract and as an ENS DAO-managed upgradeable proxy. The main purpose of the proxy is to facilitate a seamless transition to ENSv2 and track the latest standards. Client frameworks should default to the proxy so their libraries are future-proof, with the option to specify an alternative implementation.
0 commit comments