Registration

Registering a page takes two transactions with a short wait between them. The wait is what makes registration fair.

Why two transactions?

A transaction can be seen before it is in a block: by the RPC provider you send it through, by the sequencer that orders OP Mainnet’s blocks, and by anyone they share it with. If registration took one transaction, someone who saw yours could send their own for the same name first.

Etherpage uses commit and reveal instead:

  1. Commit. You send commit(hash). The hash seals the name, the owner, the referrer (another page, or 0 for none) and a random secret made in your browser. It shows nothing about the name.
  2. Wait at least 20 seconds. The contract refuses to reveal a commitment younger than 20 seconds.
  3. Reveal. You send reveal(label, owner, referrerId, secret) with the price, using the same values you committed to. The contract checks the hash, mints the page to owner, and sends back anything you paid above the price.

A commitment can be revealed from 20 seconds to 24 hours after the block that recorded it, both ends included. If you miss that window, start again with a new commitment. You lose only the gas of the first transaction.

Anyone may send the reveal and pay for it. The page always goes to the owner sealed in the commitment, so someone who copies your reveal can only pay for your page. This is also how a sponsor registers a page for a wallet that holds no ETH: it commits with that wallet as owner, then reveals and pays. Whoever sends the reveal gets back any overpayment.

If owner is a contract, it must accept ERC-721 tokens (onERC721Received), unless it is the account that sends the reveal, or an account with no code or an EIP-7702 delegation.

The secret (read this)

The random secret is kept only in your browser’s local storage. The site saves it before it sends the commit, and shows any pending registration on the Register page so you can resume it.

Be careful with anything that wipes site data. If the secret is lost between commit and reveal, that commitment can never be revealed. The name is not lost, since nobody else can use your commitment either, but the gas of the commit is.

Name rules

The contract checks every label the same way (normalize):

  • 1 to 63 characters.
  • Only a to z, 0 to 9 and the hyphen -. Capitals A to Z become lowercase, so Alice registers alice. Every other character is refused: spaces, dots, underscores, accents and emoji included.
  • No hyphen first or last.
  • Not a hyphen in both the third and the fourth place, so ab--c and xn--abc are refused, while abc--d is allowed.
  • Not 0x followed by exactly 40 characters from 0–9 and a–f, because that reads as an address.

A full name is a label, such as alice, or a subpage label and its parent, such as blog.alice. A name never has a suffix and has at most one dot. Type alice, not alice.ether or alice.eth: a name with a dot is always a subpage, so alice.eth is the subpage alice of a page called eth, which belongs to whoever holds eth.

Trials

Instead of a year, you can register a page as a 14-day trial for a tenth of the yearly fee. It uses revealTrial(label, owner, referrerId, secret) with a commitment of its own (see the contracts reference).

  • The trial money is held for whoever paid it, and always comes back to that account: when the trial is renewed, when anyone calls release after the trial ends, or when the page is registered again.
  • A trial page works like any other page, with three limits: it has no grace period, it cannot have subpages, and it can move only to the dead address 0x000000000000000000000000000000000000dEaD.
  • To keep it, renew it before the trial ends. That costs the full yearly fee, makes it a normal paid page that expires one year after the trial would have ended, and sends the trial money back.
  • If you do not renew it, the page stops working when the trial ends, and anyone may register it for a year at once.
  • A trial is refused while a paid page is live, in grace or in its premium period, and for 14 days after the page’s last registration ended.

Duration, expiry, renewal

  • A registration lasts 365 days from the reveal.
  • renew adds 365 days to the current expiry, so renewing early never loses days. Each renewal pays one yearly fee into the page’s deposit.
  • Anyone can renew any page, and the page stays with its holder.
  • A renewal may not put the expiry more than 3650 days ahead, so a page can be paid up to about ten years ahead.
  • After expiry a paid page has a 90-day grace period. It stops answering and cannot move or change, but anyone can still renew it at the normal fee, and nobody else can register it. A trial has no grace period.
  • After the grace period anyone may register the page again, with a premium for 21 days. See Pricing.

If someone else wants the same name

Only one registration can win. When two people commit for the same name, the first reveal gets it. If the name is registered between your commit and your reveal, your reveal fails with AlreadyRegistered and costs only gas; the site checks before you pay.