{"eip":6381,"title":"Public Non-Fungible Token Emote Repository","description":"React to any Non-Fungible Tokens using Unicode emojis.","authors":["Bruno Škvorc (@Swader)","Steven Pineda (@steven2308)","Stevan Bogosavljevic (@stevyhacker)","Jan Turk (@ThunderDeliverer)"],"status":"Final","type":"Standards Track","category":"ERC","created":"2023-01-22","requires":[165],"discussionsTo":"https://ethereum-magicians.org/t/eip-6381-emotable-extension-for-non-fungible-tokens/12710","repo":"ERCs","label":"ERC-6381","officialUrl":"https://eips.ethereum.org/EIPS/eip-6381","sourceUrl":"https://github.com/ethereum/ERCs/blob/master/ERCS/erc-6381.md","url":"https://eips.huatuo.xyz/eip-6381/","tldr":{"en":"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.","ja":"誰でもあらゆる NFT に絵文字でリアクションできる単一の公開リポジトリコントラクト。NFT コントラクトを変更せずに、すべてのコレクション（新旧を問わず）に標準的なオンチェーンのリアクションを提供する。","ko":"누구나 어떤 NFT에든 이모지로 반응할 수 있는 단일 공개 리포지토리 컨트랙트로, NFT 컨트랙트를 바꾸지 않고도 모든 컬렉션(오래된 것이든 새것이든)에 표준 온체인 반응을 제공한다.","zh":"一个单一的公共仓库合约，任何人都可以用 emoji 对任意 NFT 做出反应，无需改动 NFT 合约，就能为每个系列（无论新旧）提供标准的链上反应。"},"tags":["nft","social","emoji","reactions","repository"],"explainers":{"en":{"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"],"related":[721,1155,165],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-6381/","markdown":"## What problem does it solve?\n\nNFT 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.\n\nERC-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.\n\n## How it works\n\n- 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.\n- `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.\n- `emoteCountOf(collection, tokenId, emoji)` returns the count; `hasEmoterUsedEmote(...)` checks a specific address.\n- Bulk versions (`bulkEmote`, `bulkEmoteCountOf`, `haveEmotersUsedEmotes`) save gas and RPC calls.\n- **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.\n- An `Emoted(emoter, collection, tokenId, emoji, on)` event fires only when state actually changes.\n- The repository's ERC-165 interface ID is `0xd9fac55a`. The spec gives its intended address as `0x31107354b61A0412E722455A771bC462901668eA` (the `0x311073` prefix spells \"EMOTE\").\n\n## Sample code\n\nReact to an NFT and read the count (ethers v6):\n\n```ts\nimport { Contract, toUtf8Bytes, hexlify } from \"ethers\";\n\nconst REPO = \"0x31107354b61A0412E722455A771bC462901668eA\"; // per the spec; verify it is deployed on your chain\nconst repo = new Contract(REPO, [\n  \"function emote(address collection, uint256 tokenId, bytes4 emoji, bool state)\",\n  \"function emoteCountOf(address collection, uint256 tokenId, bytes4 emoji) view returns (uint256)\",\n], signer);\n\n// U+1F525 (fire) as the first 4 bytes of its UTF-8 encoding: 0xf09f94a5\nconst FIRE = hexlify(toUtf8Bytes(\"🔥\"));\n\nawait (await repo.emote(collection, 1234n, FIRE, true)).wait();\nconsole.log(await repo.emoteCountOf(collection, 1234n, FIRE)); // 1n\n```\n\n## Things to know\n\n- Status: **Final**.\n- 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.\n- The repository does not check that the token exists, so you can react to tokens that were never minted. Indexers should filter accordingly.\n- 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.\n- 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.\n"},"ja":{"lang":"ja","tldr":"誰でもあらゆる NFT に絵文字でリアクションできる単一の公開リポジトリコントラクト。NFT コントラクトを変更せずに、すべてのコレクション（新旧を問わず）に標準的なオンチェーンのリアクションを提供する。","tags":["nft","social","emoji","reactions","repository"],"related":[721,1155,165],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-6381/","markdown":"## 何を解決するのか\n\nNFT のマーケットプレイスやアプリは「いいね」やリアクションを表示しますが、それらは各プラットフォームの独自のデータベースにあります。検証できず、他のアプリから読めず、十分な人数がリアクションした後に進化する NFT のようなオンチェーンのロジックを動かすこともできません。\n\nERC-6381 は**公開エモートリポジトリ**を定義します。すべてのチェーンで同じアドレスにデプロイされることを想定した 1 つの共有コントラクトで、どのアドレスがどのトークンにどの絵文字でリアクションしたかを記録します。トークンの拡張ではなく独立したリポジトリであるため、既存の [ERC-721](/eip-721/) や [ERC-1155](/eip-1155/) のコレクションに変更を加えることなく動作します。\n\n## 仕組み\n\n- 絵文字は `bytes4` の Unicode 値で識別されます。Unicode 外の値をカスタムエモートとして使えますが、その場合アプリはその描画方法を知っている必要があります。\n- `emote(collection, tokenId, emoji, state)` は、リアクションを追加（`true`）または削除（`false`）します。各アドレスがトークンごと・絵文字ごとに持てる有効なリアクションは最大 1 つなので、スパムしてもカウントは膨らみません。\n- `emoteCountOf(collection, tokenId, emoji)` はカウントを返し、`hasEmoterUsedEmote(...)` は特定のアドレスを確認します。\n- バルク版（`bulkEmote`、`bulkEmoteCountOf`、`haveEmotersUsedEmotes`）はガスと RPC 呼び出しを節約します。\n- **事前署名エモート**: ユーザーがメッセージに署名すると、誰でも `presignedEmote(...)` や `bulkPresignedEmote(...)` で送信できます。たとえばガス代を肩代わりしたり、オフチェーンで獲得したリアクションを記録したりするためです。メッセージは `keccak256(abi.encode(DOMAIN_SEPARATOR, collection, tokenId, emoji, state, deadline))` で、ドメインセパレータにはチェーン ID とリポジトリのアドレスが含まれます。\n- `Emoted(emoter, collection, tokenId, emoji, on)` イベントは、状態が実際に変わったときにのみ発行されます。\n- リポジトリの ERC-165 インターフェース ID は `0xd9fac55a` です。仕様は想定アドレスを `0x31107354b61A0412E722455A771bC462901668eA` としています（`0x311073` というプレフィックスは「EMOTE」と読めます）。\n\n## サンプルコード\n\nNFT にリアクションしてカウントを読む例（ethers v6）:\n\n```ts\nimport { Contract, toUtf8Bytes, hexlify } from \"ethers\";\n\nconst REPO = \"0x31107354b61A0412E722455A771bC462901668eA\"; // per the spec; verify it is deployed on your chain\nconst repo = new Contract(REPO, [\n  \"function emote(address collection, uint256 tokenId, bytes4 emoji, bool state)\",\n  \"function emoteCountOf(address collection, uint256 tokenId, bytes4 emoji) view returns (uint256)\",\n], signer);\n\n// U+1F525 (fire) as the first 4 bytes of its UTF-8 encoding: 0xf09f94a5\nconst FIRE = hexlify(toUtf8Bytes(\"🔥\"));\n\nawait (await repo.emote(collection, 1234n, FIRE, true)).wait();\nconsole.log(await repo.emoteCountOf(collection, 1234n, FIRE)); // 1n\n```\n\n## 知っておくべきこと\n\n- ステータス: **Final**。\n- 仕様は「Unicode 識別子」と言っていますが、`bytes4` のエンコーディングを 1 つに定めてはいません。サンプルは UTF-8 バイト（ほとんどの単一コードポイントの絵文字に合います）を使っています。カウントを共有したいアプリは、同じエンコーディングに合意する必要があります。\n- リポジトリはトークンが存在するかどうかを確認しないため、ミントされたことのないトークンにもリアクションできます。インデクサーは適切にフィルタリングするべきです。\n- 事前署名メッセージは、期限まで再利用できます。アプリがリアクションを取り消す場合は期限を短くしてください。そうしないと、誰かが署名をリプレイして再び追加できてしまいます。\n- リポジトリは資産を保持しないため、主なリスクは署名の扱いと、生のカウントを信頼できるシグナルとして扱うことです。多数のアドレスを使えば操作できてしまいます。\n"},"ko":{"lang":"ko","tldr":"누구나 어떤 NFT에든 이모지로 반응할 수 있는 단일 공개 리포지토리 컨트랙트로, NFT 컨트랙트를 바꾸지 않고도 모든 컬렉션(오래된 것이든 새것이든)에 표준 온체인 반응을 제공한다.","tags":["nft","social","emoji","reactions","repository"],"related":[721,1155,165],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-6381/","markdown":"## 어떤 문제를 해결하나요?\n\nNFT 마켓플레이스와 앱은 좋아요와 반응을 보여주지만, 이는 각 플랫폼의 자체 데이터베이스에 있습니다. 검증할 수 없고, 다른 앱이 읽을 수 없으며, 충분한 사람이 반응한 뒤 진화하는 NFT 같은 온체인 로직을 구동할 수도 없습니다.\n\nERC-6381은 **공개 이모트 리포지토리**를 정의합니다. 모든 체인에서 같은 주소로 배포하는 것을 전제로 한 하나의 공유 컨트랙트로, 어떤 주소가 어떤 토큰에 어떤 이모지로 반응했는지 기록합니다. 토큰의 확장이 아니라 별도의 리포지토리이기 때문에, 기존 [ERC-721](/eip-721/)이나 [ERC-1155](/eip-1155/) 컬렉션에 아무 변경 없이 동작합니다.\n\n## 어떻게 동작하나요?\n\n- 이모지는 `bytes4` 유니코드 값으로 식별됩니다. 유니코드 밖의 값은 커스텀 이모트로 쓸 수 있지만, 이 경우 앱이 이를 어떻게 렌더링할지 알아야 합니다.\n- `emote(collection, tokenId, emoji, state)`는 반응을 추가(`true`)하거나 제거(`false`)합니다. 각 주소는 토큰당 이모지당 활성 반응을 최대 하나만 가질 수 있어서 도배해도 카운트가 부풀지 않습니다.\n- `emoteCountOf(collection, tokenId, emoji)`는 카운트를 반환하고, `hasEmoterUsedEmote(...)`는 특정 주소를 확인합니다.\n- 벌크 버전(`bulkEmote`, `bulkEmoteCountOf`, `haveEmotersUsedEmotes`)은 가스와 RPC 호출을 아낍니다.\n- **사전 서명 이모트**: 사용자가 메시지에 서명하면 누구나 `presignedEmote(...)`나 `bulkPresignedEmote(...)`로 제출할 수 있습니다. 예를 들어 가스비를 대신 내주거나 오프체인에서 얻은 반응을 기록할 때 씁니다. 메시지는 `keccak256(abi.encode(DOMAIN_SEPARATOR, collection, tokenId, emoji, state, deadline))`이며, 도메인 구분자에는 체인 ID와 리포지토리 주소가 포함됩니다.\n- `Emoted(emoter, collection, tokenId, emoji, on)` 이벤트는 상태가 실제로 바뀔 때만 발생합니다.\n- 리포지토리의 ERC-165 인터페이스 ID는 `0xd9fac55a`입니다. 스펙은 의도된 주소를 `0x31107354b61A0412E722455A771bC462901668eA`로 제시합니다(`0x311073` 접두사가 \"EMOTE\"를 뜻합니다).\n\n## 샘플 코드\n\nNFT에 반응하고 카운트 읽기(ethers v6):\n\n```ts\nimport { Contract, toUtf8Bytes, hexlify } from \"ethers\";\n\nconst REPO = \"0x31107354b61A0412E722455A771bC462901668eA\"; // per the spec; verify it is deployed on your chain\nconst repo = new Contract(REPO, [\n  \"function emote(address collection, uint256 tokenId, bytes4 emoji, bool state)\",\n  \"function emoteCountOf(address collection, uint256 tokenId, bytes4 emoji) view returns (uint256)\",\n], signer);\n\n// U+1F525 (fire) as the first 4 bytes of its UTF-8 encoding: 0xf09f94a5\nconst FIRE = hexlify(toUtf8Bytes(\"🔥\"));\n\nawait (await repo.emote(collection, 1234n, FIRE, true)).wait();\nconsole.log(await repo.emoteCountOf(collection, 1234n, FIRE)); // 1n\n```\n\n## 알아둘 점\n\n- 상태: **Final**.\n- 스펙은 \"Unicode identifier\"라고 하지만 `bytes4`에 대한 인코딩을 하나로 정하지는 않습니다. 샘플은 UTF-8 바이트(대부분의 단일 코드포인트 이모지에 맞음)를 씁니다. 카운트를 공유하려는 앱은 같은 인코딩에 합의해야 합니다.\n- 리포지토리는 토큰이 존재하는지 확인하지 않으므로, 민팅된 적 없는 토큰에도 반응할 수 있습니다. 인덱서는 이에 맞게 필터링해야 합니다.\n- 사전 서명 메시지는 마감 시한까지 재사용될 수 있습니다. 앱이 반응을 철회한다면 마감 시한을 짧게 잡으세요. 그렇지 않으면 누군가 서명을 재생(replay)해 다시 추가할 수 있습니다.\n- 리포지토리는 자산을 보관하지 않으므로 주된 위험은 서명 처리와, 원시 카운트를 신뢰할 수 있는 신호로 취급하는 것입니다. 많은 주소로 조작할 수 있습니다.\n"},"zh":{"lang":"zh","tldr":"一个单一的公共仓库合约，任何人都可以用 emoji 对任意 NFT 做出反应，无需改动 NFT 合约，就能为每个系列（无论新旧）提供标准的链上反应。","tags":["nft","social","emoji","reactions","repository"],"related":[721,1155,165],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-6381/","markdown":"## 它解决什么问题？\n\nNFT 市场和应用会显示点赞和反应，但这些数据存放在各平台自己的数据库里。它们无法验证，无法被其他应用读取，也无法驱动链上逻辑，例如当足够多的人对某个 NFT 做出反应后它就会进化。\n\nERC-6381 定义了一个**公共表情仓库**：一个共享合约，打算在每条链上部署到同一地址，记录哪个地址用哪个 emoji 对哪个代币做出了反应。由于它是独立的仓库而不是代币的扩展，所以对任何现有的 [ERC-721](/eip-721/) 或 [ERC-1155](/eip-1155/) 系列都有效，无需对该系列做任何改动。\n\n## 它如何运作\n\n- emoji 由一个 `bytes4` 的 Unicode 值标识。Unicode 之外的值可以作为自定义表情使用，但应用需要知道如何渲染它们。\n- `emote(collection, tokenId, emoji, state)` 添加（`true`）或移除（`false`）你的反应。每个地址对每个代币的每个 emoji 最多只能有一个有效反应，因此刷屏不会虚增计数。\n- `emoteCountOf(collection, tokenId, emoji)` 返回计数；`hasEmoterUsedEmote(...)` 检查特定地址。\n- 批量版本（`bulkEmote`、`bulkEmoteCountOf`、`haveEmotersUsedEmotes`）可以节省 gas 和 RPC 调用。\n- **预签名表情**：用户签署一条消息，任何人都可以用 `presignedEmote(...)` 或 `bulkPresignedEmote(...)` 提交它，例如用于代付 gas，或记录在链下获得的反应。消息为 `keccak256(abi.encode(DOMAIN_SEPARATOR, collection, tokenId, emoji, state, deadline))`，域分隔符包含链 ID 和仓库地址。\n- 只有当状态真正发生变化时，才会触发 `Emoted(emoter, collection, tokenId, emoji, on)` 事件。\n- 该仓库的 ERC-165 接口 ID 是 `0xd9fac55a`。规范给出的预期地址是 `0x31107354b61A0412E722455A771bC462901668eA`（前缀 `0x311073` 拼出了 \"EMOTE\"）。\n\n## 示例代码\n\n对 NFT 做出反应并读取计数（ethers v6）：\n\n```ts\nimport { Contract, toUtf8Bytes, hexlify } from \"ethers\";\n\nconst REPO = \"0x31107354b61A0412E722455A771bC462901668eA\"; // per the spec; verify it is deployed on your chain\nconst repo = new Contract(REPO, [\n  \"function emote(address collection, uint256 tokenId, bytes4 emoji, bool state)\",\n  \"function emoteCountOf(address collection, uint256 tokenId, bytes4 emoji) view returns (uint256)\",\n], signer);\n\n// U+1F525 (fire) as the first 4 bytes of its UTF-8 encoding: 0xf09f94a5\nconst FIRE = hexlify(toUtf8Bytes(\"🔥\"));\n\nawait (await repo.emote(collection, 1234n, FIRE, true)).wait();\nconsole.log(await repo.emoteCountOf(collection, 1234n, FIRE)); // 1n\n```\n\n## 需要注意\n\n- 状态：**Final**。\n- 规范说的是\"Unicode 标识符\"，但没有为 `bytes4` 固定某一种编码。示例使用 UTF-8 字节（适用于大多数单码位 emoji）；希望共享计数的应用必须就同一种编码达成一致。\n- 仓库不会检查代币是否存在，因此可以对从未被铸造的代币做出反应。索引器应据此进行过滤。\n- 预签名消息在截止时间之前可以被重复使用。如果你的应用会撤销反应，请使用较短的截止时间，否则有人可能重放该签名来重新添加。\n- 仓库不持有任何资产，所以主要风险在于签名处理，以及把原始计数当作可信信号：它们可以被大量地址刷出来。\n"}}}
