ndujaLabs / MCIPs

Multi-chain Improvement Proposals
0 stars 1 forks source link

mcip-2 NFT cross-chain contract addresses #5

Open 0x0ece opened 2 years ago

0x0ece commented 2 years ago

A standard protocol to list the NFT contract addresses on multiple blockchains.

Abstract

The following standard extends the contract-level metadata to describe the behavior of the NFT smart contract across multiple blockchains, specifically to list the contract addresses on the different chains.

Motivation

NFTs are a digital representation of an asset, wether it's a piece of art, a financial contract or an item within a game. As the capabilities of NFTs evolve, the concrete instantiation of a NFT on a specific blockchain looses importance, and what matters more and more is the NFT as an entity that can live across blockchains.

The ecosystem of cross-chain NFTs is still very fragmented. Although there exist marketplaces that support multiple blockchains and bridges to move NFTs across different chains, there's still a lack of tools to build cross-chain NFTs and coordinate the behavior of a collection across chains.

This standard defines a minimal set of information that can be shared by a NFT project owner to list all addresses across blockchains, therefore informing external parties about how the collection is expected to behave. This list of addresses can be used by marketplaces to display a single coherent collection, or by bridges to know where to mint tokens when they move across chains.

Specification

Contact URI for ERC721 or ERC1155, unchanged.

contract MyCollectible is ERC721 {
    function contractURI() public view returns (string memory) {
        return "https://metadata-url.com/my-metadata";
    }
}

Data returned from the URI:

{
  # unchanged
  "name": "...",
  "description": "...",
  "image": "...",
  "external_link": "...",
  "seller_fee_basis_points": ...,
  "fee_recipient": "...",

  # NEW
  # addresses of the NFT collections on different chains
  "chains": {
    "ethereum": "0x3b6aad76254a79a9e256c8aed9187dea505aad52",
    "polygon": "0x0ece...",
    "solana": "...",
    ...
  }

}

Rationale

The NFT project owner needs to maintain control over the collection across all chains, for example they have to be able to validate ownership on multiple marketplaces.

This standard defines a minimal set of information to describe the NFT contract across blockchains.

Marketplaces can use this list to display cross-chain NFTs as a coherent collection. Validation is responsibility of the marketplace and can be further detailed in future standards, for example the owner could include digital signatures proving ownership on each chain.

NFT bridges can use this list to know where to mint a NFT when it moves across chains. Authorization to mint should be granted by the owner of the contract.

Backwards Compatibility

Fully compatible with the ERC721 or ERC1155 standards.

sullof commented 2 years ago

That is a good idea. Maybe it would make sense to consider an interface with functions to manage the bridges

    function approveBridge(address _bridge) external; 
    function getApprovedBridges() external view returns (address[] memory);

This way, the owner of the contract can authorize a bridge to mint new token.