eip: 4906
title: ERC-721/ERC-1155 Metadata Update Extension
description: Standard interface extension for ERC-721/ERC-115 metadata update
author: Anders (@0xanders)
discussions-to:
status: Draft
type: Standards Track
category: ERC
created: 2022-03-13
requires: 721 or 1155
Abstract
This specification defines standard metadata update event of ERC-721and ERC-1155. The proposal depends on and extends the existing ERC-721 and ERC-1155.
Motivation
Many ERC-721 and ERC-1155 contracts emit their custom event when metadata changed.It is easy to update metadata of one NFT by specific event, but it is difficult for third-party platforms such as NFT marketplace to update metadata of many NFTs based on custom events.
Having a standard MetadataUpdate
event will make it easy for third-party platforms to timely update metadata of many NFTs.
Specification
The keywords âMUSTâ, âMUST NOTâ, âREQUIREDâ, âSHALLâ, âSHALL NOTâ, âSHOULDâ, âSHOULD NOTâ, âRECOMMENDEDâ, âMAYâ, and âOPTIONALâ in this document are to be interpreted as described in RFC 2119.
The metadata update extension is OPTIONAL for ERC-721/ERC-1155 contracts.
/// @title ERC-721/ERC-1155 Metadata Update Extension
interface IERC4906MetadataUpdate {
/// @dev This event emits when the metadata of a token is changed.
/// So that the third-party platforms such as NFT market could
/// timely update the images and related attributes of the NFT
event MetadataUpdate(uint256 indexed _tokenId);
}
The MetadataUpdate
event MUST be emitted when the metadata of a token is changed.
Rationale
Different NFTs have different metadata, and metadata generally has multiple fields. bytes data
could be used to represents the modified value of metadata. It is difficult for third-party platforms to identify various types of bytes data
, so there is only one parameter uint256 indexed _tokenId
in MetadataUpdate
event.
After capturing the MetadataUpdate
event, a third party can update the metadata with information returned from the tokenURI(uint256 _tokenId)
of ERC721 or uri(uint256 _tokenId)
of ERC1155.
Backwards Compatibility
No issues.
Copyright
Copyright and related rights waived via CC0.