ERC-4955 · Final · ERC · 2022-03-29
ERC-4955: Vendor Metadata Extension for NFTs
Adds a `namespaces` field to ERC-721/ERC-1155 metadata JSON so each platform (a game, a metaverse, a marketplace) can keep its own rendering data for an NFT without clashing with others.
What problem does it solve?
NFT metadata (the JSON behind tokenURI / uri) has a few standard fields: name, description, image. That is enough for a 2D marketplace thumbnail but not for platforms that render NFTs in their own way. A metaverse needs a 3D model rigged to its skeleton, plus engine-specific settings, and every platform's format is different. There is no shared "3D style" that would work everywhere.
Without a convention, projects either invent ad-hoc top-level keys that may collide, or keep platform data off to the side where other tools cannot find it.
How it works
The standard adds one optional property, namespaces, to the metadata JSON schema of ERC-721 and ERC-1155. It is an object with one key per vendor or project. The value under each key is either:
- an object with whatever properties that vendor needs, or
- a URI pointing to that vendor's data, to keep the main JSON small.
A platform looks up its own key and ignores the rest. Nothing changes in the token contract: it is purely a metadata convention, so existing NFTs can adopt it by updating the JSON they serve.
Sample code
Metadata with two vendor namespaces, one inline and one by URI:
{
"name": "My NFT",
"description": "NFT description",
"image": "ipfs://<image-cid>",
"namespaces": {
"exampleMetaverse": {
"model": "ipfs://<glb-cid>",
"category": "upper_body"
},
"exampleGame": "ipfs://<game-config-cid>"
}
}
Reading your platform's data (TypeScript):
const meta = await (await fetch(tokenUri)).json();
const ns = meta.namespaces?.["exampleGame"];
const data = typeof ns === "string" ? await (await fetch(ns)).json() : ns;
Things to know
- Status: Final.
- Platforms should ignore namespaces they do not recognize, and must not assume another vendor's data follows any shared format: the whole point is that each namespace is vendor-specific.
- Namespace names are not registered anywhere; vendors pick their own keys, so choose a distinctive one.
- Projects whose metadata cannot be changed can, per the spec, point to a new contract or service that returns the extended schema, but platforms have to accept that link.
- The usual metadata caveats apply: HTTP gateways and IPFS availability affect whether the data can actually be loaded.