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 ERC-5560, a proposal for determining whether an NFT can be redeemed for a physical item.
This explanation translates, summarizes, and expands on the following specification.
For more EIPs, see https://cardene.dev/proposals.
Overview
ERC-5560 proposes adding redemption functionality to ERC-721 NFTs. It is intended for issuers that want holders to exchange NFTs for physical goods.
Motivation
Artists, high-end galleries, auction houses, and brands increasingly use NFTs to offer physical goods. For example, a holder of an NFT representing a painting might be entitled to receive the original painting. ERC-5560 addresses this need by making an NFT's redeemable status explicit.
Specification
import '@openzeppelin/contracts/utils/introspection/ERC165.sol';
/**
* @dev Implementation of Redeemable for ERC-721s
*
*/
interface IRedeemable is ERC165 {
/*
* ERC165 bytes to add to interface array - set in parent contract implementing this standard
*
* bytes4 private constant _INTERFACE_ID_ERC721REDEEM = 0x2f8ca953;
*/
/// @dev This event emits when a token is redeemed.
event Redeem(address indexed from, uint256 indexed tokenId);
/// @notice Returns the redeem status of a token
/// @param tokenId Identifier of the token.
function isRedeemable(uint256 _tokenId) external view returns (bool);
/// @notice Redeeem a token
/// @param tokenId Identifier of the token to redeeem
function redeem(uint256 _tokenId) external;
}An ERC-721 NFT contract may implement this optional extension to determine whether an NFT is redeemable and execute redemption.
Issuers Decide Who Can Redeem
Issuers must decide who may redeem an NFT. Rather than allowing anyone to execute redeem, appropriate access control is important.
Checking Redeemability
Anyone can call isRedeemable to check whether a specific NFT is redeemable.
- If it is redeemable, the function returns true.
- If it has already been redeemed, the function returns false.
Integration with External Services
External services supporting ERC-5560, such as marketplaces, can use the Redeem event to detect changes in redemption status. They may, for example, prevent already redeemed NFTs from being traded on their marketplaces.
Functions
Compliant implementations provide the following functions and event.
-
isRedeemable(uint256 _tokenId)Returns whether the specified NFT is redeemable.
-
redeem(uint256 _tokenId)Executes the redemption operation.
-
event Redeem(address indexed from, uint256 indexed tokenId)Emitted when redemption occurs.
ERC-165
The supportsInterface function allows external callers to detect support for ERC-5560 (IRedeemable). It must return true when passed interface ID 0x2f8ca953.
For ERC-165, see the following article.
ERC-165 Explained: Checking Whether a Contract Supports an Interface
Additional Considerations
Default Behavior
In the described implementation, NFTs start in the redeemable state, so isRedeemable returns true for unredeemed tokens. Unless access restrictions are added, the public redeem function may be called by anyone. Restricting who may redeem is strongly recommended.
Recommended Access Control
Unrestricted redemption risks allowing someone other than the legitimate holder to redeem the token. A common approach is to check token ownership using require.
require(ownerOf(tokenId) == msg.sender, "ERC721Redeemable: You are not the owner of this token");State After Redemption
After redeem executes successfully, isRedeemable returns false for that token, indicating that it has already been redeemed.
Redeem Event
When redemption occurs, the following event must be emitted.
event Redeem(address indexed from, uint256 indexed tokenId);External services and DApps can track who redeemed which NFT. A marketplace might remove a redeemed NFT from its listings.
Backward Compatibility
ERC-5560 is compatible with ERC-721.
Reference Implementation
contract ERC721Redeemable is ERC721, Redeemable {
constructor(string memory name, string memory symbol) ERC721(name, symbol) {
}
function isRedeemable(uint256 tokenId) public view virtual override returns (bool) {
require(_exists(tokenId), "ERC721Redeemable: Redeem query for nonexistent token");
return super.isRedeemable(tokenId);
}
function redeem(uint256 tokenId) public virtual override {
require(_exists(tokenId), "ERC721Redeemable: Redeem query for nonexistent token");
require(ownerOf(tokenId) == msg.sender, "ERC721Redeemable: You are not the owner of this token");
super.redeem(tokenId);
}
function supportsInterface(bytes4 interfaceId) public view override(ERC721, Redeemable) returns (bool) {
return super.supportsInterface(interfaceId);
}
}Citation
Olivier Fernandez (@fernandezOli), Frédéric Le Coidic (@FredLC29), Julien Béranger (@julienbrg), "ERC-5560: Redeemable NFTs [DRAFT]," Ethereum Improvement Proposals, no. 5560, August 2022. [Online serial]. Available: https://eips.ethereum.org/EIPS/eip-5560.
Conclusion
ERC-5560 provides a standard way to query and update NFT redemption status for use cases involving physical items.
Further reading and author links:




