Introduction
Hi, I'm cardene, a software engineer and technical writer focused on blockchain and AI.
I've also authored Japanese technical books on specification-driven development with LLMs and decentralized application (DApp) development.
I also build and publish a variety of tools, libraries, and open-source projects.
This article examines ERC7409, which proposes extending ERC6381 with batch operations and support for a wider range of emoji.
The following material is translated, summarized, and supplemented with explanations.
I have also covered various other ERCs.
Overview
ERC7409 is a new standard proposed as the successor to ERC6381. The proposal centers on a Public Non-Fungible Tokens Emote Repository standard, which aims to add interactive functionality to NFTs such as ERC721 and ERC1155 tokens.
For more on ERC6381, see the following article.
[ERC6381] Adding Emoji Reactions to NFTs
For more on ERC721, see the following article.
For more on ERC1155, see the following article.
The standard enables emoji reactions to NFTs. These emoji are standardized in Unicode, allowing users to express feelings or reactions toward NFTs. This functionality is implemented through a smart contract called a public non-gated repository, accessible at the same address on different networks.
ERC7409 provides a new way for users to react to NFTs with emoji. The goal is to make NFT interactions more engaging and interactive. This public repository, available across networks, enables a new form of interaction with NFTs.
Motivation
NFTs (non-fungible tokens) are widely used for various purposes in the Ethereum ecosystem. Various proposals, including ERCs, add and standardize new NFT functionality. Allowing anyone to interact with an NFT introduces an interactive aspect to ownership and enables new mechanisms based on feedback.
The proposal, which adds utility to ERC-721-based tokens, introduces functionality in three areas.
- Interactivity
- Feedback-based evolution
- Valuation
The proposal also addresses compatibility issues with the ERC6381 interface.
Emoji were originally represented by bytes4 values, but variation selectors and skin tone modifiers made four bytes insufficient to represent all emoji.
The new standard therefore uses strings (string).
Apart from this change, the proposal is functionally equivalent to ERC6381.
The proposal aims to make NFT interactions more interactive and enable feedback-based evolution and valuation. It also improves the data format to represent emoji more flexibly.
The following explains the three main benefits of adding these features to NFTs in simpler terms.
Interactivity
Allowing users to emote (react with emoji) makes NFTs more interactive. People interested in an NFT can express their reactions with emoji, including reactions to the token owner's actions. A token that attracts emotes from many people may become more distinctive or valuable.
Feedback based evolution
Standardized on-chain reactions to NFTs allow tokens to evolve based on feedback. Many existing methods rely on off-chain data that can be unreliable or manipulated. Tracking interactions on-chain makes tokens more trustworthy and allows them to be evaluated objectively. Designing tokens to evolve when they receive a certain number of reactions can also increase interest in a collection.
Valuation
Existing NFT markets rely on historical transaction prices and market data, but lack indicators of real-time popularity or desirability. Allowing users to react to tokens with emoji provides a new way to assess value based on their impressions. Buyers and sellers can therefore better judge a token's true value.
Specification
/// @title ERC-7409 Emotable Extension for Non-Fungible Tokens
/// @dev See https://eips.ethereum.org/EIPS/eip-7409
/// @dev Note: the ERC-165 identifier for this interface is 0x1b3327ab.
pragma solidity ^0.8.16;
interface IERC7409 /*is IERC165*/ {
/**
* @notice Used to notify listeners that the token with the specified ID has been emoted to or that the reaction has been revoked.
* @dev The event MUST only be emitted if the state of the emote is changed.
* @param emoter Address of the account that emoted or revoked the reaction to the token
* @param collection Address of the collection smart contract containing the token being emoted to or having the reaction revoked
* @param tokenId ID of the token
* @param emoji Unicode identifier of the emoji
* @param on Boolean value signifying whether the token was emoted to (`true`) or if the reaction has been revoked (`false`)
*/
event Emoted(
address indexed emoter,
address indexed collection,
uint256 indexed tokenId,
string emoji,
bool on
);
/**
* @notice Used to get the number of emotes for a specific emoji on a token.
* @param collection Address of the collection containing the token being checked for emoji count
* @param tokenId ID of the token to check for emoji count
* @param emoji Unicode identifier of the emoji
* @return Number of emotes with the emoji on the token
*/
function emoteCountOf(
address collection,
uint256 tokenId,
string memory emoji
) external view returns (uint256);
/**
* @notice Used to get the number of emotes for a specific emoji on a set of tokens.
* @param collections An array of addresses of the collections containing the tokens being checked for emoji count
* @param tokenIds An array of IDs of the tokens to check for emoji count
* @param emojis An array of unicode identifiers of the emojis
* @return An array of numbers of emotes with the emoji on the tokens
*/
function bulkEmoteCountOf(
address[] memory collections,
uint256[] memory tokenIds,
string[] memory emojis
) external view returns (uint256[] memory);
/**
* @notice Used to get the information on whether the specified address has used a specific emoji on a specific
* token.
* @param emoter Address of the account we are checking for a reaction to a token
* @param collection Address of the collection smart contract containing the token being checked for emoji reaction
* @param tokenId ID of the token being checked for emoji reaction
* @param emoji The ASCII emoji code being checked for reaction
* @return A boolean value indicating whether the `emoter` has used the `emoji` on the token (`true`) or not
* (`false`)
*/
function hasEmoterUsedEmote(
address emoter,
address collection,
uint256 tokenId,
string memory emoji
) external view returns (bool);
/**
* @notice Used to get the information on whether the specified addresses have used specific emojis on specific
* tokens.
* @param emoters An array of addresses of the accounts we are checking for reactions to tokens
* @param collections An array of addresses of the collection smart contracts containing the tokens being checked
* for emoji reactions
* @param tokenIds An array of IDs of the tokens being checked for emoji reactions
* @param emojis An array of the ASCII emoji codes being checked for reactions
* @return An array of boolean values indicating whether the `emoter`s has used the `emoji`s on the tokens (`true`)
* or not (`false`)
*/
function haveEmotersUsedEmotes(
address[] memory emoters,
address[] memory collections,
uint256[] memory tokenIds,
string[] memory emojis
) external view returns (bool[] memory);
/**
* @notice Used to get the message to be signed by the `emoter` in order for the reaction to be submitted by someone
* else.
* @param collection The address of the collection smart contract containing the token being emoted at
* @param tokenId ID of the token being emoted
* @param emoji Unicode identifier of the emoji
* @param state Boolean value signifying whether to emote (`true`) or undo (`false`) emote
* @param deadline UNIX timestamp of the deadline for the signature to be submitted
* @return The message to be signed by the `emoter` in order for the reaction to be submitted by someone else
*/
function prepareMessageToPresignEmote(
address collection,
uint256 tokenId,
string memory emoji,
bool state,
uint256 deadline
) external view returns (bytes32);
/**
* @notice Used to get multiple messages to be signed by the `emoter` in order for the reaction to be submitted by someone
* else.
* @param collections An array of addresses of the collection smart contracts containing the tokens being emoted at
* @param tokenIds An array of IDs of the tokens being emoted
* @param emojis An array of unicode identifiers of the emojis
* @param states An array of boolean values signifying whether to emote (`true`) or undo (`false`) emote
* @param deadlines An array of UNIX timestamps of the deadlines for the signatures to be submitted
* @return The array of messages to be signed by the `emoter` in order for the reaction to be submitted by someone else
*/
function bulkPrepareMessagesToPresignEmote(
address[] memory collections,
uint256[] memory tokenIds,
string[] memory emojis,
bool[] memory states,
uint256[] memory deadlines
) external view returns (bytes32[] memory);
/**
* @notice Used to emote or undo an emote on a token.
* @dev Does nothing if attempting to set a pre-existent state.
* @dev MUST emit the `Emoted` event is the state of the emote is changed.
* @param collection Address of the collection containing the token being emoted at
* @param tokenId ID of the token being emoted
* @param emoji Unicode identifier of the emoji
* @param state Boolean value signifying whether to emote (`true`) or undo (`false`) emote
*/
function emote(
address collection,
uint256 tokenId,
string memory emoji,
bool state
) external;
/**
* @notice Used to emote or undo an emote on multiple tokens.
* @dev Does nothing if attempting to set a pre-existent state.
* @dev MUST emit the `Emoted` event is the state of the emote is changed.
* @dev MUST revert if the lengths of the `collections`, `tokenIds`, `emojis` and `states` arrays are not equal.
* @param collections An array of addresses of the collections containing the tokens being emoted at
* @param tokenIds An array of IDs of the tokens being emoted
* @param emojis An array of unicode identifiers of the emojis
* @param states An array of boolean values signifying whether to emote (`true`) or undo (`false`) emote
*/
function bulkEmote(
address[] memory collections,
uint256[] memory tokenIds,
string[] memory emojis,
bool[] memory states
) external;
/**
* @notice Used to emote or undo an emote on someone else's behalf.
* @dev Does nothing if attempting to set a pre-existent state.
* @dev MUST emit the `Emoted` event is the state of the emote is changed.
* @dev MUST revert if the lengths of the `collections`, `tokenIds`, `emojis` and `states` arrays are not equal.
* @dev MUST revert if the `deadline` has passed.
* @dev MUST revert if the recovered address is the zero address.
* @param emoter The address that presigned the emote
* @param collection The address of the collection smart contract containing the token being emoted at
* @param tokenId IDs of the token being emoted
* @param emoji Unicode identifier of the emoji
* @param state Boolean value signifying whether to emote (`true`) or undo (`false`) emote
* @param deadline UNIX timestamp of the deadline for the signature to be submitted
* @param v `v` value of an ECDSA signature of the message obtained via `prepareMessageToPresignEmote`
* @param r `r` value of an ECDSA signature of the message obtained via `prepareMessageToPresignEmote`
* @param s `s` value of an ECDSA signature of the message obtained via `prepareMessageToPresignEmote`
*/
function presignedEmote(
address emoter,
address collection,
uint256 tokenId,
string memory emoji,
bool state,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external;
/**
* @notice Used to bulk emote or undo an emote on someone else's behalf.
* @dev Does nothing if attempting to set a pre-existent state.
* @dev MUST emit the `Emoted` event is the state of the emote is changed.
* @dev MUST revert if the lengths of the `collections`, `tokenIds`, `emojis` and `states` arrays are not equal.
* @dev MUST revert if the `deadline` has passed.
* @dev MUST revert if the recovered address is the zero address.
* @param emoters An array of addresses of the accounts that presigned the emotes
* @param collections An array of addresses of the collections containing the tokens being emoted at
* @param tokenIds An array of IDs of the tokens being emoted
* @param emojis An array of unicode identifiers of the emojis
* @param states An array of boolean values signifying whether to emote (`true`) or undo (`false`) emote
* @param deadlines UNIX timestamp of the deadline for the signature to be submitted
* @param v An array of `v` values of an ECDSA signatures of the messages obtained via `prepareMessageToPresignEmote`
* @param r An array of `r` values of an ECDSA signatures of the messages obtained via `prepareMessageToPresignEmote`
* @param s An array of `s` values of an ECDSA signatures of the messages obtained via `prepareMessageToPresignEmote`
*/
function bulkPresignedEmote(
address[] memory emoters,
address[] memory collections,
uint256[] memory tokenIds,
string[] memory emojis,
bool[] memory states,
uint256[] memory deadlines,
uint8[] memory v,
bytes32[] memory r,
bytes32[] memory s
) external;
}Event
Emoted
event Emoted(
address indexed emoter,
address indexed collection,
uint256 indexed tokenId,
string emoji,
bool on
);Overview
An event notifying listeners that an emoji reaction to a token with a particular ID has been added or removed.
Details
This event should be emitted only when the state of an emoji reaction to a token changes. This makes additions and removals of emoji reactions traceable on the blockchain.
Parameters
emoter- The address of the account that added or removed the emoji reaction.
collection- The smart contract address of the collection containing the token that received the reaction.
tokenId- The ID of the token that received the reaction.
emoji- The Unicode identifier of the emoji.
on- A Boolean indicating that a reaction was added (
true) or removed (false).
- A Boolean indicating that a reaction was added (
Functions
emoteCountOf
function emoteCountOf(
address collection,
uint256 tokenId,
string memory emoji
) external view returns (uint256);Overview
Retrieves the number of emotes (reactions) to a token for a particular emoji.
Details
The function returns the number of emotes using the specified emoji for the specified token.
Arguments
collection- The smart contract address of the collection containing the token.
tokenId- The ID of the token whose emote count is being queried.
emoji- The Unicode identifier of the emoji.
Return Value
- The number of emotes for the token using the specified emoji.
bulkEmoteCountOf
function bulkEmoteCountOf(
address[] memory collections,
uint256[] memory tokenIds,
string[] memory emojis
) external view returns (uint256[] memory);Overview
Retrieves emote counts for specified emoji across multiple tokens in a batch.
Details
The function returns an array of counts of emotes using the specified emoji for multiple tokens.
Arguments
collections- An array of smart contract addresses for the collections containing the tokens.
tokenIds- An array of IDs of the tokens whose emote counts are being queried.
emojis- An array of Unicode identifiers for the emoji.
Return Value
- An array of emote counts for the tokens using the specified emoji.
hasEmoterUsedEmote
function hasEmoterUsedEmote(
address emoter,
address collection,
uint256 tokenId,
string memory emoji
) external view returns (bool);Overview
Checks whether a specified address has used a specified emoji to react to a particular token.
Details
The function returns a Boolean indicating whether the specified address has emoted on the specified token with the specified emoji.
Arguments
emoter- The address of the account whose emote status is being checked.
collection- The smart contract address of the collection containing the token.
tokenId- The ID of the token whose emote status is being checked.
emoji- The Unicode identifier of the emoji.
Return Value
- A Boolean indicating whether the specified address has used the specified emoji to react to the specified token.
haveEmotersUsedEmotes
function haveEmotersUsedEmotes(
address[] memory emoters,
address[] memory collections,
uint256[] memory tokenIds,
string[] memory emojis
) external view returns (bool[] memory);Overview
Checks in a batch whether multiple addresses have used specified emoji to react to specified tokens.
Details
The function returns an array of Booleans indicating whether multiple addresses have emoted on multiple tokens with the specified emoji.
Arguments
emoters- An array of account addresses whose emote status is being checked.
collections- An array of smart contract addresses for the collections containing the tokens.
tokenIds- An array of token IDs whose emote status is being checked.
emojis- An array of Unicode identifiers for the emoji.
Return Value
- An array of Booleans indicating whether the specified addresses have used the specified emoji to react to the specified tokens.
prepareMessageToPresignEmote
function prepareMessageToPresignEmote(
address collection,
uint256 tokenId,
string memory emoji,
bool state,
uint256 deadline
) external view returns (bytes32);Overview
Retrieves the message that an emoter must sign to allow someone else to submit an emote.
Details
The function generates a message containing the parameters required to emote and returns it as bytes for signing.
Arguments
collection- The smart contract address of the collection containing the token.
tokenId- The ID of the token receiving the emote.
emoji- The Unicode identifier of the emoji.
state- A Boolean indicating whether to add (
true) or remove (false) an emote.
- A Boolean indicating whether to add (
deadline- A UNIX timestamp specifying the deadline for submitting the signature.
Return Value
- The message that the emoter must sign to allow someone else to submit the emote.
bulkPrepareMessagesToPresignEmote
function bulkPrepareMessagesToPresignEmote(
address[] memory collections,
uint256[] memory tokenIds,
string[] memory emojis,
bool[] memory states,
uint256[] memory deadlines
) external view returns (bytes32[] memory);Overview
Retrieves the messages an emoter must sign to allow someone else to submit reactions to multiple tokens.
Details
The function generates the messages an emoter must sign to allow another party to submit reactions to multiple tokens, and returns them as an array.
Arguments
collections- An array of smart contract addresses for the collections containing the tokens.
tokenIds- An array of IDs of the tokens receiving emotes.
emojis- An array of Unicode identifiers for the emoji.
states- An array of Booleans indicating whether to add (
true) or remove (false) emotes.
- An array of Booleans indicating whether to add (
deadlines- An array of UNIX timestamps specifying deadlines for submitting the signatures.
Return Value
- An array of messages that the emoter must sign to allow someone else to submit the emotes.
emote
function emote(
address collection,
uint256 tokenId,
string memory emoji,
bool state
) external;Overview
Adds or removes an emote on a token.
Details
The function adds or removes an emote on the specified token.
The Emoted event is emitted only when the emote state changes.
Arguments
collection- The smart contract address of the collection containing the token.
tokenId- The ID of the token receiving the emote.
emoji- The Unicode identifier of the emoji.
state- A Boolean indicating whether to add (
true) or remove (false) an emote.
- A Boolean indicating whether to add (
bulkEmote
function bulkEmote(
address[] memory collections,
uint256[] memory tokenIds,
string[] memory emojis,
bool[] memory states
) external;Overview
Adds or removes emotes on multiple tokens in a batch.
Details
The function adds or removes emotes on multiple tokens in one operation.
The Emoted event is emitted only when the emote state changes.
The operation fails if the argument arrays have different lengths.
Arguments
collections- An array of smart contract addresses for the collections containing the tokens.
tokenIds- An array of IDs of the tokens receiving emotes.
emojis- An array of Unicode identifiers for the emoji.
states- An array of Booleans indicating whether to add (
true) or remove (false) emotes.
- An array of Booleans indicating whether to add (
presignedEmote
function presignedEmote(
address emoter,
address collection
,
uint256 tokenId,
string memory emoji,
bool state,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external;Overview
Adds or removes an emote on behalf of someone else.
Details
The function adds or removes an emote on behalf of another person based on a signed message. The operation fails if the signed message is invalid or has expired.
Arguments
emoter- The address of the account that signed the emote in advance.
collection- The smart contract address of the collection containing the token.
tokenId- The ID of the token receiving the emote.
emoji- The Unicode identifier of the emoji.
state- A Boolean indicating whether to add (
true) or remove (false) an emote.
- A Boolean indicating whether to add (
deadline- A UNIX timestamp specifying the deadline for submitting the signature.
v,r,s- The components of the ECDSA signature.
bulkPresignedEmote
function bulkPresignedEmote(
address[] memory emoters,
address[] memory collections,
uint256[] memory tokenIds,
string[] memory emojis,
bool[] memory states,
uint256[] memory deadlines,
uint8[] memory v,
bytes32[] memory r,
bytes32[] memory s
) external;Overview
Adds or removes emotes on multiple tokens in a batch on behalf of others.
Details
The function adds or removes emotes on multiple tokens on behalf of others in a batch, based on signed messages. The operation fails if a signed message is invalid or has expired.
Arguments
emoters- An array of addresses of accounts that signed the emotes in advance.
collections- An array of smart contract addresses for the collections containing the tokens.
tokenIds- An array of IDs of the tokens receiving emotes.
emojis- An array of Unicode identifiers for the emoji.
states- An array of Booleans indicating whether to add (
true) or remove (false) emotes.
- An array of Booleans indicating whether to add (
deadlines- An array of UNIX timestamps specifying deadlines for submitting the signatures.
v,r,s- An array of ECDSA signature components.
Signed Message Format
This section describes the format of the signed message required for another person to register an emoji reaction to an NFT on the emoter's behalf.
The person reacting to an NFT with emoji (the emoter) signs a message containing specific information to register the reaction in a smart contract.
keccak256(
abi.encode(
DOMAIN_SEPARATOR,
collection,
tokenId,
emoji,
state,
deadline
)
);This message includes the following elements.
DOMAIN_SEPARATOR- The domain separator of the emotable repository smart contract.
- It serves as a kind of contract identifier.
collection- The address of the collection containing the token receiving the emote.
- This identifies the NFT collection receiving the reaction.
tokenId- The ID of the token receiving the emote.
- This identifies the specific NFT receiving the reaction.
emoji- The Unicode identifier of the emoji.
- This specifies the emoji used for the reaction.
state- A Boolean indicating whether to add (
true) or remove (false) the emoji reaction.
- A Boolean indicating whether to add (
deadline- A UNIX timestamp specifying the deadline for submitting the signature.
- This sets the signature's validity deadline.
DOMAIN_SEPARATOR is generated from the name ERC-7409: Public Non-Fungible Token Emote Repository, version 1, the blockchain ID, and the contract address.
Contracts deployed on different blockchains therefore have different domain separators.
keccak256(
abi.encode(
"ERC-7409: Public Non-Fungible Token Emote Repository",
"1",
block.chainid,
address(this)
)
);Emotable Repository Address
The emotable repository address is predetermined and specially designed to reflect the functionality offered by the contract.
Its address begins with 0x3110735, a sequence resembling the word EMOTES.
The address is 0x3110735F0b8e71455bAe1356a33e428843bCb9A1.
This is the address of the emotable repository smart contract, used to interact with it. The address begins with a sequence reminiscent of EMOTES because the contract handles emoji reactions to NFTs. This design makes the purpose of the contract recognizable.
Additional Details
Custom Emoji or Unicode Emoji Only?
The proposal accepts Unicode identifiers (strings) only. This encourages standard emoji while still allowing values outside the Unicode standard to be used as custom emoji. However, interfaces must know the corresponding images to display custom emoji, so their use may be limited.
Expressing Impressions Through Emoji
The proposal considered representing impressions using user-provided strings or numbers, but chose emoji because they are an established way to convey feelings and impressions.
Emotable Extension or Shared Repository?
The initial plan was to create an emotable extension for ERC721-compliant tokens, but a shared repository was considered more useful. This allows users to emote on both new tokens and older tokens that existed before the proposal.
Single Actions, Multiple Actions, or Both?
The proposal considered supporting single actions only, but ultimately includes both single and multiple actions. Users can therefore react to one token or multiple tokens at once.
Emoting on Behalf of Others
Although not originally planned, the ability to emote on behalf of another person was considered useful and included in the proposal. This allows users to submit emotes on behalf of others.
Ensuring Authorization When Emoting on Behalf of Others
ECDSA signatures ensure that a user has consented to someone else submitting an emote on their behalf. The user signs a message containing the emote details, and another person can submit it.
Adding a Chain ID to Token Reactions
During discussion, adding a chain ID parameter was proposed, but it was rejected because it would introduce additional costs and was expected to be rarely used.
Using bytes4 or Strings to Represent Emoji
The initial plan used bytes4, but some emoji require eight bytes or more, so the proposal uses strings instead.
This also accommodates emoji that may be added to the Unicode standard in the future.
These design decisions address the future compatibility problems of ERC6381.
Backwards Compatibility
The emote repository standard is fully compatible with ERC721 tokens. It can be used with the established tooling and infrastructure developed for ERC721 tokens.
The emote repository standard integrates smoothly with ERC721 tokens and is compatible with existing ERC721 tools and contract designs. This compatibility allows developers to add emote repository functionality to existing ERC721-based projects easily, providing a richer user experience.
Tests
The test files are available below.
https://eips.ethereum.org/assets/eip-7409/test/emotableRepository.ts
The following command runs the tests.
cd ../assets/eip-7409
npm install
npx hardhat testReference Implementation
The reference implementation is available in the following file.
https://eips.ethereum.org/assets/eip-7409/contracts/EmotableRepository.sol
Security Considerations
Because the proposed emote repository does not handle user assets directly, interacting with it does not expose those assets to risk.
Emoting on behalf of others using ECDSA signatures introduces a risk of replay attacks (unauthorized reuse of the same signature).
The signed message format protects against this risk.
The DOMAIN_SEPARATOR included in the signature is specific to the blockchain on which the smart contract is deployed, so signatures are invalid on other chains.
If a replay attack is attempted, the emote repository should revert the operation.
Reuse of signed messages must also be considered. Because the message contains a signature expiration time, it can be reused any number of times before the deadline. The proposal allows only one reaction per emoji on a token, so signed messages cannot be abused to artificially inflate a token's reaction count. However, if a service using the repository removes reactions after a particular action, a valid signed message may be reused to react to the token again. Services using the repository should therefore set short deadlines for pre-signed messages.
Finally, exercise caution when interacting with unaudited contracts. This is a general precaution against security risks.
Citation
Bruno Škvorc (@Swader), Steven Pineda (@steven2308), Stevan Bogosavljevic (@stevyhacker), Jan Turk (@ThunderDeliverer), "ERC-7409: Public Non-Fungible Tokens Emote Repository," Ethereum Improvement Proposals, no. 7409, July 2023. [Online serial]. Available: https://eips.ethereum.org/EIPS/eip-7409.
Conclusion
This article covered ERC7409, which proposes extending ERC6381 with batch operations and support for a wider range of emoji. I hope you found it useful.
If you have questions, feel free to contact me by direct message on Twitter.
I also share information on other platforms, so feel free to explore them.


