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-7053 proposes a method for recording digital media history and indexing related information across EVM-compatible blockchains.

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

ERC-7053 was at the Last Call stage as of October 4, 2023, the reference date used in the original article.

Overview

The proposal introduces a mechanism for organizing and retrieving information associated with digital media, including photographs, videos, and audio files, on Ethereum and other compatible blockchains.

Information associated with media can be difficult to discover when it is distributed across independent smart contracts and networks.

ERC-7053 aims to provide:

  • Efficient organization of digital media information
    • Applications can index related records using a common identifier rather than relying exclusively on project-specific databases.
  • Improved traceability across contracts and chains
    • Records associated with the same content can be discovered across participating contracts and networks.
  • Discovery of related information and storage locations
    • Applications can locate metadata and references associated with a media asset.

The objective is to make digital media information easier to manage and discover. Cross-chain indexing still requires infrastructure capable of querying the relevant networks; the interface does not itself transfer data between chains.

Motivation

Digital media plays an important role on the Internet, but identifying and discovering information about the same content across different systems remains difficult.

Without a common content identifier, media metadata, storage locations, and provenance information can become fragmented. This challenge becomes more significant as the volume of digital media increases.

ERC-7053 proposes a standardized, decentralized approach to indexing media across EVM-compatible networks. It combines content identifiers (CIDs) with Commit events, allowing applications to associate multiple records with the same content.

An indexer can reconstruct the recorded history of a media asset by collecting the corresponding events from participating contracts and networks.

This creates a common mechanism for publishing and discovering content-related records. It does not guarantee that every relevant record has been published or that the recorded history is exhaustive.

Digital media indexing relationships and metadata lookup

Figure 1: Digital Media Indexing Relationships and Lookup

Source: https://eips.ethereum.org/EIPS/eip-7053

The figure illustrates the relationship between off-chain media data and on-chain records associated with that media.

The original diagram is retained. It illustrates how off-chain content and its associated on-chain indexing information can be connected using a shared content identifier.

The central idea is to make related information discoverable through a consistent identifier, even when the information originates from different systems.

This is a logical aggregation mechanism rather than a requirement to store all media and metadata in one centralized repository.

Specification

Content identifiers

A content identifier identifies digital content using a content-addressed representation derived from cryptographic hashing.

The proposal uses identifiers compatible with decentralized storage systems so that records can refer to the same underlying media content.

A CID contains information beyond a bare hash, including information about its encoding and the content representation. Identical files only produce identical CIDs when the relevant encoding and content-addressing parameters are consistent.

Applications can use a media asset's CID to discover associated metadata, records, and references to stored content.

Content identifiers provide a common key for indexing media-related information. They do not themselves guarantee that the corresponding content remains available or that claims made about the content are accurate.

Commit function

To publish an indexing record for digital media, an application calls the commit function, which emits a Commit event.

javascript
/**
 * @notice Emitted when a new commit is made.
 * @param recorder The address of the account making the commit.
 * @param assetCid The content identifier of the asset being committed.
 * @param commitData The data associated with the commit.
 */
event Commit(address indexed recorder, string indexed assetCid, string commitData);

/**
 * @notice Registers a commit for an asset.
 * Emits a Commit event and records the block number of the commit in the recordLogs mapping for the provided assetCid.
 * @dev Emits a Commit event and logs the block number of the commit event.
 * @param assetCid The content identifier of the asset being committed.
 * @param commitData The data associated with the commit.
 * @return The block number at which the commit was made.
 */
function commit(string memory assetCid, string memory commitData) public returns (uint256 blockNumber);

The function accepts an asset CID and associated commit data, records the block number, and returns that block number.

The event records the caller, the indexed asset CID, and the associated data.

Because assetCid is an indexed dynamic string, the event topic contains a hash of its encoded value rather than the original string itself. Indexers that need the original CID must obtain it from an appropriate source, such as transaction input or separately available records.

Rationale

The proposal prioritizes efficient and interoperable indexing through shared content identifiers.

Data integrity

Content addressing allows a client to verify whether retrieved content corresponds to an expected identifier.

When the content is available, applications can derive its CID using the applicable encoding rules and discover records associated with it.

A matching CID establishes content integrity relative to that identifier. It does not prove authorship, ownership, licensing rights, or the truthfulness of associated metadata.

Data portability

Common identifiers allow applications to associate the same content with records published through different systems.

For example, an NFT may have been created before a corresponding Commit event was emitted. An application can retrieve the content referenced through its tokenURI or associated metadata and derive the appropriate CID using consistent content-addressing rules.

The resulting identifier can be used to discover records published independently of the NFT contract.

ERC-7053 uses CIDs to support content integrity checks, portability, and consistent indexing across applications. Content retrieval and interpretation still depend on the relevant storage and application infrastructure.

Reference implementation

javascript
// SPDX-License-Identifier: CC0-1.0
pragma solidity ^0.8.4;

import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";

contract CommitRegister is Initializable {
    using ECDSA for bytes32;

    mapping(string => uint[]) public commitLogs;

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

    function initialize() public initializer {}

    function commit(string memory assetCid, string memory commitData) public returns (uint256 blockNumber) {
        emit Commit(msg.sender, assetCid, commitData);
        commitLogs[assetCid].push(block.number);
        return block.number;
    }

    function getCommits(string memory assetCid) public view returns (uint[] memory) {
        return commitLogs[assetCid];
    }
}

This reference contract maintains a mapping from asset CIDs to arrays of block numbers.

Calling commit emits the Commit event, appends the current block number to the relevant array, and returns the block number.

The getCommits function retrieves the stored list of block numbers for a CID. Multiple commits may occur within the same block, so a block number alone is not a unique identifier for an individual event.

The code is reproduced unchanged from the original article. It has not been independently compiled or audited as part of this translation.

Security considerations

Input validation

The commit function accepts arbitrary strings. Implementations and consuming applications should validate their format, size, and semantics where appropriate.

Off-chain applications must treat commit data as untrusted input and safely process it before displaying it or passing it to other systems. A string stored in an EVM contract does not execute as a script merely because it contains executable-looking text.

Data integrity

The interface does not itself validate whether a supplied CID identifies available content or whether the associated commit data is accurate.

Consumers must verify retrieved content against its identifier and apply suitable trust policies to claims published by individual recorders.

An event records which address submitted a particular record. It does not establish that the recorder is the creator or rightful owner of the media.

Event monitoring

Applications relying on Commit events should handle chain reorganizations, interrupted subscriptions, duplicate records, and differences in event delivery order.

Indexers should track canonical blocks, backfill missing ranges, and identify logs using appropriate chain, transaction, and log identifiers.

Implementers should evaluate these considerations against their particular deployment and use case. Security review is especially important for applications that rely on indexed records to make decisions about asset provenance or access.

Citation

Bofu Chen (@bafu), Tammy Yang (@tammyyang), "ERC-7053: Interoperable Digital Media Indexing [DRAFT]," Ethereum Improvement Proposals, no. 7053, May 2023. [Online serial]. Available: https://eips.ethereum.org/EIPS/eip-7053.

Conclusion

ERC-7053 proposes an interoperable mechanism for indexing records associated with digital media through content identifiers and on-chain Commit events. It provides a shared discovery mechanism that applications can use across participating EVM-compatible networks.

Questions are welcome via Twitter @cardene777.

Other publications:

https://chaldene.net/