---
eip: 205
label: ERC-205
title: ENS support for contract ABIs
status: Stagnant
type: Standards Track
category: ERC
created: 2017-02-06
requires: 137, 181
official: https://eips.ethereum.org/EIPS/eip-205
source: https://github.com/ethereum/ERCs/blob/master/ERCS/erc-205.md
canonical: https://eips.huatuo.xyz/eip-205/
lang: en
tldr: "Lets an ENS name publish its contract's ABI, so a caller can look up both the address and the interface of a contract from one name."
tags: [ens, abi, resolver, metadata]
---

# ERC-205: ENS support for contract ABIs

> This EIP proposes a mechanism for storing ABI definitions in ENS, for easy lookup of contract interfaces by callers.

**TL;DR:** Lets an ENS name publish its contract's ABI, so a caller can look up both the address and the interface of a contract from one name.

## What problem does it solve?

To call a contract you need its address and its ABI, the JSON description of its functions and events. [ENS](/eip-137/) solved the address part: `mytoken.eth` resolves to an address. The ABI, though, still had to come from somewhere else, such as a website, a GitHub repo or a block explorer. That is awkward for one-off interactions and for contracts whose interface changes over time.

ABIs are small. The spec notes that even The DAO's large ABI was about 9.4 KB of raw JSON and about 1.1 KB compressed. So ERC-205 proposes storing them right in ENS, next to the address.

## How it works

ERC-205 defines a new **resolver profile**:

```solidity
function ABI(bytes32 node, uint256 contentTypes) view returns (uint256, bytes);
```

Its ERC-165 interface ID is `0x2203ab56`.

`contentTypes` is a bitmask of the encodings the caller can handle. The resolver returns one of them, or `(0, "")` if it has nothing suitable.

| ID | Encoding | Notes |
| --- | --- | --- |
| 1 | JSON | Standard, but the largest |
| 2 | zlib-compressed JSON | Small, easy to decode off-chain |
| 4 | CBOR | Compact and easier to parse in the EVM |
| 8 | URI | Points elsewhere (HTTP, IPFS, Swarm…) |

**Lookup order:** first ask the resolver for the name itself, such as `mytoken.eth`. If that returns nothing, do a reverse lookup ([ERC-181](/eip-181/)) on the address the name points to, and ask that record. A contract can publish its own canonical ABI on its reverse record, and individual names can override it, for example with a trimmed ABI.

## Sample code

Fetching a JSON ABI via ENS with ethers v6:

```ts
import { Contract, JsonRpcProvider, namehash, toUtf8String } from "ethers";

const provider = new JsonRpcProvider(process.env.RPC_URL);
const name = "example.eth";

const resolverInfo = await provider.getResolver(name);
if (!resolverInfo) throw new Error("no resolver");

const resolver = new Contract(
  resolverInfo.address,
  ["function ABI(bytes32 node, uint256 contentTypes) view returns (uint256, bytes)"],
  provider,
);

const [type, data] = await resolver.ABI(namehash(name), 1); // accept JSON only
if (type === 1n) {
  const abi = JSON.parse(toUtf8String(data));
  const target = new Contract((await provider.resolveName(name))!, abi, provider);
}
```

## Things to know

- This ERC is **Stagnant**. It never reached Final, but the `ABI` record does appear in ENS resolver implementations.
- In practice, most developers still get ABIs from verified source on block explorers or from package artifacts, not from ENS.
- Uncompressed JSON is expensive to write on-chain. Prefer compressed, CBOR or URI forms for large ABIs.
- Other ENS record types follow the same resolver-profile pattern, for example text records in [ERC-634](/eip-634/). Off-chain resolution is possible with [ERC-3668](/eip-3668/) (CCIP Read).


---

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