Alephium Name ServiceDocs
Open app

How it works

Forward and reverse resolvers, and how names and addresses link.

ANS resolves names using two complementary resolver contracts. Understanding them explains what it means for a name and an address to be linked.

Requirements

ANS was designed to satisfy a few rules:

  • A Name is represented as an NFT, so it can be easily traded.
  • A Name resolves to at most one Address.
  • An Address on any group (shard) resolves to at most one Name.
  • The holder of the Name NFT can assign any Address to that name.
  • An Address does not need to hold the Name NFT to be resolved.
  • An Address must give its own permission for which name resolves to it.

The two resolvers

ForwardNameResolver — a single contract on group 0. It records which Address a Name should resolve to. Only the holder of the Name NFT can set this.

ReverseNameResolver — a contract deployed on every group. It records which Name an Address should resolve to. An address can only set its own reverse entry.

What "linked" means

A Name and an Address are considered linked only when both exist:

  1. a ForwardNameResolver entry (NameAddress), and
  2. a matching ReverseNameResolver entry (AddressName).

This two‑sided design means linking never requires passing an NFT around: it takes just one transaction from the name holder and one from the target address.

Example

Say the ForwardNameResolver on group 0 holds:

  • "bob""address_1"
  • "alice""address_1"
  • "steve""address_1"

And the ReverseNameResolver on group 1 holds:

  • "address_2""alice"
  • "address_1""alice"
  • "address_3""alice"

With just two lookups — and no off‑chain processing — we can confirm that "alice" and "address_1" are linked, because the forward and reverse entries agree.