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-5185 proposes a mechanism for updating NFT metadata according to rules defined in advance.

This article translates, summarizes, and expands on the following proposal as discussed in the original April 2025 article. The original code examples, including Japanese placeholders, are preserved.

I also cover other Ethereum improvement proposals.

Overview

ERC-5185 proposes a standard way to update NFT metadata according to predefined rules. Updates cannot be made arbitrarily; they are permitted only through specified recipes (transformation rules). This makes the changes and their order predictable and verifiable.

ERC-5185 is designed as an extension to ERC-721 and ERC-1155. Events emitted when updates occur allow anyone to trace the history of changes.

Motivation

Storing all NFT metadata on-chain can exceed practical limits on the amount of data stored on a blockchain and introduces significant costs.

It is therefore common to store metadata off-chain using a distributed file system such as IPFS. With IPFS, the correspondence between an NFT's tokenId and its metadata can be verified, but an update requires replacing the metadata object as a whole rather than modifying just part of the existing object in place.

Metadata can also be stored in services such as AWS S3, where partial changes are possible.

Individual NFT projects can implement their own solutions, but marketplaces and external tools need a common specification to interpret and process updates correctly.

ERC-5185 allows JSON metadata to be modified incrementally through predefined procedures called recipes. The permissible changes to attributes can be restricted according to the NFT's intended use.

For example, updates to an NFT representing a house could be limited to appending ownership history. A character NFT in a game could allow changes to attributes such as health, experience points, and level, while keeping attributes such as appearance fixed.

The mechanism also accommodates NFTs bridged from Ethereum to L2 networks and allows efficient caching on L2.

Specification

ERC-5185 defines a mechanism for incremental updates to NFT metadata. It is an optional extension for ERC-721 and ERC-1155 tokens. All updates follow predefined recipes, and their history can be observed off-chain through the MetadataUpdates event.

Metadata eligible for updates must conform to the ERC-5185 Updatable Metadata JSON Schema.

Interface

ERC-5185 provides the following interface.

IERC5185UpdatableMetadata.sol
interface IERC5185UpdatableMetadata {
    event MetadataUpdates(string URI);
}

The event emits a URI conforming to RFC 3986 that identifies metadata updates. The URI points to a JSON file describing the changes. Marketplaces and other consumers can apply the updates referenced by these URIs in chronological order to obtain the latest metadata for any tokenId.

Metadata structure

