bitpro가 원문에서 글자만 모은 내용이에요. 표·그림·수식은 빠지거나 깨질 수 있어요. 전체 75쪽 중 33쪽
inates or properly formatted place, as it may be a non-existent location
##### `url`
**Description:** A website URL
**Format:** Any valid HTTP or HTTPS link.
**Example:** `https://ens.domains`
**Design Considerations:** This link should be clickable, and wherever possible shown at the bottom of the profile.
##### `timezone`
**Description:** A timezone
**Format:** Any timezone name from the [tz database](https://www.iana.org/time-zones). Follows `<area>/<location>[/<quantifier>]`
**Example:** `Australia/Melbourne`
**Design Considerations:** None.
##### `language`
**Description:** A language
**Format:** A two letter language code from [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes).
**Example:** `en`
**Design Considerations:** None.
##### `primary-contact`
**Description:** The record key for a primary contact
**Format:** `email`, or any existing profile service key
**Example:** `com.github`
**Design Considerations:** When resolving `primary-contact` for a profile, the value should resolve to the service (which could be logo or name) and the corresponding value. Direct links to the service should be supported on a best-effort basis (e.g. `com.github` => `https://github.com/`)
#### Global Keys
Profile Keys are a subset of Global Keys, therefore these global keys extend the existing global keys defined in ENSIP-5.
* `alias`
* `theme`
* `header`
* `timezone`
* `language`
* `primary-contact`
##### Profile Service Keys
A profile service key is a profile key derived from the root of the service's domain. E.g. `com.github`, `org.telegram`, etc.
When creating a profile service key record, the value should be **void of optional service-specific formatting** such as prefixes like `/u/` or `@`.
In the case that the value is always displayed in a certain format, the formatting may be kept. However, any parsing or processing done on said value should attempt to be compatible with values that do not have the formatting applied.
#### Image files
When **setting** an image for an avatar or header, it is **strongly recommended** to limit the file size to an absolute maximum of 10MB. The image being set should be validated against this limit, whether it is a URL, or an NFT. Ideally, if creating an image to be set on behalf of the user, the file size should be limited to 2MB. Additionally, maintainers of image endpoints should support dimensions of images to be limited via query string `?width={width}&height={height}` wherever possible.
When **retrieving** an image for an avatar or header, images should attempt to be loaded if 10MB or less in file size. Loading images above 10MB is not required, but ideally loading should still be attempted. If retrieving an image via URL, a query string can be optionally appended to the URL to limit the dimensions via `?width={width}&height={height}`. However, the query string may have no effect.
### Backwards Compatibility
The `alias` key replaces the pre-existing `name` key. When displaying an alias, you should consider also resolving the `name` key and displaying it, if `alias` is not available.
### Security Considerations
None.
### Copyright
Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/).
import { EnsipHeader } from "../../components/EnsipHeader";
## ENSIP-19: Multichain Primary Names
<EnsipHeader authors={["jefflau.eth","taytems.eth","premm.eth","nick.eth","raffy.eth","katzman.base.eth"]} created="March 14, 2023" status="final" />
### Abstract
This ENSIP standardizes [reverse](#reverse-resolution) and [primary name](#algorithm) resolution for all coin types, and defines how this resolution process operates across the [multichain Ethereum](#multichain-ethereum) ecosystem.
### Motivation
[ENSIP-1](/ensip/1) established the resolution of Ethereum addresses by name. [ENSIP-9](/ensip/9) introduced coin types and assigned the Ethereum address to a coin type. [ENSIP-11](/ensip/11) defined an algorithm to convert between chains and coin types.
[ENSIP-3](/ensip/3) established the reverse resolution process for Ethereum addresses. However, the generalization of this process for arbitrary coin types does not exist.
Since EVM-compatible chains have become the [primary scaling solution](https://ethereum.org/en/developers/docs/scaling/) for Ethereum, an Ethereum-wide default name is essential to ensure consistent identity resolution across all chains.
Additionally, because EVM-compatible chains have the same address encoding, chain-agonstic addresses—such as externally owned accounts (EoA) and deterministic deployment proxies—motivate an Ethereum-wide default address.
With the rise of [smart contract accounts](https://ethereum.org/en/developers/docs/accounts/) (SCA) and presence of different address derivation schemes, a modern ENS identity likely has multiple addresses accross the Ethereum ecosystem.
### Specification
Primary name resolution is a two-phase procedure that takes `addressBytes` and `coinType` as input, and returns no name or a verified primary name.
#### Definitions
* `addressBytes` — the target address as bytes, according to [ENSIP-9 § Address Encoding](/ensip/9#address-encoding).
* `[addressAsHex]` — prefix-free lowercase hexadecimal representation of `addressBytes`.
* eg. `0x0000ABcD` → `"0000abcd"`
* `coinType` — the target coin type, according to [ENSIP-9](/ensip/9).
* `coinType = 60` corresponds to the mainnet Ethereum address.
* L1 testnets (like Sepolia) may also use this `coinType`.
* `coinType` can be derived from a 31-bit EVM `chainId`, according to [ENSIP-11](/ensip/11).
* `chainId = 0` corresponds to the default EVM chain.
* `[coinTypeAsHex]` — prefix-free lowercase hexadecimal representation of `coinType` without leading zeros.
* equivalent to `BigInt(coinType).toString(16)` in JavaScript.
* eg. `4095` → `"fff"`
* `chainFromCoinType(coinType)`
* If `coinType = 60`, returns `1`.
* If `0x8000_0000 ≤ coinType ≤ 0xffff_ffff`, returns `coinType ^ 0x8000_0000`.
* Otherwise, returns `0`.
| Network | `coinType` | `chainFromCoinType()` | EVM |
| :-------- | --------------: | --------------------: | :-: |
| *Default* | `0x8000_0000` | `0` | ✓ |
| Ethereum | `60` | `1` | ✓ |
| Chain(2) | `0x8000_0002` | `2` | ✓ |
| Bitcoin | `0` | `0` | |
| ? | `0x1_8000_0002` | `0` | |
* `resolve(name, data)` — an [ENSIP-10](/ensip/10) implementation.
#### Algorithm
##### Reverse Resolution
1. Generate `reverseName` with `coinType` where:
| `coinType` | `reverseName` |
| ------------: | :----------------------------------------- |
| `60` | `"[addressAsHex].addr.reverse"` |
| `0x8000_0000` | `"[addressAsHex].default.reverse"` |
| `*` | `"[addressAsHex].[coinTypeAsHex].reverse"` |
2. Compute `reverseNode = namehash(reverseName)`.
3. Resolve `name = resolve(reverseName, abi.encodeCall(INameResolver.name, (reverseNode)))`.
4. If `name` is null:
* Stop and display the address.
5. If `name` is [unnormalized](/ensip/15), eg. `normalize("Nick.eth") != "Nick.eth"`:
* Stop and display the address.
6. `name` is the primary name if and only if it [resolves](#forward-resolution) to the same `addressBytes`.
##### Forward Resolution
7. Compute `node = namehash(name)`.
8. Resolve `resolvedAddress = resolve(name, callData)` where:
| `coinType` | `callData` |
| ---------: | :-------------------------------------------------------- |
| `60` | `abi.encodeCall(IAddrResolver.addr, (node))` |
| `*` | `abi.encodeCall(IAddressResolver.addr, (node, coinType))` |
9. If `resolvedAddress != addressBytes`, no primary name exists for this address.
* Stop and display the address.
10. `name` is the primary name.
#### Multichain Ethereum
A new standalone registrar contract will maintain an `address` → `name` mapping and grant accounts of the host chain the ability to manage their `name` via various trustless mechanisms.
Unlike reverse registrations in [ENSIP-3](/ensip/3), the new registrar is registry-independent and does not support custom resolvers or records.
Resolving `addr(node, coinType)` on a reverse namespace will return the address of the corresponding registrar.
##### Default Primary Name
A new registrar contract will be deployed on L1 for default names. An [ENSIP-10](/ensip/10) wildcard resolver registered at `"reverse"` will utilize the default registrar. The default resolver will intercept `"default.reverse"` and `"[coinTypeAsHex].reverse"` for every `chainFromCoinType(coinType) > 0` and lookup names when `addressAsHex` is a valid EVM address.
##### Chain-specific Primary Name
New registrars will be deployed per chain, but only those that post state to L1 (such as [rollups](https://ethereum.org/en/developers/docs/scaling/#rollups)) may have a corresponding ENSIP-10 wildcard resolver at `"[coinTypeAsHex].reverse"`.
Each resolver will trustlessly verify registrar lookups on the corresponding chain when `addressAsHex` is a valid EVM address. If no name is associated with the address, the resolver will return the default name from the default registrar.
##### Example
> The resolver for `chainId = 2` is registered at `"80000002.reverse"`.
>
> The primary name of `0xb8c2C29ee19D8307cb7255e1Cd9CbDE883A267d5` on this chain corresponds to resolving the `name()` of `"b8c2c29ee19d8307cb7255e1cd9cbde883a267d5.80000002.reverse"`.
>
> If this chain was not a rollup, the reverse name would be intercepted by the default resolver, and the primary name becomes the default name.
#### Default Address
Similar to [ENSIP-9 § Backwards Compatibility](/ensip/9/#backwards-compatibility) which states:
> the value returned by `addr(node)` from ENSIP-1 should always match the value returned `addr(node, 60)`
If `chainFromCoinType(coinType) > 0`, the value returned by `addr(node, coinType)`, when no address is stored for `coinType`, should always match the value returned by `addr(node, 0x8000_0000)`.
### Backwards Compatibility
This specification requires no modification to ENSIP-10 resolution.
Unlike the new registrar [defined above](#multichain-ethereum), the [ENSIP-3](/ensip/3/#appendix-1-registrar-implementation) registrar assigned a resolver to `"[addressAsHex].addr.reverse"`. To clear this registration, the reverse resolver must be replaced with a default-aware resolver or the resolver must be unset. An unaware resolver with an unset name will not fallback to the default name.
Most resolvers do not implement the [default address logic](#default-address) and will need redeployed. Alternatively, the same address can be set for all relevant coin types to replicate the default behavior.
#### Deprecating Reverse Name Avatars
[ENSIP-12](/ensip/12) defined avatars for reverse names, which allowed accounts to have avatars without an ENS name. Adoption of this is virtually non-existent, and ENS names are more accessible than ever before (free), which effectively removes the need for it entirely.
The reverse resolvers defined in this specification do not support `text()`.
#### Deprecating Mainnet as Default
ENS has not been explicit about how to use the mainnet address record `addr()` and it is often used as a default when a chain address is not present. Additionally, mainnet primary names have historically been used on other chains as there was no alternative.
Clients must remove all logic related to default address and name handling.
##### Example
> User A on chain C wants to transfer assets to user B, who operates a SCA on L1.
>
> 1. User A enters the mainnet address of user B.
> 2. The application verifies and displays the mainnet primary name of user B.
> 3. User A confidently executes the transfer on chain C.
>
> Due to the specifics of SCA creation, user B likely has no ability to claim the matching counterfactual address on chain C, and the assets are unrecoverable.
### Copyright
Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/).
### Supported Chains
#### Mainnet
| Network | `chainId` | `reverseNamespace` | Registrar Contract |
| :-------- | --------: | -------------------: | :--------------------------------------------------------------------------------------------------------------------------------- |
| *Default* | `0` | `"default.reverse"` | [`0x283F227c4Bd38ecE252C4Ae7ECE650B0e913f1f9`](https://etherscan.io/address/0x283F227c4Bd38ecE252C4Ae7ECE650B0e913f1f9) |
| Ethereum | `1` | `"addr.reverse"` | |
| Optimism | `10` | `"8000000a.reverse"` | [`0x0000000000D8e504002cC26E3Ec46D81971C1664`](https://optimistic.etherscan.io/address/0x0000000000D8e504002cC26E3Ec46D81971C1664) |
| Base | `8453` | `"80002105.reverse"` | [`0x0000000000D8e504002cC26E3Ec46D81971C1664`](https://basescan.org/address/0x0000000000D8e504002cC26E3Ec46D81971C1664) |
| Arbitrum | `42161` | `"8000a4b1.reverse"` | [`0x0000000000D8e504002cC26E3Ec46D81971C1664`](https://arbiscan.io/address/0x0000000000D8e504002cC26E3Ec46D81971C1664) |
| Linea | `59144` | `"8000e708.reverse"` | [`0x0000000000D8e504002cC26E3Ec46D81971C1664`](https://lineascan.build/address/0x0000000000D8e504002cC26E3Ec46D81971C1664) |
| Scroll | `534352` | `"80082750.reverse"` | [`0x0000000000D8e504002cC26E3Ec46D81971C1664`](https://scrollscan.com/address/0x0000000000D8e504002cC26E3Ec46D81971C1664) |
#### Sepolia
| Network | `chainId` | `reverseNamespace` | Registrar Contract |
| :-------- | ---------: | -------------------: | :----------------------------------------------------------------------------------------------------------------------------------------- |
| *Default* | `0` | `"default.reverse"` | [`0x4F382928805ba0e23B30cFB75fC9E848e82DFD47`](https://sepolia.etherscan.io/address/0x4F382928805ba0e23B30cFB75fC9E848e82DFD47) |
| Ethereum | `1` | `"addr.reverse"` | |
| Linea | `59141` | `"8000e705.reverse"` | [`0x00000BeEF055f7934784D6d81b6BC86665630dbA`](https://sepolia.lineascan.build/address/0x00000BeEF055f7934784D6d81b6BC86665630dbA) |
| Base | `84532` | `"80014a34.reverse"` | [`0x00000BeEF055f7934784D6d81b6BC86665630dbA`](https://sepolia.basescan.org/address/0x00000BeEF055f7934784D6d81b6BC86665630dbA) |
| Arbitrum | `421614` | `"80066eee.reverse"` | [`0x00000BeEF055f7934784D6d81b6BC86665630dbA`](https://sepolia.arbiscan.io/address/0x00000BeEF055f7934784D6d81b6BC86665630dbA) |
| Scroll | `534351` | `"8008274f.reverse"` | [`0x00000BeEF055f7934784D6d81b6BC86665630dbA`](https://sepolia.scrollscan.com/address/0x00000BeEF055f7934784D6d81b6BC86665630dbA) |
| Optimism | `11155420` | `"80aa37dc.reverse"` | [`0x00000BeEF055f7934784D6d81b6BC86665630dbA`](https://sepolia-optimistic.etherscan.io/address/0x00000BeEF055f7934784D6d81b6BC86665630dbA) |
import { EnsipHeader } from "../../components/EnsipHeader";
## ENSIP-2: Initial Hash Registrar
<EnsipHeader authors={["nick.eth","avsa.eth","maurelian"]} created="October 25, 2016" status="obsolete" />
### Abstract
This ERC describes the implementation, as deployed to the main ethereum network on 2017-05-04, of a registrar contract to govern the allocation of names in the Ethereum Name Service (ENS). The corresponding source code is [here](https://github.com/ethereum/ens/blob/mainnet/contracts/HashRegistrarSimplified.sol).
For more background, refer to ENSIP-1.
> Registrars are responsible for allocating domain names to users of the system, and are the only entities capable of updating the ENS; the owner of a node in the ENS registry is its registrar. Registrars may be contracts or externally owned accounts, though it is expected that the root and top-level registrars, at a minimum, will be implemented as contracts.
>
> \- ENSIP-1
A well designed and governed registrar is essential to the success of the ENS described in ENSIP-1, but is described separately in this document as it is external to the core ENS protocol.
In order to maximize utility and adoption of a new namespace, the registrar should mitigate speculation and "name squatting", however the best approach for mitigation is unclear. Thus an "initial" registrar is proposed, which implements a simple approach to name allocation. During the initial period, the available namespace will be significantly restricted to the `.eth` top level domain, and subdomain shorter than 7 characters in length disallowed. This specification largely describes @alexvandesande and @arachnid's [hash registrar implementation](https://github.com/ethereum/ens/blob/mainnet/contracts/HashRegistrarSimplified.sol) in order to facilitate discussion.
The intent is to replace the Initial Registrar contract with a permanent registrar contract. The Permanent Registrar will increase the available namespace, and incorporate lessons learned from the performance of the Initial Registrar. This upgrade is expected to take place within approximately 2 years of initial deployment.
### Motivation
The following factors should be considered in order to optimize for adoption of the ENS, and good governance of the Initial Registrar's namespace.
**Upgradability:** The Initial Registrar should be safely upgradeable, so that knowledge gained during its deployment can be used to replace it with an improved and permanent registrar.
**Effective allocation:** Newly released namespaces often create a land grab situation, resulting in many potentially valuable names being purchased but unused, with the hope of re-selling at a profit. This reduces the availability of the most useful names, in turn decreasing the utility of the name service to end users.
Achieving an effective allocation may or may not require human intervention for dispute resolution and other forms of curation. The Initial Registrar should not aim to create to most effective possible allocation, but instead limit the cost of misallocation in the long term.
**Security:** The registrar will hold a balance of ether without an explicit limit. It must be designed securely.
**Simplicity:** The ENS specification itself emphasizes a separation of concerns, allowing the most essential element, the registry to be as simple as possible. The interim registrar in turn should be as simple as possible while still meeting its other design goals.
**Adoption:** Successful standards become more successful due to network effects. The registrar should consider what strategies will encourage the adoption of the ENS in general, and the namespace it controls in particular.
### Specification
#### Initial restrictions
The Initial Registrar is expected to be in service for approximately two years, prior to upgrading. This should be sufficient time to learn, observe, and design an updated system.
During the initial two year period, the available name space will be restricted to the `.eth` TLD.
This restriction is enforced by the owner of the ENS root node who should not assign any nodes other than `.eth` to the Initial Registrar. The ENS's root node should be controlled by multiple parties using a multisig contract.
The Initial Registrar will also prohibit registration of names 6 characters or less in length.
#### Name format for hash registration
Names submitted to the initial registrar must be hashed using Ethereum's sha3 function. Note that the hashes submitted to the registrar are the hash of the subdomain label being registered, not the namehash as defined in ENSIP-1.
For example, in order to register `abcdefg.eth`, one should submit `sha3('abcdefg')`, not `sha3(sha3(0, 'eth'), 'abcdefg')`.
#### Auctioning names
The registrar will allocate the available names through a Vickrey auction:
> A Vickrey auction is a type of sealed-bid auction. Bidders submit written bids without knowing the bid of the other people in the auction. The highest bidder wins but the price paid is the second-highest bid. This type of auction... gives bidders an incentive to bid their true value.
>
> \- [Vickrey Auction, Wikipedia](https://en.wikipedia.org/wiki/Vickrey_auction)
The auction lifecycle of a name has 5 possible states, or Modes.
1. **Not-yet-available:** The majority of names will be init프로젝트로 돌아가기