---
eip: 1820
label: ERC-1820
title: Pseudo-introspection Registry Contract
status: Final
type: Standards Track
category: ERC
created: 2019-03-04
requires: 165, 214
official: https://eips.ethereum.org/EIPS/eip-1820
source: https://github.com/ethereum/ERCs/blob/master/ERCS/erc-1820.md
canonical: https://eips.huatuo.xyz/eip-1820/
lang: en
tldr: A single registry contract, at the same address on every chain, where any account or contract can declare which interfaces it supports and which contract implements them; ERC-777 relies on it.
tags: [registry, introspection, interfaces, erc777]
---

# ERC-1820: Pseudo-introspection Registry Contract

> This standard defines a universal registry smart contract where any address (contract or regular account) can register which interface it supports and which smart contract is responsible for its implementation.

**TL;DR:** A single registry contract, at the same address on every chain, where any account or contract can declare which interfaces it supports and which contract implements them; ERC-777 relies on it.

## What problem does it solve?

[ERC-165](/eip-165/) lets a contract answer "do you support interface X?", but only contracts can answer, and only about themselves. An externally owned account cannot say "I accept ERC-777 tokens, and contract Y handles that for me". Earlier attempts used reverse ENS, which was complex and controlled by a multisig.

ERC-1820 defines one global, ownerless registry. Any address can register an *implementer* contract for a named interface, and anyone can look that up. It supersedes [ERC-820](/eip-820/), which broke with Solidity 0.5's ERC-165 behaviour; otherwise the two are functionally the same.

## How it works

- **Interface names** are hashed with keccak256. Standard names follow `ERC###Name`, e.g. `keccak256("ERC777TokensRecipient")`. You may also invent your own names.
- **Register:** `setInterfaceImplementer(addr, interfaceHash, implementer)`. Only the address's *manager* may call it; by default every address is its own manager. If the implementer is another contract, that contract must confirm by returning `ERC1820_ACCEPT_MAGIC` (keccak256 of the string `"ERC1820_ACCEPT_MAGIC"`) from `canImplementInterfaceForAddress`. A magic value is used instead of `true` so a contract with a permissive fallback cannot accidentally "accept".
- **Look up:** `getInterfaceImplementer(addr, interfaceHash)` returns the implementer or zero.
- **ERC-165 bridge:** hashes whose last 28 bytes are zero are treated as ERC-165 IDs. The registry queries the contract itself using `STATICCALL` ([EIP-214](/eip-214/)) and can cache the result (`updateERC165Cache`), with no automatic invalidation.
- **Managers:** `setManager` hands registration rights to another address, useful for multisigs and EOAs.

**Same address everywhere.** The registry is deployed with "Nick's method": a pre-signed deployment transaction that does not use [EIP-155](/eip-155/) chain IDs and whose signature `r` and `s` are the repeating pattern `0x1820…`, so nobody knows the deployer's key. Anyone can fund the one-time deployer and broadcast it on any EVM chain, always yielding `0x1820a4B7618BdE71Dce8cdc73aAB6C95905faD24`.

## Sample code

A contract registering itself as an ERC-777 recipient (the pattern ERC-777 tokens look for):

```solidity
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

interface IERC1820Registry {
    function setInterfaceImplementer(address account, bytes32 interfaceHash, address implementer) external;
    function getInterfaceImplementer(address account, bytes32 interfaceHash) external view returns (address);
}

contract Receiver {
    IERC1820Registry constant REGISTRY = IERC1820Registry(0x1820a4B7618BdE71Dce8cdc73aAB6C95905faD24);
    bytes32 constant RECIPIENT_HASH = keccak256("ERC777TokensRecipient");

    constructor() {
        // implementer == address(this) == msg.sender, so no accept-magic check is needed
        REGISTRY.setInterfaceImplementer(address(this), RECIPIENT_HASH, address(this));
    }

    function tokensReceived(address, address, address, uint256, bytes calldata, bytes calldata) external {
        // handle incoming ERC-777 tokens
    }
}
```

## Things to know

- Status is **Final**. Use 1820, not 820; the spec states ERC-1820 must be used in place of ERC-820.
- The registry only exists on a chain if someone has broadcast the deployment transaction there. Check for code at the address before relying on it on a new network.
- The deployment transaction pays a fixed 100 gwei gas price and lacks replay protection, so it can only be broadcast on chains (and nodes) that accept pre-EIP-155 transactions.
- The ERC-165 cache is manual: if a contract's supported interfaces change, someone must call `updateERC165Cache`.
- New token designs mostly avoid registry-based hooks; ERC-777's reliance on 1820 callbacks has been linked to reentrancy issues in integrations.


---

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