json
{
    "title": "Asset Updatable Metadata",
    "type": "object",
    "properties": {
        "name": {
            "type": "string",
            "description": "Identifies the asset to which this NFT represents"
        },
        "description": {
            "type": "string",
            "description": "Describes the asset to which this NFT represents"
        },
        "image": {
            "type": "string",
            "description": "A URI pointing to a resource with mime type image/* representing the asset to which this NFT represents. Consider making any images at a width between 320 and 1080 pixels and aspect ratio between 1.91:1 and 4:5 inclusive."
        },
        "updatable": {
            "type": "object",
            "required": ["engine", "recipes"],
            "properties": {
                "engine": {
                    "type": "string",
                    "description": "Non ambiguous transformation method/language (with version) to process updates along recipes defined below"
                },
                "schema": {
                    "type": "object",
                    "description": "if present, a JSON Schema that all sequential post transformation updated metadata need to conform. If a transformed JSON does not conform, the update should be considered voided."
                },
                "recipes": {
                    "type": "object",
                    "description": "A catalog of all possibles recipes identified by their keys",
                    "patternProperties": {
                        ".*": {
                            "type": "object",
                            "description": "The key of this object is used to select which recipe to apply for each update",
                            "required": ["eval"],
                            "properties": {
                                "eval": {
                                    "type": "string",
                                    "description": "The evaluation formula to transform the last JSON metadata using the engine above (can take arguments)"
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}

Basic fields

Metadata has the following basic fields.

  • name
    • The NFT's name.
  • description
    • A description of the NFT.
  • image
    • The image URL, with recommended dimensions and aspect ratios.

The updatable section

This section is required for updatable metadata.

json
"updatable": {
  "engine": "...",
  "schema": {...},
  "recipes": {
    "レシピ名": {
      "eval": "更新処理式"
    }
  }
}
  • engine
    • The language or library used to process updates, for example jsonata@1.8.*.
  • schema (optional)
    • A JSON Schema that the updated metadata must conform to.
  • recipes
    • A catalog of available transformation recipes.
    • Each recipe contains an expression called eval.

Update file structure

json
{
    "title": "Metadata Updates JSON Schema",
    "type": "object",
    "properties": {
        "updates": {
            "type": "array",
            "description": "A list of updates to apply sequentially to calculate updated metadata",
            "items": { "$ref": "#/$defs/update" },
            "$defs": {
                "update": {
                    "type": "object",
                    "required": ["tokenId", "recipeKey"],
                    "properties": {
                        "tokenId": {
                            "type": "string",
                            "description": "The tokenId for which the update recipe should apply"
                         },
                        "recipeKey": {
                            "type": "string",
                            "description": "recipeKey to use to get the JSON transformation expression in current metadata"
                        },
                        "args": {
                            "type": "string",
                            "description": "arguments to pass to the JSON transformation"
                        }
                    }
                 }
            }
        }
    }
}

The actual changes are specified in an external JSON file referenced by a URI. Its structure looks like this.

json
{
  "updates": [
    {
      "tokenId": "1",
      "recipeKey": "levelUp",
      "args": "{ \"amount\": 1 }"
    }
  ]
}
  • tokenId
    • The NFT to update.
  • recipeKey
    • The key of the recipe to apply.
  • args
    • Parameters passed to the recipe as a JSON string.

How the update engine works

ERC-5185 defines only one JSON processing engine: JSONata, version 1.8.*.

Updates are processed as follows.

js
const nextMetadata = jsonata(evalString).evaluate(previousMetadata, args)
  • evalString
    • The recipe expression retrieved from the recipes section.
  • previousMetadata
    • The preceding metadata.
  • args
    • Optional arguments.

An update is considered invalid, and the previous metadata is retained, if any of the following occurs.

  • The recipeKey does not exist.
  • An error occurs during processing.
  • A schema is defined and the transformed JSON does not conform to it.

Rationale

Limitations of on-chain storage

Some projects, such as EtherOrcs, attempt to manage NFT metadata entirely on-chain. However, storing and updating JSON metadata on-chain is expensive and slow, creating scalability challenges.

Problems with off-chain storage

Conversely, a URI managed through a conventional web server allows arbitrary metadata updates, but this undermines some of the reasons for using a blockchain. It compromises properties that users expect, such as tamper-resistant metadata and a trustworthy history.

Intermediate approaches using IPFS or Arweave

Many projects use distributed storage such as IPFS or Arweave to obtain a degree of persistence and tamper resistance. This works well for NFTs whose properties do not change, such as static artwork.

However, it is less suited to NFTs whose state changes over time, such as game characters or property deeds. Such NFTs need to reflect changes in state in a recorded history.

Benefits of ERC-5185

ERC-5185 uses predefined procedures to update the original metadata, providing a safe and traceable way to record state changes. The recipes and processing method are included in the initial metadata, and the update history is recorded through on-chain events (MetadataUpdates).

Updates always start from the initial metadata retrieved through tokenURI (ERC-721) or uri (ERC-1155). Anyone can reconstruct the current state by following the history. Because the process is deterministic, caching intermediate results can make recalculation more efficient.

Scalability and gas costs

An update event can record changes to multiple NFTs together, allowing thousands or even millions of updates to be referenced by a single transaction through the external update file. The frequency and timing of events are left to implementers, allowing flexible designs.

The mechanism is gas-efficient: gas is incurred in relation to how often updates are recorded on-chain, while a single event emit can cover changes to many tokens. This reduces operating costs while supporting reliable, transparent metadata updates.

Reference implementation

The JSON transformation language used here is JSONata, version 1.8.*. Below is a simple example for a game NFT called Little Monsters.

json
{
  "name": "Monster 1",
  "description": "Little monsters you can play with.",
  "attributes": [
    { "trait_type": "Level", "value": 0 },
    { "trait_type": "Stamina", "value": 100 }
  ],
  "updatable": {
    "engine": "jsonata@1.8.*",
    "recipes": {
      "levelUp": {
        "eval": "$ ~> | attributes[trait_type='Level'] | {'value': value + 1} |"
      },
      "updateDescription": {
        "eval": "$ ~> | $ | {'description': $newDescription} |"
      }
    }
  }
}

This example allows the following operations.

  • levelUp
    • Increase the Level attribute by 1.
  • updateDescription
    • Update the description; an argument is required.

The JSON associated with an update event looks like this.

json
{
  "updates": [
    { "tokenId": "1", "action": "levelUp" },
    { "tokenId": "2", "action": "levelUp" },
    { "tokenId": "1", "action": "updateDescription", "args": { "newDescription": "Now I'm a big monster" }},
    { "tokenId": "1", "action": "levelUp" },
    { "tokenId": "3", "action": "levelUp" }
  ]
}

Metadata is updated incrementally according to the defined recipes. The example above is reproduced unchanged from the original article; its use of the action field and argument object differs from the recipeKey and string argument structure shown earlier.

Security

Metadata may contain malicious recipes. In particular, when NFT marketplaces or external tools execute those recipes to compute the latest metadata, excessive computation may create a denial-of-service risk.

Consumers executing updates should impose appropriate limits on the engines and number of updates they process and use isolated execution environments.

If the contract can later change the content returned by tokenURI or uri, care is also needed regarding the consistency and interpretation of changes that have already been broadcast.

Compatibility

ERC-5185 is fully compatible with ERC-721 and ERC-1155.

Only applications that support the extension follow the metadata update history and reconstruct the latest state. This provides greater flexibility while minimizing disruption to the existing ecosystem.

Citation

Christophe Le Bars (@clbrge), "ERC-5185: NFT Updatable Metadata Extension [DRAFT]," Ethereum Improvement Proposals, no. 5185, June 2022. [Online serial]. Available: https://eips.ethereum.org/EIPS/eip-5185.

Conclusion

ERC-5185 proposes a mechanism for updating NFT metadata according to predefined rules.

If you have questions, feel free to send me a direct message on Twitter.

Twitter @cardene777

I also publish technical content on the following platforms.

https://chaldene.net/