bitpro가 원문에서 글자만 모은 내용이에요. 표·그림·수식은 빠지거나 깨질 수 있어요. 전체 75쪽 중 34쪽
ially unavailable for auction, and will become available some time during the 8 weeks after launch.
2. **Open:** The earliest availability for a name is determined by the most significant byte of its sha3 hash. `0x00` would become available immediately, `0xFF` would become available after 8 weeks, and the availability of other names is distributed accordingly. Once a name is available, it is possible to start an auction on it.
3. **Auction:** Once the auction for a name has begun, there is a 72 hour bidding period. Bidders must submit a payment of ether, along with sealed bids as a hash of `sha3(bytes32 hash, address owner, uint value, bytes32 salt)`. The bidder may obfuscate the true bid value by sending a greater amount of ether.
4. **Reveal:** After the bidding period, a 48 hour reveal period commences. During this time, bidders must reveal the true parameters of their sealed bid. As bids are revealed, ether payments are returned according to the schedule of "refund ratios" outlined in the table below. If no bids are revealed, the name will return to the Open state.
5. **Owned:** After the reveal period has finished, the winning bidder must submit a transaction to finalize the auction, which then calls the ENS's `setSubnodeOwner` function, recording the winning bidder's address as the owner of the hash of the name.
The following table outlines important parameters which define the Registrar's auction mechanism.
**Registrar Parameters**
| Name | Description | Value |
| ------------------ | --------------------------------------------------------------------------------------------------- | ---------- |
| totalAuctionLength | The full time period from start of auction to end of the reveal period. | 5 days |
| revealPeriod | The length of the time period during which bidding is no longer allowed, and bids must be revealed. | 48 hours |
| launchLength | The time period during which all names will become available for auction. | 8 weeks |
| minPrice | The minimum amount of ether which must be locked up in exchange for ownership of a name. | 0.01 ether |
#### Deeds
The Initial Registrar contract does not hold a balance itself. All ether sent to the Registrar will be held in a separate `Deed` contracts. A deed contract is first created and funded when a sealed bid is submitted. After an auction is completed and a hash is registered, the deed for the winning bid is held in exchange for ownership of the hash. Non-winning bids are refunded.
A deed for an owned name may be transferred to another account by its owner, thus transferring ownership and control of the name.
After 1 year of registration, the owner of a hash may choose to relinquish ownership and have the value of the deed returned to them.
Deeds for non-winning bids can be closed by various methods, at which time any ether held will either be returned to the bidder, burnt, or sent to someone else as a reward for actions which help the registrar.
The following table outlines what portion of the balance held in a deed contract will be returned upon closure, and to whom. The remaining balance will be burnt.
**Refund schedule**
| Reason for Deed closure | Refund Recipient | Refund Percentage |
| ------------------------------------------------------ | ---------------- | ----------------- |
| A valid non-winning bid is revealed. | Bidder | 99.5% |
| A bid submitted after the auction period is revealed. | Bidder | 99.5% |
| An otherwise valid bid is revealed on an owned name. 1 | Bidder | 0.5% |
| An expired sealed bid is cancelled. 2 | Canceler | 0.5% |
| A registered hash is reported as invalid. 3 | Reporter | 50% |
| A registered hash is reported as invalid. 3 | Owner | 50% |
**Notes:**
1. This incentivizes all bids to be revealed in time. If bids could be revealed late, an extortion attack on the current highest bidder could be made by threatening to reveal a new second highest bid.
2. A bid which remains sealed after more than 2 weeks and 5 days may be cancelled by anyone to collect a small reward.
3. Since names are hashed before auctioning and registration, the Initial Registrar is unable to enforce character length restrictions independently. A reward is therefore provided for reporting invalid names.
#### Deployment and Upgrade process
The Initial Registrar requires the ENS's address as a constructor, and should be deployed after the ENS. The multisig account owning the root node in the ENS should then set the Initial Registrar's address as owner of the `eth` node.
The Initial Registrar is expected to be replaced by a Permanent Registrar approximately 2 years after deployment. The following process should be used for the upgrade:
1. The Permanent Registrar contract will be deployed.
2. The multisig account owning the root node in the ENS will assign ownership of the `.eth` node to the Permanent Registrar.
3. Owners of hashes in the Initial Registrar will be responsible for registering their deeds to the Permanent Registrar. A couple options are considered here:
1. Require owners to transfer their ownership prior to a cutoff date in order to maintain ownership and/or continue name resolution services.
2. Have the Permanent Registrar query the Initial Registrar for ownership if it is lacking an entry.
#### Planned deactivation
In order to limit dependence on the Initial Registrar, new auctions will stop after 4 years, and all ether held in deeds after 8 years will become unreachable.
#### Registrar Interface
`function state(bytes32 _hash) constant returns (Mode)`
* Implements a state machine returning the current state of a name
`function entries(bytes32 _hash) constant returns (Mode, address, uint, uint, uint)`
* Returns the following information regarding a registered name:
* state
* deed address
* registration date
* balance of the deed
* highest value bid at auction
`function getAllowedTime(bytes32 _hash) constant returns (uint timestamp)`
* Returns the time at which the hash will no longer be in the initial `not-yet-available` state.
`function isAllowed(bytes32 _hash, uint _timestamp) constant returns (bool allowed)`
* Takes a hash and a time, returns true if and only if it has passed the initial `not-yet-available` state.
`function startAuction(bytes32 _hash);`
* Moves the state of a hash from Open to Auction. Throws if state is not Open.
`function startAuctions(bytes32[] _hashes);`
* Starts multiple auctions on an array of hashes. This enables someone to open up an auction for a number of dummy hashes when they are only really interested in bidding for one. This will increase the cost for an attacker to simply bid blindly on all new auctions. Dummy auctions that are open but not bid on are closed after a week.
`function shaBid(bytes32 hash, address owner, uint value, bytes32 salt) constant returns (bytes32 sealedBid);`
* Takes the parameters of a bid, and returns the sealedBid hash value required to participate in the bidding for an auction. This obfuscates the parameters in order to mimic the mechanics of placing a bid in an envelope.
`function newBid(bytes32 sealedBid);`
* Bids are sent by sending a message to the main contract with a sealedBid hash and an amount of ether. The hash contains information about the bid, including the bidded name hash, the bid value, and a random salt. Bids are not tied to any one auction until they are revealed. The value of the bid itself can be masqueraded by sending more than the value of your actual bid. This is followed by a 48h reveal period. Bids revealed after this period will be burned and the ether unrecoverable. Since this is an auction, it is expected that most public hashes, like known domains and common dictionary words, will have multiple bidders pushing the price up.
`function startAuctionsAndBid(bytes32[] hashes, bytes32 sealedBid)`
* A utility function allowing a call to `startAuctions` followed by `newBid` in a single transaction.
`function unsealBid(bytes32 _hash, address _owner, uint _value, bytes32 _salt);`
* Once the bidding period is completed, there is a reveal period during with the properties of a bid are submitted to reveal them. The registrar hashes these properties using the `shaBid()` function above to verify that they match a pre-existing sealed bid. If the unsealedBid is the new best bid, the old best bid is returned to its bidder.
`function cancelBid(bytes32 seal);`
* Cancels an unrevealed bid according to the rules described in the notes on the refund schedule above.
`function finalizeAuction(bytes32 _hash);`
After the registration date has passed, this function can be called to finalize the auction, which then calls the ENS function `setSubnodeOwner()` updating the ENS record to set the winning bidder as owner of the node.
`function transfer(bytes32 _hash, address newOwner);`
* Update the owner of the ENS node corresponding to the submitted hash to a new owner. This function must be callable only by the current owner.
`function releaseDeed(bytes32 _hash);`
* After some time, the owner can release the property and get their ether back.
`function invalidateName(string unhashedName);`
* Since registration is done on the hash of a name, the registrar itself cannot validate names. This function can be used to report a name which is 6 characters long or less. If it has been registered, the submitter will earn 10% of the deed value. We are purposefully handicapping the simplified registrar as a way to force it into being restructured in a few years.
`function eraseNode(bytes32[] labels)`
* Allows anyone to delete the owner and resolver records for a subdomain of a name that is not currently owned in the registrar. For instance, to zero `foo.bar.eth` on a registrar that owns `.eth`, pass an array containing `[sha3('foo'), sha3('bar')]`.
`function transferRegistrars(bytes32 _hash) onlyOwner(_hash);`
* Used during the upgrade process to a permanent registrar. If this registrar is no longer the owner of the root node in the ENS, this function will transfer the deed to the current owner, which should be a new registrar. This function throws if this registrar still owns its root node.
### Rationale
#### Starting with a temporary registrar
Anticipating and designing for all the potential issues of name allocation names is unlikely to succeed. This approach chooses not to be concerned with getting it perfect, but allows us to observe and learn with training wheels on, and implement improvements before expanding the available namespace to shorter names or another TLD.
#### Valid names >= 7 characters
Preserving the shortest, and often most valuable, domain names for the upgraded registrar provides the opportunity to implement processes for dispute resolution (assuming they are found to be necessary).
#### Delayed release of names
A slower release allows for extra time to identify, and address any issues which may arise after launch.
#### Restricting TLD to `.eth`
Choosing a single TLD helps to maximize network effects by focusing on one namespace.
A three letter TLD is a pattern made familiar by it's common usage in internet domain names. This familiarity significantly increases the potential of the ENS to be integrated into pre-existing DNS systems, and reserved as a [special-use domain name](https://www.iana.org/assignments/special-use-domain-names/special-use-domain-names.xhtml#special-use-domain). A recent precedent for this is the [reservation of the `.onion` domain](https://tools.ietf.org/html/rfc7686).
#### Holding ether as collateral
This approach is simpler than the familiar model of requiring owners to make recurring payments to retain ownership of a domain name. It also makes the initial registrar a revenue neutral service.
### Prior work
This document borrows heavily from several sources:
* ENSIP-1 outlines the initial implementation of the Registry Contract (ENS.sol) and associated Resolver contracts.
* [ERC-26](https://github.com/ethereum/EIPs/issues/26) was the first ERC to propose a name service at the contract layer
* @alexvandesande's current implementation of the [HashRegistrar](https://github.com/ethereum/ens/blob/mainnet/contracts/HashRegistrarSimplified.sol)
#### Edits:
* 2016-10-26 Added link Alex's design in abstract
* 2016-11-01 change 'Planned deactivation' to h3'
* 2017-03-13 Update timelines for bidding and reveal periods
### Copyright
Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/).
import { EnsipHeader } from "../../components/EnsipHeader";
## ENSIP-20: Wildcard Writing
<EnsipHeader authors={["netto.eth","pikonha.eth","nick.eth"]} created="August 14, 2024" status="draft" />
### Abstract
This ENSIP proposes a standardized mechanism for managing offchain domains within the Ethereum Name Service (ENS) ecosystem. It addresses the growing trend of storing domains off the Ethereum blockchain to reduce transaction fees while maintaining compatibility with existing ENS components. The proposal outlines methods for domain registration, transferring, and setting records, ensuring a consistent approach to offchain domain management.
### Motivation
With the acceptance of CCIP-Read by the Ethereum community, there has been a notable shift towards storing domains in locations other than the Ethereum blockchain to avoid high transaction fees. This shift has revealed a significant gap: the lack of standardized methods for managing offchain domains. By establishing a standardized offchain resolver implementation and user flow, we can ensure a consistent approach enabling applications that support this ENSIP flow to integrate this feature and enhance user experience seamlessly, increasing scalability, providing cost-effective solutions, and reducing client complexity by providing a common way to interact with all the offchain providers.
### Specification
This ENSIP relies on the following standards:
* [ERC-712](https://eips.ethereum.org/EIPS/eip-712) Typed structured data
* [EIP-7884](https://ercs.ethereum.org/ERCS/erc-7884) Operation Router
* [EIP-7528](https://eips.ethereum.org/EIPS/eip-7528) Token Standard for Fungible Gas
#### Wildcard Writing interface
The Wildcard Writing standard is defined by multiple interfaces, which, except for the OffchainRegister, are optional according to the provider's needs.
```solidity
/// @notice The details of a registration request.
/// @param name The DNS-encoded name being registered (e.g. "alice.eth", "alice.bob.eth")
/// @param owner The address that will own the registered name
/// @param duration The length of time in seconds to register the name for
/// @param secret The secret to be used for the registration based on commit/reveal
/// @param resolver The address of the resolver used as entrypoint on the L1
/// @param extraData Additional registration data encoded as bytes
struct RegisterRequest {
bytes name;
address owner;
uint256 duration;
bytes32 secret;
address resolver;
bytes extraData;
}
interface OffchainRegister {
/// @notice Struct containing registration parameters for a name
/// @param price The total price in wei required to register the name
/// @param available Whether the name is available for registration
/// @param token Token address (ERC-7528 ether address or ERC-20 contract)
/// @param commitTime The commit duration in seconds
/// @param extraData Additional registration data encoded as bytes
struct RegisterParams {
uint256 price;
bool available;
address token;
uint256 commitTime;
bytes extraData;
}
/// @notice Returns the registration parameters for a given name and duration
/// @dev This function calculates and returns the registration parameters needed to register a name
/// @param name The DNS-encoded name to query for registration parameters (e.g. "alice.eth", "alice.bob.eth")
/// @param duration The duration in seconds for which the name should be registered
/// @return A struct containing the registration parameters
function registerParams(
bytes calldata name,
uint256 duration
)
external
view
returns (RegisterParams memory);
/// @notice Registers a domain name
/// @param request The registration request details
/// @dev Forwards the registration request to the L2 contracts for processing
function register(RegisterRequest calldata request) external payable;
}
interface OffchainTransferrable {
/// @notice Transfers ownership of a name to a new address
/// @param name The DNS-encoded name to transfer (e.g. "alice.eth", "alice.bob.eth")
/// @param owner The current owner of the name
/// @param newOwner The address to transfer ownership to
function transferFrom(
bytes calldata name,
address owner,
address newOwner
)
external;
}
interface OffchainCommitable {
/// @notice Produces the commit hash from the register request
/// @param request The registration request details
/// @return commitHash The hash that should be committed before registration
function makeCommitment(RegisterRequest calldata request)
external
pure
returns (bytes32 commitHash);
/// @notice Commits a hash of registration data to prevent frontrunning
/// @param commitment The hash of the registration request data that will be used in a future register call
/// @dev The commitment must be revealed after the minimum commit age and before the maximum commit age
function commit(bytes32 commitment) external;
}
```
#### Client flow
It relies on the approach specified by the [EIP-7884](https://ethereum-magicians.org/t/operation-router/22633) to first gather the required data for the subsequent transaction to be made directly to the given entity, a contract or an offchain gateway.
The onchain flow is composite as follows:
```mermaid
sequenceDiagram
Note over Client: calldata = encode(setText(node, key, value))
rect rgb(220, 240, 220)
Note over Client,L1Resolver: view call
Client ->> L1Resolver: getOperationHandler(calldata)
L1Resolver -->> Client: revert OperationHandledOnchain(chainId, address)
end
Client ->> L2Resolver: setText(node, key, value)
```
The offchain version of this flow looks like the following:
```mermaid
sequenceDiagram
Note over Client: calldata = encode(setText(node, key, value))
rect rgb(220, 240, 220)
Note over Client,L1 Contract: view call
Client ->> L1 Contract: getOperationHandler(calldata)
L1 Contract -->> Client: revert OperationHandledOffchain(sender, url, data)
end
Client ->> Client: EIP-712 signature
rect rgb(220, 220, 240)
Note over Client,Gateway: off-chain
Client->>Gateway: POST url {sender, data, signature}
Gateway->>Gateway: Verify EIP-712 signature
Gateway->>Gateway: Process mutation
Gateway -->> Client: response
end
```
These flows can be optimized by relying on the ENS' Universal Resolver ENSIP-10 `resolve` implementation reducing the number of RPC requests.
#### Subdomain registering
As the initial step in registering a subdomain, the `registerParams` function has been implemented to support a variety of use cases. This function plays a crucial role in creating a flexible and extensible offchain subdomain registration system.
The function has the following signature:
```solidity
struct RegisterParams {
uint256 price;
bool available;
address token;
uint256 commitTime;
bytes extraData;
}
function registerParams(
bytes memory name,
uint256 duration
)
external
view
returns (RegisterParams memory);
```
Parameters:
* `name`: DNS-encoded name to be registered
* `duration`: The duration in seconds for the registration
Return:
* `price`: the amount of ETH charged per second
* `available`: whether the domain is available for registering
* `token`: ERC-20 token address to be used as payment according to the EIP-7528
* `commitTime`: the amount of seconds the commit should wait before being revealed. `0` means that the commit/reveal pattern isn't being used
* `extraData`: any given encoded data
The register function MUST have the following signature:
```solidity
struct RegisterReq프로젝트로 돌아가기