Ethereum Name Service 백서

Ethereum Name Service

원문

bitpro가 원문에서 글자만 모은 내용이에요. 표·그림·수식은 빠지거나 깨질 수 있어요. 전체 75쪽 중 35쪽

uest { bytes name; address owner; uint256 duration; bytes32 secret; address resolver; bytes extraData; } function register(RegisterRequest calldata request) external payable; ``` Parameters: * `name`: DNS-encoded name to be registered * `owner`: subdomain owner's address * `duration`: the duration in seconds of the registration * `secret`: random seed to be used for commit/reveal * `resolver`: the address of the resolver used as entrypoint on the L1 * `extraData`: any additional data (e.g. signatures from an external source) **Behavior:** * **L1 Resolver**: it MUST revert with the respective error specified by the [EIP-7884](https://ethereum-magicians.org/t/operation-router/22633). * **L2 contract / Gateway**: it MUST register the subdomain. Although implementing the `register` on the layer 1 contract is OPTIONAL given that it is already handled by the `getOperationHandler`, it is possible for the contract to implement it directly in order to expose it on its ABI. If so, it MUST revert with the same error it would if called through the `getOperationHandler`. #### Architecture Onchain subdomain registering: ```mermaid sequenceDiagram participant Client participant L1 Resolver participant L2 Contract Client->>L1 Resolver: getOperationHandler(encodedFunc) L1 Resolver-->>Client: revert OperationHandledOnchain(chainId, address) Client->>L2 Contract: registerParams(name,duration) L2 Contract-->>Client: return RegisterParams alt RegisterParams.available Client->>L2 Contract: register{value: RegisterParams.price}(RegisterRequest) end ``` Offchain subdomain registering: ```mermaid sequenceDiagram participant Client participant L1 Resolver participant Gateway participant Database Client->>L1 Resolver: getOperationHandler(encodedFunc) L1 Resolver-->>Client: revert OperationHandledOffchain(domain, url, message) rect rgb(200, 230, 255) note over Client,Database: offchain request Client->>Gateway: registerParams(name,duration) Gateway-->>Client: return RegisterParams alt RegisterParams.available Client->>Client: sign request with EIP-712 Client->>Gateway: register(RegisterRequest) Gateway->>Gateway: validate signer ownership Gateway->>Database: DB Insert end end ``` #### Commit/Reveal Process The `OffchainCommitable` interface enables a commit-reveal pattern for subdomain registration to prevent front-running attacks. This interface is OPTIONAL and should be implemented by providers who want to add this security measure to their registration process. The interface has the following functions: ```solidity function makeCommitment(RegisterRequest calldata request) external pure returns (bytes32 commitHash); function commit(bytes32 commitment) external; ``` Parameters for `makeCommitment`: * `request`: The complete registration request containing all parameters needed for registration Parameters for `commit`: * `commitment`: The hash generated by `makeCommitment` that represents the future registration request **Behavior:** * **L1 Resolver**: it MUST revert with the respective error specified by the EIP-5559. the same it would if called through the `getOperationHandler` * **L2 contract**: it MUST store the commitment and track when it was made to enforce the commit time specified in `registerParams`. #### Architecture The onchain flow would look as follows: ```mermaid sequenceDiagram participant Client participant L1 Resolver participant L2 Contract Client->>L1 Resolver: getOperationHandler(encodedFunc) L1 Resolver-->>Client: revert OperationHandledOnchain(chainId, address) Client->>L2 Contract: registerParams(name,duration) L2 Contract-->>Client: return RegisterParams alt registerParams.available alt registerParams.commitTime > 0 Client->>L2 Contract: makeCommitment(RegisterRequest) L2 Contract-->>Client: return commitment Client->>L2 Contract: commit(commitment) Client->>Client: wait for the commit time to be over end Client->>L2 Contract: register{value: registerParams.price}(RegisterRequest) end ``` #### Transfer Subdomain This interface is responsible for enabling the transfer of the domain's ownership, both the EIP-721 and within the Registry. The transfer function MUST have the following signature: ```solidity function transferFrom(bytes calldata name, address owner, address newOwner) external payable; ``` With the arguments being: 1. `node`: the ENS name DNS-encoded 2. `owner`: the address of the domain's current owner 3. `newOwner`: the Ethereum address to receive the domain The interface for enabling domain transfers MUST be implemented by the one deployed to the given L2. The one deployed to L1 is OPTIONAL for the same reason as the `register` function. **Behavior:** 1. **L1 Resolver**: it MUST revert with the respective error described by EIP-5559. 2. **L2 contract**: it MUST handle the actual domain transfer operation. #### Architecture The flow would look as follows: ```mermaid sequenceDiagram participant Client participant L1 Resolver participant L2 Contract participant L2 NameWrapper Client->>L1 Resolver: getOperationHandler(encodedFunc) L1 Resolver-->>Client: revert OperationHandledOnchain(chainId, address) Client ->>L2 Contract: address(node) L2 Contract-->>Client: return ETH address alt address different from new owner Client->>L2 Contract: setAddress(node, newOwner) end Client->>L2 Contract: transferFrom(name, owner, newOwner) alt signer is the owner L2 Contract->>L2 NameWrapper: safeTransferFrom end ``` ### Rationale The proposed interfaces standardize the management of offchain domains within the ENS ecosystem. By leveraging [EIP-7884](https://ethereum-magicians.org/t/operation-router/22633) for offchain writing and maintaining compatibility with existing ENS components, this proposal ensures a seamless integration of offchain domain management into current ENS workflows. ### Backwards Compatibility This ENSIP introduces new functionality relying on an mechanism similar to what is being used on the CCIP-Read standard making it a fully backward compatible standard. Setting multiple records should still be handled by the Resolver's `multicallWithNodeCheck` function. ### Security Considerations All the implementations MUST include appropriate access controls to ensure only authorized parties (e.g., the current owner) can modify the domains, as well as consider emitting events to log write operations for transparency and off-chain tracking. The data related to domains stored in any place other than Ethereum SHOULD be fetch through the [ENSIP-16: Offchain Metadata](https://docs.ens.domains/ensip/16) to optimize queries and provide features that wouldn't be available otherwise. #### Offchain 1. The authentication logic for domain ownership is shifted entirely to the signing step performed by the Client. Implementations MUST ensure robust signature verification to prevent unauthorized access or modifications. 2. The Gateway that receives redirected calls is responsible for ownership validation. Proper security measures MUST be implemented in the Gateway to prevent unauthorized actions. 3. The use of EIP-712 signatures for authentication provides a secure method for verifying domain ownership. However, implementers SHOULD be aware of potential signature replay attacks and implement appropriate mitigations. 4. The offchain storage of domain information introduces potential risks related to data availability and integrity. Implementers SHOULD consider redundancy and data verification mechanisms to mitigate these risks. Further security analysis and auditing are RECOMMENDED before deploying this system in a production environment, with special attention given to the unique security considerations of both onchain and offchain implementations. ### Copyright Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/). import { EnsipHeader } from "../../components/EnsipHeader"; ## ENSIP-21: Batch Gateway Offchain Lookup Protocol <EnsipHeader authors={["raffy.eth","nick.eth"]} created="March 15, 2025" status="draft" /> ### Abstract This standard establishes the Batch Gateway Offchain Lookup Protocol (BGOLP). ### Motivation [EIP-3668](https://eips.ethereum.org/EIPS/eip-3668) describes a serial `OffchainLookup` mechanism. To perform more than one `OffchainLookup`, lookups can be performed in sequence using recursive calls. This proposal standardizes an existing ENS solution, colloquially called the "Batch Gateway", utilized first by the [`UniversalResolver`](https://etherscan.io/address/0xce01f8eee7E479C928F8919abD53E553a36CeF67#code). It is effectively [`Promise.allSettled()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/allSettled) for `OffchainLookup` reverts. ### Specification The BGOLP has the following Solidity interface: ```solidity /// @dev Interface selector: `0xa780bab6` interface IBatchGateway { /// @notice An HTTP error occurred. /// @dev Error selector: `0x01800152` error HttpError(uint16 status, string message); /// @dev Information extracted from an `OffchainLookup` revert. struct Request { address sender; // same as `OffchainLookup.sender` string[] urls; // same as `OffchainLookup.urls` bytes data; // same as `OffchainLookup.callData` } /// @notice Perform multiple `OffchainLookup` in parallel. /// @notice Callers should enable EIP-3668. /// @param requests The array of requests to lookup in parallel. /// @return failures The failure status of the corresponding request. /// @return responses The response or error data of the corresponding request. function query( Request[] memory requests ) external view returns (bool[] memory failures, bytes[] memory responses); } ``` 1. Given an array of `OffchainLookup` reverts, transform each error into a `Request`. 2. Revert `OffchainLookup` with `abi.encodeCall(IBatchedGateway.query, (requests))` as the calldata. * The reverter must supply its own BGOLP gateway(s). * `x-batch-gateway:true` is defined as a special-purpose URL, which indicates an EIP-3668 client may substitute a local BGOLP implementation. If present, the client should always use the local gateway and ignore the other options. All compliant BGOLP gateways are **equivalent**. 3. Upon receiving the callback, decode the response, and propagate the inner callbacks accordingly. It is the developers responsibility to continue the EIP-3668 process. #### Batch Gateway Response * The length of `failures` and `responses` must equal the number of `requests`. * `failures[i]` is `false` if a response was received according to EIP-3668, even if it was error data. * `failures[i]` is `true` if the request could not be completed. * If a HTTP error is encountered, encode the response using `HttpError`. * Otherwise, encode the reason with `Error(string)`. * `responses[i]` is the response or error data. ### Rationale This standard is a prerequisite for local BGOLP implementations in client frameworks. A local BGOLP gateway is a privacy and latency improvement. ### Backwards Compatibility The `UniversalResolver` is the only known contract that uses the BGOLP. Its design permits client-supplied gateways. In nearly all implementations, clients are using the default. ### Security Considerations A local BGOLP gateway is **always preferable** as an external gateway leaks information and adds latency. BGOLP gateways **should curtail the maximum number of simultaneous requests** in aggregate and per host to avoid DDOS attacks. BGOLP gateways **should not be trusted**. Each individual `OffchainLookup` must secure its own protocol. ### Copyright Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/). ### Annex: Fault Tolerance To perform an `OffchainLookup` that does not terminate unexpectedly, a single lookup with `n` gateways can be transformed into a BGOLP lookup with `n` requests, each with a single gateway. In exchange for fault tolerance, the response time will match the slowest gateway and successful responses will be replicated. ### Annex: Tunneling To perform an `OffchainLookup` on a website which is using [Content Security Policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/CSP) (CSP), implement the following logic: * Add a trusted [external](#external-batch-gateways) batch gateway to CSP header * Rewrite `OffchainLookup` reverts using `x-batch-gateway:true` directly to the external batch gateway * Rewrite all other `OffchainLookup` reverts to the external batch gateway, wrapped as a batch of one (and unwrapped on response) This is essentially the inverse of this [specification](#specification) — instead of handling batch requests locally, <u>ALL</u> requests are routed to the external batch gateway and no fetches are performed locally on untrusted domains. ##### Example: viem ```ts import {createPublicClient, ccipReadTunnel} from 'viem'; const client = createPublicClient({ ccipRead: ccipReadTunnel(["https://<external-batch-gateway>" ...]), ... }); ``` ### External Batch Gateways * `https://ccip-v3.ens.xyz/` — operated by ENS Labs import { EnsipHeader } from "../../components/EnsipHeader"; ## ENSIP-22: Contract Features <EnsipHeader authors={["raffy.eth"]} created="July 29, 2025" status="draft" /> ### Abstract This ENSIP standardizes [ERC-7996](https://eips.ethereum.org/EIPS/eip-7996) contract features relevant to ENS, enabling new optimizations while preserving compatibility with existing deployments. ### Motivation ENS has maintained backwards compatibility with contracts created in 2016 through extensive use of [ERC-165](https://eips.ethereum.org/EIPS/eip-165). Unfortunately, not all contract capabilities can be expressed through an unique interface. Features allow expression of contract capabilities that preserve existing interfaces. This proposal standardizes features related to the ENS protocol. ### Specification Contract features are defined in [ERC-7996](https://eips.ethereum.org/EIPS/eip-7996). EIP-7996 has the following Solidity interface: ```solidity /// @dev Interface selector: `0x582de3e7` interface IERC7996 { /// @notice Check if a feature is supported. /// @param featureId The feature identifier. /// @return `true` if the feature is supported by the contract. function supportsFeature(bytes4 featureId) external view returns (bool); } ``` #### Resolver with Features Any resolver that supports features must adhere to the following criteria: * If the resolver utilizes [EIP-3668](https://eips.ethereum.org/EIPS/eip-3668) (CCIP-Read), it must support [recursive calls](https://eips.ethereum.org/EIPS/eip-3668#recursive-calls-in-ccip-aware-contracts) and its gateway must support [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/CORS). * The resolver must be compiled with [EIP-140](https://eips.ethereum.org/EIPS/eip-140) support. Therefore, when resolution calldata is not a `multicall`, the resolver may be invoked directly without [batch gateway](./21) infrastructure. ```solidity function supportsInterface( bytes4 interfaceId ) public view virtual override(ERC165) returns (bool) { return type(IERC7996).interfaceId == interfaceId || super.supportsInterface(interfaceId); } function supportsFeature( bytes4 featureId ) external pure returns (bool) { return false; } ``` #### eth.ens.resolver.extended.multicall — `0x96b62db8` If a resolver is an [`IExtendedResolver`](./10) and supports this feature, `resolve(name, data)` must handle `multicall(bytes[])` as expected. For resolvers that utilize CCIP-Read, this feature permits a single `OffchainLookup` request to fetch multiple records, which greatly reduces latency and network traffic. A resolver with this feature may always be invoked directly without batch gateway infrastructure. ```solidity function supportsFeature( bytes4 featureId ) external pure returns (bool) { return featureId == 0x96b62db8; } ``` ### Backwards Compatibility Callers unaware of features or any specific feature experience no change in behavior. ### Security Considerations As stated in ERC-7996, declaring support for a feature does not guarantee that the contract implements it. ### Copyright Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/). import { EnsipHeader } from "../../components/EnsipHeader"; ## ENSIP-23: Universal Resolver <EnsipHeader authors={["taytems.eth","raffy.eth"]} created="October 14, 2024" status="draft" /> ### Abstract 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. ### Motivation The process of resolving ENS names requires multiple onchain calls and in-depth knowledge of the [latest standards](/). 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. 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. UR offers a standard entrypoint for client frameworks to perform ENS resolution. It lifts many algorithms out of client frameworks and puts them onchain for transparency and security. This ENSIP standardizes an interface for [forward](#resolve) and [primary name](#reverse) resolution. ### Specification UR has the following Solidity [interface](https://github.com/ensdomains/ens-contracts/blob/20e34971fd55f9e3b3cf4a5825d52e1504d36493/contracts/universalResolver/IUniversalResolver.sol): ```solidity /// @dev Interface selector: `0xcd191b34` interface IUniversalResolver { /// @notice A resolver could not be found for the supplied name. /// @dev Error selector: `0x77209fe8` error ResolverNotFound(bytes name); /// @notice The resolver is not a contract. /// @dev Error selector: `0x1e9535f2` error ResolverNotContract(bytes name, address resolver); /// @notice The resolver did not respond. /// @dev Error selector: `0x7b1c461b` error UnsupportedResolverProfile(bytes4 selector); /// @notice The resolver returned an error. /// @dev Error selector: `0x95c0c752` error ResolverError(bytes errorData); /// @notice The resolved address from reverse resolution does not match the supplied address. /// @dev Error selector: `0xef9c03ce` error ReverseAddressMismatch(string primary, bytes primaryAddress); /// @notice An HTTP error occurred on a resolving gateway. /// @dev Error selector: `0x01800152` error HttpError(uint16 status, string message); /// @notice Find the resolver address for `name`. /// Does not perform any validity checks on the resolver. /// @param name The name to search. /// @return resolver The found resolver, or null if not found. /// @return node The namehash of `name`. /// @return resolverOffset The offset into `name` corresponding to `resolver`. function findResolver( bytes memory name ) external view returns (address resolver, bytes32 node, uint256 resolverOffset); /// @notice Performs ENS forward resolution for the supplied name and data. /// Caller should enable EIP-3668. /// @param name The DNS-encoded name to resolve. /// @param data The ABI-encoded resolver calldata. /// For a multicall, encode as `multicall(bytes[])`. /// @return result The ABI-encoded response for the calldata. /// For a multicall, the results are encoded as `(bytes[])`. /// @return resolver The resolver that was used to resolve the name. function resolve( by
프로젝트로 돌아가기