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.

This article examines ERC-7603, a proposal that allows an ERC-1155 token to contain multiple assets and provide appropriate data for the environment in which it is used.

The explanation below translates, summarizes, and expands on the original proposal.

I also cover other EIPs, BIPs, SLIPs, CAIPs, ENSIPs, RFCs, and ACPs.

Overview

The Multi-Asset Token standard is compatible with ERC-1155 and allows a single token collection to contain multiple assets, or forms of output. Here, an asset refers to the files used to display or interact with a token, such as images, PDFs, 3D models, and configuration data.

For an introduction to ERC-1155, see the following article.

[ERC-1155] An Introduction to ERC-1155

The central idea is context-dependent data output. The same token can provide an asset in an appropriate format depending on the application accessing it and its intended use.

For example, different applications could select different outputs.

  • An e-book reader displays a PDF.
  • A marketplace displays a PNG or SVG image.
  • A game retrieves a 3D model.
  • An IoT hub, which coordinates networked devices and other equipment, retrieves an asset containing addresses or technical specifications.

The important point is that an application can select the data to use based on the context in which the token is opened.

A token collection can also hold multiple assets ordered by priority, allowing applications to choose higher-priority assets when appropriate. These assets have the following properties.

  • Their MIME types, which describe file formats (such as image/png or application/pdf), do not have to match.
  • Their tokenURI values, which reference metadata through URLs, IPFS, or similar mechanisms, do not have to match.
  • Assets do not have to depend on one another. One asset need not assume that another exists.
  • An asset is best understood as a namespaced tokenURI, rather than as a completely independent entity. In other words, the mechanism allows a collection to expose different URIs for different purposes.

Motivation

ERC-1155-compatible tokens are widely used in the Ethereum ecosystem, and their applications continue to diversify. A standard that allows a collection to contain several assets can improve its utility, usability, and adaptability.

The proposal identifies three improvements to ERC-1155.

Improvement Meaning
Cross-metaverse compatibility Makes it easier to use the same tokenized asset across multiple games, engines, and environments.
Multimedia output Allows the same content to be provided in multiple formats, such as PDF and audio.
Media redundancy Places equivalent metadata and references on multiple storage systems to improve availability.

Cross-metaverse compatibility

Cross-metaverse compatibility, also called cross-engine compatibility, aims to reduce problems such as an item working in one game but not in another.

For example, the data format and implementation required for a cosmetic item can differ between games. An asset designed for Game A may therefore be unusable directly in Game B.

With this standard, the same token collection can hold multiple assets for specific purposes, such as the following.

  • Asset 1 Cosmetic item data in a format understood by Game A.
  • Asset 2 Cosmetic item data in a format understood by Game B.
  • Asset 3 An asset intended for general viewing.

The third asset can be used by catalogs, marketplaces, and portfolio trackers that display users' NFTs or other token holdings. It might contain a visual representation, a styled thumbnail, an animated demonstration, or a trailer.

Game developers can then design their applications to retrieve the appropriate asset directly from a token the user owns. Instead of hard-coding item data for each game, the token provides a consistent mechanism for accessing that data.

This makes it easier to support multiple implementations and environments, expanding the range of uses for the same token.

Multimedia output

Consider a token representing an e-book. Reading and listening require different formats, even when the content is the same.

  • A PDF is suitable for an e-book reader.
  • MP3 audio is suitable for an audiobook application.

The standard allows a collection to contain both PDF and MP3 assets, so that the software loading the token can select an appropriate format.

Media redundancy

In practice, some tokens are issued without following storage best practices, leaving metadata in vulnerable locations. Typical examples include the following.

  • Metadata is hosted on a single server and becomes inaccessible if that server goes offline.
  • Even when IPFS is used, the URL of a particular IPFS gateway, which provides HTTP access to IPFS content, may be hard-coded. If that gateway goes offline, the content becomes inaccessible through that URL.

The standard allows equivalent metadata and its referenced images to be stored as separate assets on multiple storage systems. For example, the collection can include the following assets.

  • An asset containing the same metadata and image on Arweave.
  • An asset containing the same metadata and image on Sia.
  • An asset containing the same metadata and image on IPFS.

If one protocol or gateway fails, an application may be able to fall back to another asset. This improves the resilience of metadata and its references, since simultaneous failure of all alternatives is less likely.

Specification

ERC-7603 defines an interface for context-dependent multi-asset tokens designed to work with ERC-1155. It allows multiple assets to be associated with a token, managed by priority, and retrieved individually.

IERC7603.sol
/// @title ERC-7603 Context-Dependent Multi-Asset Tokens, ERC-1155 Execution
/// @dev See https://eips.ethereum.org/EIPS/erc-7603

pragma solidity ^0.8.23;

interface IERC7603 /* is ERC165 */ {
    /**
     * @notice Used to notify listeners that an asset object is initialised at `assetId`.
     * @param assetId ID of the asset that was initialised
     */
    event AssetSet(uint64 assetId);

    /**
     * @notice Used to notify listeners that an asset object at `assetId` is added to token's asset
     *  array.
     * @param tokenId An ID of the token that received a new asset
     * @param assetId ID of the asset that has been added to the token's assets array
     * @param replacesId ID of the asset that would be replaced
     */
    event AssetAddedToToken(
        uint256[] tokenId,
        uint64 indexed assetId,
        uint64 indexed replacesId
    );

    /**
     * @notice Used to notify listeners that token's priority array is reordered.
     * @param tokenId ID of the token that had the asset priority array updated
     */
    event AssetPrioritySet(uint256 indexed tokenId);

    /**
     * @notice Sets a new priority array for a given token.
     * @dev The priority array is a non-sequential list of `uint16`s, where the lowest value is considered highest
     *  priority.
     * @dev Value `0` of a priority is a special case equivalent to uninitialised.
     * @dev Requirements:
     *
     *  - `tokenId` must exist.
     *  - The length of `priorities` must be equal the length of the assets array.
     * @dev Emits a {AssetPrioritySet} event.
     * @param tokenId ID of the token to set the priorities for
     * @param priorities An array of priorities of assets. The succession of items in the priorities array
     *  matches that of the succession of items in the array
     */
    function setPriority(uint256 tokenId, uint64[] calldata priorities)
        external;

    /**
     * @notice Used to retrieve IDs of assets of given token.
     * @dev Asset data is stored by reference, in order to access the data corresponding to the ID, call
     *  `getAssetMetadata(tokenId, assetId)`.
     * @dev You can safely get 10k
     * @param tokenId ID of the token to retrieve the IDs of the assets
     * @return uint64[] An array of the asset IDs of the given token
     */
    function getAssets(uint256 tokenId)
        external
        view
        returns (uint64[] memory);

    /**
     * @notice Used to retrieve the priorities of the assets of a given token.
     * @dev Asset priorities are a non-sequential array of uint16 values with an array size equal to asset
     *  priorites.
     * @param tokenId ID of the token for which to retrieve the priorities of the assets
     * @return uint16[] An array of priorities of the assets of the given token
     */
    function getAssetPriorities(uint256 tokenId)
        external
        view
        returns (uint64[] memory);

    /**
     * @notice Used to fetch the asset metadata of the specified token's asset with the given index.
     * @dev Can be overridden to implement enumerate, fallback or other custom logic.
     * @param tokenId ID of the token from which to retrieve the asset metadata
     * @param assetId Asset Id, must be in the assets array
     * @return string The metadata of the asset belonging to the specified index in the token's assets array
     */
    function getAssetMetadata(uint256 tokenId, uint64 assetId)
        external
        view
        returns (string memory);
}

Events

AssetSet
javascript
event AssetSet(uint64 assetId);

Emitted when a new asset is initialized. It notifies external systems that a new asset definition has been created in the contract. Marketplaces and indexers can monitor this event to identify newly available asset IDs.

Parameters

  • assetId
    • The ID of the initialized asset.
AssetAddedToToken
javascript
event AssetAddedToToken(
    uint256[] tokenId,
    uint64 indexed assetId,
    uint64 indexed replacesId
);

Emitted when a new asset is added to a token. It indicates that an asset has been associated with a token. The replacesId parameter also allows an update to be represented as a replacement of an existing asset. This lets external systems track asset replacement history and updates through events.

Parameters

  • tokenId
    • An array of IDs of the tokens receiving the new asset.
  • assetId
    • The ID of the added asset.
  • replacesId
    • The ID of the existing asset being replaced.
    • A value such as 0 is used when no asset is being replaced.
AssetPrioritySet
javascript
event AssetPrioritySet(uint256 indexed tokenId);

Emitted when the priorities of the assets associated with a token change. It indicates that the asset ordering or priorities have been updated. External applications responsible for displaying or retrieving assets can use this event to refresh their caches.

Parameters

  • tokenId
    • The ID of the token whose asset priorities were updated.

Functions

setPriority
javascript
function setPriority(uint256 tokenId, uint64[] calldata priorities)
    external;

Sets the array of asset priorities for the specified token. Priorities are numeric, with lower values indicating higher priority. The values do not have to be sequential; they express relative priority. A value of 0 is a special case equivalent to an uninitialized priority. The asset array and the priority array must have the same length.

Arguments

  • tokenId
    • The ID of the token whose priorities are being set.
  • priorities
    • An array of priorities corresponding to the assets.
getAssets
javascript
function getAssets(uint256 tokenId)
    external
    view
    returns (uint64[] memory);

Retrieves the IDs of the assets associated with the specified token. The function returns only asset IDs. To retrieve the actual metadata or URI, a caller uses a returned ID with another function. Asset information is stored by reference and accessed using its ID as a key.

Arguments

  • tokenId
    • The ID of the token whose asset list is being retrieved.

Return value

  • uint64[]
    • An array of asset IDs associated with the token.
getAssetPriorities
javascript
function getAssetPriorities(uint256 tokenId)
    external
    view
    returns (uint64[] memory);

Retrieves the priorities of the assets associated with the specified token. The returned array follows the same order as the asset array. This allows a client to determine which assets should be given the highest priority.

Arguments

  • tokenId
    • The ID of the token whose asset priorities are being retrieved.

Return value

  • uint64[]
    • An array of priorities corresponding to the assets.
getAssetMetadata
javascript
function getAssetMetadata(uint256 tokenId, uint64 assetId)
    external
    view
    returns (string memory);

Retrieves the metadata associated with the specified token and asset ID. The returned string is typically a URI (such as IPFS, Arweave, or HTTPS) or a reference to metadata JSON. Implementations can override this function to provide enumeration, fallback behavior, or other custom logic. It is the central retrieval function for context-dependent output.

Arguments

  • tokenId
    • The ID of the token whose asset metadata is being retrieved.
  • assetId
    • The ID of an asset associated with the token.

Return value

  • string
    • The metadata string for the specified asset.

Backward compatibility

The proposal is compatible with ERC-1155.

Citation

Haru (@haruu8), "ERC-7603: ERC-1155 Multi-Asset extension [DRAFT]," Ethereum Improvement Proposals, no. 7603, January 2024. [Online serial]. Available: https://eips.ethereum.org/EIPS/eip-7603.

Conclusion

This article covered ERC-7603, a proposal that allows a single ERC-1155 token to contain multiple assets and provide appropriate data for the environment in which it is used.

If you have any questions, feel free to reach out via Twitter DM.

Twitter @cardene777

I also publish on the following platforms.