---
eip: 6381
label: ERC-6381
title: Public Non-Fungible Token Emote Repository
status: Final
type: Standards Track
category: ERC
created: 2023-01-22
requires: 165
official: https://eips.ethereum.org/EIPS/eip-6381
source: https://github.com/ethereum/ERCs/blob/master/ERCS/erc-6381.md
canonical: https://eips.huatuo.xyz/eip-6381/
lang: en
tldr: A single public repository contract where anyone can react to any NFT with an emoji, giving every collection (old or new) standard on-chain reactions without changing the NFT contract.
tags: [nft, social, emoji, reactions, repository]
---

# ERC-6381: Public Non-Fungible Token Emote Repository

> React to any Non-Fungible Tokens using Unicode emojis.

**TL;DR:** A single public repository contract where anyone can react to any NFT with an emoji, giving every collection (old or new) standard on-chain reactions without changing the NFT contract.

## What problem does it solve?

NFT marketplaces and apps show likes and reactions, but those live in each platform's own database. They can't be verified, can't be read by other apps, and can't drive on-chain logic such as an NFT that evolves after enough people react to it.

ERC-6381 defines a **public emote repository**: one shared contract, meant to be deployed at the same address on every chain, that records which address reacted to which token with which emoji. Because it is a separate repository and not an extension of the token, it works for any existing [ERC-721](/eip-721/) or [ERC-1155](/eip-1155/) collection with no changes to that collection.

## How it works

- An emoji is identified by a `bytes4` Unicode value. Values outside Unicode can serve as custom emotes, but apps then need to know how to render them.
- `emote(collection, tokenId, emoji, state)` adds (`true`) or removes (`false`) your reaction. Each address can have at most one active reaction per emoji per token, so spamming does not inflate counts.
- `emoteCountOf(collection, tokenId, emoji)` returns the count; `hasEmoterUsedEmote(...)` checks a specific address.
- Bulk versions (`bulkEmote`, `bulkEmoteCountOf`, `haveEmotersUsedEmotes`) save gas and RPC calls.
- **Presigned emotes**: a user signs a message and anyone can submit it with `presignedEmote(...)` or `bulkPresignedEmote(...)`, for example to sponsor gas or record reactions earned off-chain. The message is `keccak256(abi.encode(DOMAIN_SEPARATOR, collection, tokenId, emoji, state, deadline))`, and the domain separator includes the chain ID and repository address.
- An `Emoted(emoter, collection, tokenId, emoji, on)` event fires only when state actually changes.
- The repository's ERC-165 interface ID is `0xd9fac55a`. The spec gives its intended address as `0x31107354b61A0412E722455A771bC462901668eA` (the `0x311073` prefix spells "EMOTE").

## Sample code

React to an NFT and read the count (ethers v6):

```ts
import { Contract, toUtf8Bytes, hexlify } from "ethers";

const REPO = "0x31107354b61A0412E722455A771bC462901668eA"; // per the spec; verify it is deployed on your chain
const repo = new Contract(REPO, [
  "function emote(address collection, uint256 tokenId, bytes4 emoji, bool state)",
  "function emoteCountOf(address collection, uint256 tokenId, bytes4 emoji) view returns (uint256)",
], signer);

// U+1F525 (fire) as the first 4 bytes of its UTF-8 encoding: 0xf09f94a5
const FIRE = hexlify(toUtf8Bytes("🔥"));

await (await repo.emote(collection, 1234n, FIRE, true)).wait();
console.log(await repo.emoteCountOf(collection, 1234n, FIRE)); // 1n
```

## Things to know

- Status: **Final**.
- The spec says "Unicode identifier" but does not fix one encoding for `bytes4`. The sample uses UTF-8 bytes (which fits most single-codepoint emoji); apps that want to share counts must agree on the same encoding.
- The repository does not check that the token exists, so you can react to tokens that were never minted. Indexers should filter accordingly.
- A presigned message can be reused until its deadline. If your app revokes reactions, use short deadlines, or someone could replay the signature to re-add it.
- No assets are held by the repository, so the main risks are signature handling and treating raw counts as trustworthy signals: they can be gamed with many addresses.


---

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