# Registration Steps (ENSRegistrarController)

## 1. Commit Reveal Process

The ENSRegistrarController uses a commit-reveal scheme to prevent front-running. Here’s how to perform the commit and reveal process:

**1.1. Make Commitment**

First, generate a commitment hash using the makeCommitment function. This hash is opaque and is revealed during the registration process.

`Function:`

`function makeCommitment(`\
&#x20;   `string memory name,`\
&#x20;   `address owner,`\
&#x20;   `uint256 duration,`\
&#x20;   `bytes32 secret,`\
&#x20;   `address resolver,`\
&#x20;   `bytes[] memory data,`\
&#x20;   `bool reverseRecord,`\
&#x20;   `uint16 ownerControlledFuses`\
`) public pure returns (bytes32)`

`Example:`

`makeCommitment(`\
&#x20;   `"myname",                // Domain label`\
&#x20;   `0x1234567890abcdef,      // Owner address`\
&#x20;   `31536000,                // Duration (1 year in seconds)`\
&#x20;   `0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890, // Secret (32 bytes)`\
&#x20;   `0x1234567890abcdef,      // Resolver address`\
&#x20;   `[],                      // Data`\
&#x20;   `false,                   // Set as primary name`\
&#x20;   `0                        // Owner-controlled fuses`\
`);`

&#x20;

**1.2. Commit**

Once you have the commitment hash, call the commit function.

`Function:`

`function commit(bytes32 commitment) public`

`Example:`

`commit(0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890);`

Notes:\
\- This requires an on-chain transaction.\
\- Wait at least MIN\_COMMITMENT\_AGE (\~60 seconds) before proceeding to register.

## 2. Register Domain

After the commitment period, you can proceed to register your domain.

**2.1. Register**

Ensure the domain name is available and meets the duration requirement. The actual duration is set to 584,554 years, but the input duration must be more than 28 days for validation. It should contain the same informations inputed during make commitment.

Make sure to approve an allowance of 100 ecld/etny to the controller address before registering, otherwise, the transfer will not be possible.

Function:

`function register(`\
&#x20;   `string memory name,`\
&#x20;   `address owner,`\
&#x20;   `uint256 duration,`\
&#x20;   `bytes32 secret,`\
&#x20;   `address resolver,`\
&#x20;   `bytes[] memory data,`\
&#x20;   `bool reverseRecord,`\
&#x20;   `uint16 ownerControlledFuses`\
`) public payable`

`Example:`

`register(`\
&#x20;   `"myname",                // Domain label`\
&#x20;   `0x1234567890abcdef,      // Owner address`\
&#x20;   `31536000,                // Duration (1 year in seconds)`\
&#x20;   `0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890, // Secret (32 bytes)`\
&#x20;   `0x1234567890abcdef,      // Resolver address`\
&#x20;   `[],                      // Data`\
&#x20;   `false,                   // Set as primary name`\
&#x20;   `0                        // Owner-controlled fuses`\
`);`

Notes:\
\- Ensure the domain is available: available(name) == true.\
\- Input duration must be >= MIN\_REGISTRATION\_DURATION (28 days).\
\- Commitments must be between 1 minute and 24 hours old.\
\- The cost is fixed at 100 ECLD/ETNY.

## 3. Transfer NFT Token using NameWrapper

Once the domain is registered, you may need to transfer the NFT token associated with the domain to your account.

`Function:`

`function safeTransferFrom(`\
&#x20;   `address from,`\
&#x20;   `address to,`\
&#x20;   `uint256 tokenId`\
`) public`

`Example:`

`transferFrom(`\
&#x20;   `0xOriginalOwner,        // Current owner's address`\
&#x20;   `0xNewOwner,             // New owner's address`\
&#x20;   `123456                  // Token ID of the domain`\
`);`


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ethernity.cloud/ens-domain-registration/registration-steps-ensregistrarcontroller.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
