---
eip: 181
label: ERC-181
title: ENS support for reverse resolution of Ethereum addresses
status: Final
type: Standards Track
category: ERC
created: 2016-12-01
official: https://eips.ethereum.org/EIPS/eip-181
source: https://github.com/ethereum/ERCs/blob/master/ERCS/erc-181.md
canonical: https://eips.huatuo.xyz/eip-181/
lang: en
tldr: "Lets an address publish its own ENS name under addr.reverse, so wallets and explorers can show 'alice.eth' instead of a raw 0x address."
tags: [ens, naming, reverse-resolution]
---

# ERC-181: ENS support for reverse resolution of Ethereum addresses

> This EIP specifies a TLD, registrar, and resolver interface for reverse resolution of Ethereum addresses using ENS. This permits associating a human-readable name with any Ethereum blockchain address.

**TL;DR:** Lets an address publish its own ENS name under addr.reverse, so wallets and explorers can show 'alice.eth' instead of a raw 0x address.

## What problem does it solve?

[ENS (ERC-137)](/eip-137/) maps names to addresses. But apps often start from the other side: they have an address and want to show something human-readable. Forward records alone cannot do this safely, because anyone can point their name at your address. If an app just searched for "a name that resolves to 0xabc…", an attacker could make their name show up for your account.

ERC-181 adds **reverse resolution**: a record that only the owner of an address can set, saying "my primary name is alice.eth".

## How it works

**A reserved domain.** Reverse records live under `addr.reverse`. The name for an account is its lower-case hex address (without `0x`) followed by `.addr.reverse`:

```
112234455c3a32fd11230c42e7bccd4a84e02010.addr.reverse
```

**A reverse registrar** owns `addr.reverse`. It only lets the caller claim the record for the caller's own address:

| Function | What it does |
| --- | --- |
| `claim(owner)` | Gives ownership of `hex(msg.sender).addr.reverse` to `owner` |
| `claimWithResolver(owner, resolver)` | Same, and sets a custom resolver in one step |
| `setName(name)` | Points the record at a default resolver and sets the name, in one transaction |

Letting the caller choose another owner helps contracts: a constructor can call `reverseRegistrar.claim(msg.sender)` to hand its reverse record to its deployer.

**A new resolver record**, `name(bytes32 node) returns (string)`, with interface ID `0x691f3431` (advertised via [ERC-165](/eip-165/)). It returns the name, or an empty string if none is set.

## Sample code

Setting your own reverse name from a contract or script, then looking it up (ethers v6):

```solidity
interface IReverseRegistrar {
    function setName(string calldata name) external returns (bytes32 node);
}

// Called by the address that wants the name:
// IReverseRegistrar(reverseRegistrar).setName("alice.eth");
```

```ts
import { JsonRpcProvider } from "ethers";

const provider = new JsonRpcProvider(process.env.RPC_URL);

// ethers resolves <addr>.addr.reverse, reads name(), then
// checks that the forward record points back to the same address.
const name = await provider.lookupAddress("0x...yourAddress");
console.log(name); // "alice.eth" or null
```

## Things to know

- A reverse record is a **claim**, not a proof. Anyone can set their reverse name to "vitalik.eth". Clients must check that the forward record of that name resolves back to the same address before showing it. ethers' `lookupAddress` does this check for you.
- Contracts that want to do reverse lookups on chain must hex-encode the address themselves, since the label is a hex string, not raw bytes.
- The reverse name is per address. An address can own many forward names but has one reverse record, so it effectively picks a "primary" name.
- The spec's appendix contains a reference registrar written for Solidity 0.4. Use the deployed ENS contracts rather than redeploying that code.


---

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