ERC-8495 Token metadata JSON schema (Token Metadata JSON Schema and Processing)
Draft · Names & metadata · created 2026-10-26
Consolidates into a single standard the format of the JSON document returned by an NFT or token's tokenURI, and how wallets and marketplaces should safely fetch, interpret, and display it.
Why it is needed
ERC-721 defines only name, description, and image, and ERC-1155 defines only decimals, properties, and localization. Beyond that, things wallets and marketplaces display, such as video, HTML, and traits (attributes), were only ever documented by OpenSea in 2018 and were never standardized. As a result, clients handle differently whether a trait value is boolean, numeric, or a string, whether a date is in seconds or milliseconds, which URI schemes to read, and how to sandbox HTML. Proposals that add metadata fields, such as ERC-5625, also had no baseline document to build on and no rules for how to name fields or what older clients should display.
In depth
Display fields and default handling rules
A metadata document has the fields name, description, image, animation_url, external_url, background_color, and attributes. All are optional; creators are encouraged to include name and image, and should omit a field rather than set it to null or an empty string when there is no value. Clients must treat null and empty strings as absent, ignore unknown fields, ignore fields of the wrong type while still reading the rest, and use the last value when a member name repeats within an object. name is plain text and must not be interpreted as markdown or HTML; description may use CommonMark markdown but must not render raw HTML, and it is recommended not to load remote images referenced within it.
URI scheme resolution rules
Clients must resolve https, ipfs, ar (Arweave), and data URIs; they may optionally support ipns or ERC-4804's web3 scheme; and they must not resolve schemes that execute code or read local resources, such as javascript or file. Creators are encouraged to use absolute URIs, to use ipfs, ar, or data for content that will not change, and are discouraged from using http. An ipfs URI must take the form ipfs://<cid> and must not be written as a gateway URL instead. Clients must convert a gateway URL such as https://<host>/ipfs/<cid> into an ipfs URI retaining only the CID and path, and if content cannot be found by CID they may fall back to the original URL including its query string and fragment, but must not use that fallback if verification fails. When fetching ipfs content from an untrusted gateway, it is recommended to request raw blocks or a CAR file and verify them against the CID.
Procedure for handling data URIs and metadata URIs
The data URI an author uses must conform to RFC 2397, and for the metadata JSON it is recommended to use application/json with base64 encoding. Clients must accept data URIs that follow the spec, and it is recommended that they also accept non-standard forms such as unencoded payloads. Processing a metadata URI has 8 steps: trim leading and trailing whitespace; if it starts and ends with curly braces, treat it as the JSON document itself; for ERC-1155, substitute {id} with the hexadecimal token ID and convert ipfs://ipfs/<cid> and gateway URLs into an ipfs URI; for a data URI, if it is not base64, replace # with %23 and then read it with the Fetch standard's data: URL handler; if the scheme is unsupported, treat it as no document; otherwise fetch and validate per the Resolving URIs rules; decode the bytes as UTF-8; parse as JSON, and if the result is not an object, treat it as no document; finally, some clients retry once with a decimal token ID if there is no document after the hexadecimal substitution.
Rules for the attributes trait field
attributes is an array of trait objects. trait_type is the trait name and is recommended; value must be a string or number and is required. A quoted "5" is a string trait, while 5 is a numeric trait. display_type specifies the display mode as one of absent, string or text (equivalent to absent), number, boost_number, boost_percentage, or date, and an unknown display_type must be treated as absent. For number, boost_number, boost_percentage, and date, value must be numeric, and a decimal given as a string may also be accepted. max_value applies only to numeric traits and must be greater than or equal to value. date is in seconds aligned with block.timestamp, and values of 1000000000000 or greater are recommended to be read as milliseconds. If the same trait_type repeats, it becomes a single trait with multiple values, and string values are recommended to be trimmed of leading/trailing whitespace and compared exactly. If an attribute conflicts with a value from an interface the contract declares via ERC-165, it is recommended to show the contract's value.
animation_url and HTML isolation
animation_url holds video, audio, a 3D model, or an HTML page, shown in place of image on the detail screen. Supported media types are video/mp4, video/x-m4v, video/webm, video/ogg for video; audio/mpeg, audio/wav, audio/ogg for audio; model/gltf-binary and model/gltf+json for 3D models; and text/html for interactive content. If a client cannot render animation_url, it must fall back to image, and for audio it is recommended to show image as cover art. A client that renders an HTML page must isolate it from its own origin, for example with a sandboxed iframe that has allow-scripts but not allow-same-origin, must not expose a wallet provider or signing interface, and is recommended to block popups and top-level navigation. image must not be rendered as a document, and if the Content-Type or the data URI indicates an HTML media type, it is recommended to treat image as absent.
Metadata update events
When a document changes, an ERC-721 contract is recommended to emit ERC-4906's MetadataUpdate event, and an ERC-1155 contract may also emit the same MetadataUpdate for a single token ID or BatchMetadataUpdate for a range. The existing requirement that ERC-1155 must emit a URI event when the URI changes still applies. A client that caches documents is recommended to refetch the document on receiving these events, and for a batch update, to select cached token IDs within that range, though not every ID in the range is guaranteed to actually exist. A client that caches media is recommended to also refetch the media when refetching the document, even if the URI has not changed, except for content-addressed URIs such as ipfs, ar, and data.
Rules for extension proposals adding fields
A proposal that adds fields to the metadata document must list this proposal (ERC-8495) in requires, must disclose every top-level field name it defines, and is recommended to define each as a single top-level object field. Field names should use only lowercase ASCII letters, digits, and underscores, and are recommended to start with a letter. An extension must not change the meaning or type of a field defined by this proposal or by another extension, but may define a new display_type or a new attribute field. A document using an extension must still conform to this proposal; a client unaware of the extension must ignore that field, and a client that recognizes it is recommended to prioritize the extension data over the base field. This proposal is currently in Draft status and has not yet been finalized, so it may still change or be withdrawn.
Things to watch out for
- HTML and SVG script isolation: HTML or SVG images in animation_url can execute scripts. If rendered within the client's own origin, they could access cookies, storage, and a connected wallet, so the isolation rules above must be followed. An image URL could also later, for example after the domain expires, start serving HTML, so a client must never render image as a document.
- Phishing links: Links in description and external_url can lead to phishing pages. Clients are recommended to follow only https links and to display the destination domain.
- Internal network access (SSRF) risk: Indexers fetch the URI chosen by the contract deployer, and without the address checks in the Fetching section, a URI or a redirect could reach an internal service such as a cloud instance metadata endpoint.
- Trait manipulation before settlement: A document served over https can change between a buyer's decision and settlement, letting a seller alter attributes to fill a trait offer and then revert them. A content-addressed URI changes only when the contract returns a new URI, so protocols that settle based on traits are recommended to read the on-chain value.
- Gateway verification and token identification: A gateway can return content that does not match the requested CID, so a content-addressed URI only provides protection if the client itself verifies the fetched content against the CID. Comparing against a CID the gateway reports about itself is not verification. Anyone can copy another collection's name and image, so clients are recommended to identify a token by chain, contract, and token ID rather than by its metadata.