ERC-3569 · Stagnant · ERC · 2021-05-07
ERC-3569: Sealed NFT Metadata Standard
A stagnant NFT extension that lets a creator permanently "seal" the metadata for a range of tokens behind one decentralized-storage URI, so collectors can verify it will never change.
What problem does it solve?
ERC-721's tokenURI returns a link per token, often to a server the creator controls. Nothing stops that server, or a contract owner, from changing the image or attributes later — a "metadata rug pull". Updating metadata token by token is also expensive at scale.
ERC-3569 adds an opt-in seal: once a token range is sealed, the contract records a single URI (ideally on IPFS or similar) holding the metadata for all those tokens, and promises it can never be sealed again. Creators can still iterate before sealing, then lock things down when ready.
How it works
The extension interface:
seal(fromTokenId, toTokenId, uri)— seals a consecutive range (use the same ID twice for one token). It must revert if any token in the range is already sealed, and must emitSealed. Restricting who can call it is recommended but left to the implementer.sealedURI(tokenId)— returns the sealed URI; reverts if the token does not exist or is not sealed.isSealed(tokenId)— returns whether the token is sealed.event Sealed(fromTokenId, toTokenId, uri)— lets indexers and marketplaces cache metadata automatically.
The sealed file is a JSON object whose keys are token IDs. Each value is either inline metadata or a URI to a per-token file. The contract does not check that the URI is on decentralized storage; collectors and platforms are expected to verify that themselves.
Sample code
A sealed metadata file:
{
"1": { "name": "Metadata for token 1", "image": "ipfs://<cid>/1.png" },
"2": { "name": "Metadata for token 2" },
"3": "ipfs://<cid>/3.json"
}
Minimal Solidity implementation of the extension:
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
abstract contract SealedMetadata {
event Sealed(uint256 indexed fromTokenId, uint256 indexed toTokenId, string uri);
mapping(uint256 => string) private _sealed;
function _exists(uint256 tokenId) internal view virtual returns (bool);
function _seal(uint256 fromId, uint256 toId, string memory uri) internal {
require(fromId <= toId, "range");
for (uint256 id = fromId; id <= toId; id++) {
require(_exists(id), "nonexistent");
require(bytes(_sealed[id]).length == 0, "already sealed");
_sealed[id] = uri;
}
emit Sealed(fromId, toId, uri);
}
function isSealed(uint256 tokenId) public view returns (bool) {
require(_exists(tokenId), "nonexistent");
return bytes(_sealed[tokenId]).length != 0;
}
function sealedURI(uint256 tokenId) external view returns (string memory) {
require(isSealed(tokenId), "not sealed");
return _sealed[tokenId];
}
}
Things to know
- Status is Stagnant; it is not a widely supported marketplace standard.
- The per-token loop above costs gas proportional to the range. A production version would store ranges instead of one entry per token.
- A seal only proves the URI is fixed. If it points to a mutable HTTP server, the content can still change, so check that it is content-addressed (e.g. an IPFS CID).
- For signalling metadata changes rather than freezing them, see ERC-4906.