---
eip: 162
label: ERC-162
title: Initial ENS Hash Registrar
status: Final
type: Standards Track
category: ERC
created: 2016-10-25
official: https://eips.ethereum.org/EIPS/eip-162
source: https://github.com/ethereum/ERCs/blob/master/ERCS/erc-162.md
canonical: https://eips.huatuo.xyz/eip-162/
lang: en
tldr: Described the first .eth name registrar for ENS, which allocated names through sealed-bid Vickrey auctions with ETH locked in per-name deed contracts.
tags: [ens, naming, registrar, auction]
---

# ERC-162: Initial ENS Hash Registrar

> 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.

**TL;DR:** Described the first .eth name registrar for ENS, which allocated names through sealed-bid Vickrey auctions with ETH locked in per-name deed contracts.

## What problem does it solve?

The Ethereum Name Service ([EIP-137](/eip-137/)) maps human-readable names like `alice.eth` to addresses. ENS itself is only a registry. Someone has to decide who gets each name, and a new namespace invites a land grab, with squatters registering valuable names only to resell them.

EIP-162 documents the **Initial Registrar**, deployed to mainnet on 2017-05-04 to hand out `.eth` names. It was designed to be simple and temporary: learn from real usage for about two years, then replace it with a permanent registrar.

## How it works

**Restrictions.** Only the `.eth` top-level domain was served, and only names of 7 characters or more. Shorter names were held back for later.

**Hashed names.** You bid on `sha3(label)`, for example `sha3('abcdefg')` for `abcdefg.eth`, not the full ENS namehash. Because the registrar only sees hashes, it cannot check length itself. Anyone could call `invalidateName` with the plain text of a too-short name and earn a reward.

**Gradual release.** Names became available over 8 weeks. The first byte of a name's hash decided when.

**Vickrey auction.** Each name went through these states:

1. *Open*: anyone calls `startAuction`.
2. *Auction* (72 h): bidders send a sealed bid, `shaBid(hash, owner, value, salt)`, plus ETH. They may send more ETH than the bid to hide the real value.
3. *Reveal* (48 h): bidders call `unsealBid` with the real parameters.
4. *Owned*: the winner calls `finalizeAuction` and pays the **second-highest** bid. The minimum price is 0.01 ETH.

**Deeds.** The ETH is not paid to anyone. It is locked in a separate `Deed` contract for each bid. The winner's deed stays locked as collateral while they own the name. After one year, the owner can release the name and get the deed back. Losing bids are refunded at 99.5 %, and the rest is burned. Bids revealed too late, or never revealed, are mostly burned.

## Sample code

Computing what the registrar expects, with ethers v6:

```ts
import { keccak256, toUtf8Bytes, solidityPackedKeccak256, randomBytes, hexlify, parseEther } from "ethers";

const labelHash = keccak256(toUtf8Bytes("abcdefg"));   // the name being auctioned
const salt = hexlify(randomBytes(32));
const value = parseEther("0.5");                       // true bid

// sealed bid = sha3(hash, owner, value, salt), as returned by shaBid()
const sealedBid = solidityPackedKeccak256(
  ["bytes32", "address", "uint256", "bytes32"],
  [labelHash, myAddress, value, salt],
);
// newBid(sealedBid) with msg.value >= value, then unsealBid(...) in the reveal window
```

## Things to know

- This registrar is historical. The spec planned to replace it after about two years and to stop new auctions after four. ENS has since moved `.eth` to later registrar designs that charge a renewal fee instead of locking a deposit.
- Revealing in time mattered. A bid revealed after the reveal window was mostly burned, so it could not be used to push up a winner's price.
- For how names resolve once registered, see [EIP-137](/eip-137/). For reverse lookups from address to name, see [EIP-181](/eip-181/).


---

This is an unofficial plain-language summary. Read the full specification: https://eips.ethereum.org/EIPS/eip-162
