---
eip: 1948
label: ERC-1948
title: Non-fungible Data Token
status: Stagnant
type: Standards Track
category: ERC
created: 2019-04-18
requires: 721
official: https://eips.ethereum.org/EIPS/eip-1948
source: https://github.com/ethereum/ERCs/blob/master/ERCS/erc-1948.md
canonical: https://eips.huatuo.xyz/eip-1948/
lang: en
tldr: Extends ERC-721 so each NFT carries a 32-byte data field that its owner can update over time, with an event recording every old and new value.
tags: [nft, dynamic-data, erc721, metadata, erc]
---

# ERC-1948: Non-fungible Data Token

> Some NFT use-cases require to have dynamic data associated with a non-fungible token that can change during its lifetime. Examples for dynamic data: - cryptokitties that can change color - intellectual property tokens that encode rights holders - tokens that store data to transport them across chain…

**TL;DR:** Extends ERC-721 so each NFT carries a 32-byte data field that its owner can update over time, with an event recording every old and new value.

## What problem does it solve?

[ERC-721](/eip-721/) metadata is typically fixed when a token is minted. Some use cases need state attached to the token itself that changes during its lifetime. The spec's examples: a collectible whose colour can change, an intellectual-property token recording current rights holders, or a token carrying data so it can be moved across chains.

ERC-1948 adds a small, standard slot for that changing data. The motivation came from side-chain and Plasma bridges and from a "distributed breeding" proposal, where NFTs need verifiable state that travels with them.

## How it works

An ERC-721 contract adds:

- **`readData(tokenId) → bytes32`**: returns the token's current data.
- **`writeData(tokenId, newData)`**: replaces the data. In the reference implementation only the current token owner may call it.
- **`DataUpdated(tokenId, oldData, newData)`**: emitted on every write, carrying both values so indexers can rebuild the history without reading storage.

The field is exactly 32 bytes. It can hold a value directly (a counter, an address, packed flags). For anything larger, the spec recommends storing the root hash of an authenticated structure such as a Merkle or Patricia tree and keeping the full data elsewhere.

## Sample code

Implementation on top of OpenZeppelin's ERC-721 (v5):

```solidity
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

import {ERC721} from "@openzeppelin/contracts/token/ERC721/ERC721.sol";

contract DataNFT is ERC721 {
    event DataUpdated(uint256 indexed tokenId, bytes32 oldData, bytes32 newData);

    mapping(uint256 => bytes32) private _data;

    constructor() ERC721("DataNFT", "DNFT") {}

    function mint(address to, uint256 tokenId) external {
        _mint(to, tokenId); // add access control in real code
    }

    function readData(uint256 tokenId) external view returns (bytes32) {
        _requireOwned(tokenId); // reverts if the token does not exist
        return _data[tokenId];
    }

    function writeData(uint256 tokenId, bytes32 newData) external {
        require(msg.sender == ownerOf(tokenId), "not owner");
        emit DataUpdated(tokenId, _data[tokenId], newData);
        _data[tokenId] = newData;
    }
}
```

Watching updates (ethers v6):

```ts
nft.on("DataUpdated", (tokenId, oldData, newData) => {
  console.log(`token ${tokenId}: ${oldData} -> ${newData}`);
});
```

## Things to know

- Status is **Stagnant**. The interface is tiny and easy to copy, but it never became a widely adopted standard.
- Only the owner can write, so a game or protocol that needs to update tokens on its own needs different access rules. That would be a departure from this spec.
- Anyone buying the token gets whatever data the previous owner last wrote. Marketplaces should show `readData` so buyers know the current state.
- If you only need to tell marketplaces that off-chain metadata changed, [ERC-4906](/eip-4906/) (`MetadataUpdate` events) is the widely supported option.


---

This is an unofficial plain-language summary. Read the full specification: https://eips.ethereum.org/EIPS/eip-1948
