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.

ERC-7280 proposes a metadata extension that allows NFTs to reference structured data using JSON-LD and other schemas.

This article translates, summarizes, and expands on the following proposal.

More EIP, BIP, SLIP, CAIP, ENSIP, RFC, and ACP explainers:

Overview

ERC-7280 adds support for linked data to the metadata formats associated with ERC-721, ERC-1155, and ERC-3525 tokens. Additional information is represented through a linked_data field in the existing metadata JSON.

For ERC-721, see the following article.

ERC-721: A guide from first principles

For ERC-1155, see the following article.

ERC-1155: A guide from first principles

For ERC-3525, see the following article.

ERC-3525: Understanding semi-fungible tokens

JSON-LD is a JSON-based format for expressing linked data. It allows information to be associated with externally defined vocabularies and relationships so that applications can interpret its meaning rather than merely processing isolated fields.

The extension allows metadata to reference detailed structured information beyond common properties such as an NFT's name and image. Applications supporting the relevant schemas can interpret this information consistently across different services.

The linked_data structure is a metadata extension inspired by JSON-LD, not a requirement that the entire NFT metadata document be a JSON-LD document.

Motivation

Conventional NFT metadata formats provide common fields, but they do not establish a general shared vocabulary for arbitrary structured information. For example, applications may find it difficult to interpret or correlate attributes and descriptions that use project-specific conventions.

Linked data can express semantic relationships and refer to shared external definitions. This makes it easier for applications to exchange and interpret information.

Objective Description
More expressive metadata Represent complex information in a structured form.
Integration with external data Reference shared schemas so other systems can interpret the information.
Broader applications Provide clearer context for assets across different use cases.

The goal is to make NFT metadata more useful and interoperable without replacing the existing token standards.

Specification

The proposal adds a linked_data field to existing metadata JSON. It is an array whose elements are objects containing schema and data fields.

The schema identifies the data definition, while the data object references the corresponding content.

The following example illustrates the metadata structure.

json
{
  "name": "Example NFT",
  "image": "ipfs://example-image",
  "linked_data": [
    {
      "schema": {
        "uri": "https://schema.org/Person",
        "name": "Person",
        "description": "A human individual"
      },
      "data": {
        "uri": "ipfs://example-data",
        "lang": "en-US",
        "name": "Alice",
        "description": "Creator of the asset"
      }
    }
  ]
}

linked_data

When present, linked_data must be an array. Each element contains both a schema object and a data object.

Field Requirement Type Description
schema MUST object Identifies the structured data schema.
data MUST object References the corresponding data.

Schema

The schema object describes an external schema or definition. Its URI identifies the schema, and its name provides a descriptive identifier. A description may also be supplied.

Field Requirement Type Description
uri MUST string Schema URI.
name MUST string Schema name.
description OPTIONAL string Schema description.

Data

The data object identifies the actual content. Its URI points to the data, and an optional language tag uses an IETF language-tag format, such as en-US. A name and description can also be included.

Field Requirement Type Description
uri MUST string Data URI.
lang OPTIONAL string Language of the data, expressed as an IETF language tag.
name OPTIONAL string Data name.
description OPTIONAL string Data description.

This structure lets applications discover additional structured information and its associated schema without changing the existing metadata fields.

Rationale

ERC-7280 can help applications generate conventional Web pages for NFTs by referencing JSON-LD data. Search engines and other consumers can interpret supported structured data embedded in those pages.

An application could follow this process:

  1. Identify an element in the NFT metadata's linked_data array that references suitable JSON-LD.
  2. Obtain its data URI.
  3. Retrieve and validate the JSON-LD content from that URI.
  4. Safely embed the validated JSON-LD in the HTML head of the NFT's Web page.

This can allow an NFT creator to provide structured information that influences how a search engine interprets the page. It does not guarantee indexing, rich results, or a particular search-result presentation.

More generally, the extension allows different schemas and their associated data to be referenced through the same metadata document. Applications can use recognized schemas to understand field semantics and treat NFT metadata as a discovery point for additional data sources.

The referenced data remains external unless it is embedded in a data URI or otherwise stored within the metadata itself. Applications must account for resource availability, mutability, and integrity.

Compatibility

ERC-7280 is designed to remain backward compatible by adding an optional metadata field.

  • Existing NFTs that use conventional metadata formats do not need to be modified.
  • Metadata without linked_data can continue to be handled as before.
  • Applications that ignore unknown metadata fields can continue retrieving and using the existing fields without implementing the extension.

Supporting the new field is therefore an application-level decision. Applications implementing strict validation of unknown fields may need to update their validators.

Reference implementation

The proposal illustrates how multiple linked data entries can be associated with a single NFT metadata document.

json
{
  "name": "NFT Name",
  "description": "This NFT represents...",
  "image": "https://example.org/images/nft.png",
  "linked_data": [
    {
      "schema": {
        "name": "VideoObject",
        "uri": "https://example.org/schemas/VideoObject.json"
      },
      "data": {
        "uri": "https://example.org/data/video1.json"
      }
    },
    {
      "schema": {
        "name": "MusicRecording",
        "uri": "https://example.org/schemas/MusicRecording.json"
      },
      "data": {
        "uri": "https://example.org/data/music1.json"
      }
    },
    {
      "schema": {
        "name": "GoogleTravelImpactModel",
        "uri": "https://example.org/schemas/GoogleTravelImpactModel.json"
      },
      "data": {
        "uri": "https://example.org/data/gtim1.json"
      }
    }
  ]
}

This example contains three entries, each with its own schema and data URI. Applications are not restricted to a single schema or use case.

Schema Description
VideoObject Can be used to describe video content through JSON-LD in HTML. Eligible pages may qualify for supported Google rich results when the applicable requirements are met.
MusicRecording Represents music-related information using a schema.org vocabulary. The original example distinguishes it from schemas supported for Google rich results.
GoogleTravelImpactModel Illustrates a specialized schema for a particular application domain.

Search-engine feature support can change over time. The examples above illustrate the proposal's design rather than establish current search eligibility.

Schema file Data file
VideoObject.json video1.json
MusicRecording.json music1.json
GoogleTravelImpactModel.json gtim1.json

Implementers can add references to the schemas and data they need. Consumers must still implement interpretation and validation for the schemas they support.

Security

The proposal builds on the existing model of NFT metadata referencing external resources. These resources must be treated as untrusted input.

  1. Check the provenance and trustworthiness of external data.
  2. Validate the data and its schema before using it.
  3. Apply the same secure handling practices used for ordinary NFT metadata.

Implementations that retrieve external resources should also restrict unsafe URI schemes, avoid unintended server-side requests, impose resource limits, and safely serialize data before embedding it in HTML.

The extension does not itself authenticate claims made by the NFT creator or guarantee that a referenced resource remains unchanged.

Citation

Yohei Nishikubo (@yoheinishikubo), "ERC-7280: NFT Metadata Extension like JSON-LD [DRAFT]," Ethereum Improvement Proposals, no. 7280, July 2023. [Online serial]. Available: https://eips.ethereum.org/EIPS/eip-7280.

Conclusion

ERC-7280 proposes an optional linked data extension for NFT metadata, allowing applications to discover structured information associated with external schemas and data URIs.

Questions are welcome via Twitter @cardene777.

Other publications: