EIPs Explained

ERC-5606 · Final · ERC · 2022-09-06

ERC-5606: Multiverse NFTs

A wrapper NFT that represents one digital item across many games and metaverses by holding the per-platform NFTs inside it, so the whole set can be traded as a bundle or split apart.

What problem does it solve?

A brand that releases a virtual sneaker in three metaverses usually mints three unrelated tokens, one per platform. On-chain there is nothing saying those tokens are "the same sneaker", so the item's real scarcity is hard to prove and the owner has to trade each copy separately.

ERC-5606 adds a multiverse NFT: one ERC-721 token that owns the platform-specific "delegate" NFTs (ERC-721 or ERC-1155) for the same asset. Holding the multiverse NFT means holding the item everywhere it exists.

How it works

Each delegate is described by a small struct:

Field Meaning
contractAddress The platform's NFT contract
tokenId The delegate token on that platform
quantity Amount (relevant for ERC-1155 delegates)

The lifecycle has three steps:

  1. initBundle(delegateData[]) mints a new multiverse NFT to the caller and fixes which delegate contracts and token IDs belong to it. That list cannot be changed later, which prevents unrelated NFTs from being slipped into a bundle. The new bundle starts empty.
  2. bundle(delegateData[], multiverseTokenId) pulls the delegate NFTs into the multiverse contract. The owner must first approve the multiverse contract on each delegate collection.
  3. unbundle(delegateData[], multiverseTokenId) sends selected delegates back to the caller, who must own the multiverse NFT. They can then be sold or used individually.

Both bundle and unbundle take arrays so you can move a subset: a bundle initialised with three delegates can hold any of those three at a time, never anything else. delegateTokens(id) lists the delegates of a bundle, and Bundled / Unbundled events let indexers track changes.

Sample code

The interface from the spec:

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

interface IMultiverseNFT {
    struct DelegateData {
        address contractAddress;
        uint256 tokenId;
        uint256 quantity;
    }

    event Bundled(uint256 multiverseTokenID, DelegateData[] delegateData, address ownerAddress);
    event Unbundled(uint256 multiverseTokenID, DelegateData[] delegateData);

    function delegateTokens(uint256 multiverseTokenID) external view returns (DelegateData[] memory);
    function unbundle(DelegateData[] memory delegateData, uint256 multiverseTokenID) external;
    function bundle(DelegateData[] memory delegateData, uint256 multiverseTokenID) external;
    function initBundle(DelegateData[] memory delegateData) external;
}

Bundling two platform items from a script (ethers v6):

import { Contract } from "ethers";

const items = [
  { contractAddress: gameA, tokenId: 12n, quantity: 1n },
  { contractAddress: gameB, tokenId: 7n,  quantity: 1n },
];

// 1. approve the multiverse contract on each delegate collection
for (const it of items) {
  const nft = new Contract(it.contractAddress, ["function setApprovalForAll(address,bool)"], signer);
  await (await nft.setApprovalForAll(multiverseAddr, true)).wait();
}

// 2. create the bundle, then move the items into it
const mv = new Contract(multiverseAddr, abi, signer);
await (await mv.initBundle(items)).wait();
await (await mv.bundle(items, multiverseTokenId)).wait(); // id read from the Transfer event

Things to know

  • Status is Final. It sits on top of ERC-721/1155, so platforms that ignore it still see ordinary NFTs.
  • The spec text says initBundle returns the new token ID, but the interface declares no return value. Read the ID from the mint Transfer event instead.
  • bundle calls external NFT contracts, so implementations should guard against reentrancy.
  • The standard links tokens on-chain but does not make games recognise each other's items; each platform still decides how to use its own delegate NFT.
  • For a more general "NFTs owning NFTs" model, see composable token ideas such as ERC-998.

#nft #interoperability #metaverse #gaming #bundle

Details

Authors
Gaurang Torvekar (@gaurangtorvekar), Khemraj Adhawade (@akhemraj), Nikhil Asrani (@nikhilasrani)
Status
Final
Type
Standards Track / ERC
Created
2022-09-06
Requires

Machine-readable: Markdown · JSON