---
eip: 7053
label: ERC-7053
title: Interoperable Digital Media Indexing
status: Final
type: Standards Track
category: ERC
created: 2023-05-22
official: https://eips.ethereum.org/EIPS/eip-7053
source: https://github.com/ethereum/ERCs/blob/master/ERCS/erc-7053.md
canonical: https://eips.huatuo.xyz/eip-7053/
lang: en
tldr: "A simple on-chain index for digital media: anyone calls commit() with a file's content identifier (CID) and some data, and the emitted Commit events form a searchable, cross-contract history of that file."
tags: [media, provenance, cid, indexing, events]
---

# ERC-7053: Interoperable Digital Media Indexing

> A universal indexing method to record, discover and retrieve the history of digital media on EVM-compatible blockchains.

**TL;DR:** A simple on-chain index for digital media: anyone calls commit() with a file's content identifier (CID) and some data, and the emitted Commit events form a searchable, cross-contract history of that file.

## What problem does it solve?

Photos, videos and other digital media get copied, edited, minted as NFTs and referenced by many systems. Each system tends to track a file in its own way, so there is no common key for asking "what has been recorded about *this exact file*, by whom, on which chain?". Provenance and metadata end up fragmented.

ERC-7053 proposes a common key, the file's **Content Identifier (CID)**, and a standard way to log records against it. Because a CID is a cryptographic hash of the content, anyone holding the file can recompute it and look up everything committed about it across contracts and EVM chains.

## How it works

1. **Compute a CID** for the media file. The spec requires a content address from a cryptographic hash and says it should be the same identifier used on decentralised storage, so the CID also locates the file and its metadata.
2. **Call `commit`** on a compliant contract with the CID and a free-form `commitData` string (for example a pointer to metadata, an action description or an edit record).
3. The contract **emits a `Commit` event** and returns the block number. The reference implementation also stores the block numbers per CID so they can be read back with `getCommits`.

```solidity
event Commit(address indexed recorder, string indexed assetCid, string commitData);

function commit(string memory assetCid, string memory commitData)
    public returns (uint256 blockNumber);
```

The history of a file is the ordered list of `Commit` events for its CID, potentially across many contracts and chains. NFTs minted before a contract existed can be indexed too, by computing the CID of the file their `tokenURI` points to.

## Sample code

Committing and then querying a file's history (ethers v6):

```ts
import { Contract, id } from "ethers";

const abi = [
  "event Commit(address indexed recorder, string indexed assetCid, string commitData)",
  "function commit(string assetCid, string commitData) returns (uint256)",
];
const registry = new Contract(registryAddress, abi, signer);

const cid = "bafy...";                       // CID of the media file
await (await registry.commit(cid, JSON.stringify({ action: "captured" }))).wait();

// Indexed strings are stored as keccak256 hashes in the log topic,
// so filter by the hash of the CID.
const logs = await registry.queryFilter(registry.filters.Commit(null, id(cid)));
for (const l of logs) console.log(l.blockNumber, l.args.recorder, l.args.commitData);
```

## Things to know

- **Status: Final.**
- The contract does **not** verify anything: it does not check that the CID is valid or that `commitData` is true. Anyone can commit anything about any CID, so trust comes from *who* the `recorder` is, not from the record existing.
- Because `assetCid` is an indexed `string`, the log topic holds its hash, not the text. You can filter by a known CID but cannot read the CID back from the topic alone; keep it in `commitData` or in storage if you need it.
- Indexers should handle reorgs and possibly missed events when building a history from logs.


---

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