Approaches to ICRC-7 NFT User Facing Metadata

We identified three approaches for handling ICRC-7 NFT user facing metadata, each with distinct trade-offs in terms of interoperability, simplicity, and on-chain accessibility.


1. On-Chain ICRC-3 Metadata (Structured Fields)

This approach involves defining metadata directly within ICRC-3 fields, allowing canisters to access key information without additional fetching or parsing.

Pros:

  • Direct Access: Simplifies on-chain metadata retrieval (e.g., image URLs), as canisters can access the data directly.
  • Efficient Processing: Avoids the overhead and complexity of fetching and parsing JSON.

Cons:

  • Limited Interoperability: Incompatible with NFT metadata standards from other blockchains.
  • Cross-Chain Maintenance: Cross-chain collections would need metadata mapping, leading to additional storage and maintenance overhead.
  • Tooling Gaps: Existing NFT tools won’t work out-of-the-box, and new IC-specific tools would need to be developed.
  • Wallet Complexity: Cross-chain wallets would need to implement custom IC logic to handle the metadata format.

2. URL-Based JSON Metadata

In this approach, metadata consists of a URL pointing to a JSON file, which follows common NFT metadata standards used across multiple ecosystems.

Pros:

  • Cross-Chain Compatibility: Aligns with existing NFT metadata standards, enabling seamless integration with other blockchains.
  • Tooling Reuse: Leverages existing NFT tools, wallets, and marketplaces, simplifying NFT creation on the IC.
  • Metadata Reusability: Cross-chain collections can reuse the same metadata across different chains.
  • Simpler Wallet Integration: Wallets can adopt IC-based NFTs without needing special implementations.

Cons:

  • Indirect Access: Canisters must fetch and parse the JSON file to access metadata, adding some overhead and complexity.
  • Potential Off-Chain Risks: If not implemented properly, metadata may be stored off-chain (e.g., via centralized servers), unless decentralized alternatives like DATA URLs, ICRC-91 URLs, or IPFS are used.

3. Hybrid Approach (Supporting Both Formats)

This approach combines on-chain structured metadata with URL-based JSON, giving developers the flexibility to choose the format that best suits their needs.

Pros:

  • Flexible Metadata Options: Developers can optimize metadata for either on-chain access or cross-chain compatibility, depending on their use case.

Cons:

  • Increased Complexity: Wallets, marketplaces, and dapps must support and manage two metadata formats.
  • Canister Overhead: Canisters that process metadata may need to handle both formats or risk being incompatible with certain collections.

Summary

The right metadata approach depends on how the data is primarily consumed:

  • On-Chain Metadata (ICRC-3 Structured Fields): Best for collections where canisters need direct, efficient access to metadata.
  • URL-Based JSON Metadata: More practical for most cases, offering better compatibility with external ecosystems and existing tools.

Current Working Group Recommendation

After evaluating the pros and cons, we believe that URL-based JSON metadata offers the best balance of flexibility, cross-chain compatibility, and tooling reuse for most NFT use cases.

To minimize the risks of off-chain storage, developers can adopt the following decentralized solutions:

  • Recommended Basic Canister Approach:
    Embed JSON metadata directly within the URL using a DATA URI to keep it fully on-chain and easily accessible.

    vec {
        record {
             "icrc97:metadata"; 
             variant { Array = vec {
                 variant { Text = "data:text/json;charset=utf-8;base64,ew0KICAgImtleSIgOiAidmFsdWUiDQp9" };
             }; };
        }
    }
    

    Notes:

    • This approach is only recommended for limited metadata, large data would limit the number of NFTs that can be queried at once.
    • For larger amounts, dynamic or other advanced types of metadata, it’s recommended to use below approach instead.
  • Recommended Advanced Multi-Canister Approach:
    Store JSON metadata on the same canister or another canister, certified and served over HTTPS. The ICRC-91 standard basically removes the ic0.app/icp0.io part from the URL, improving decentralization and flexibility.

    vec {
        record {
             "icrc97:metadata"; 
             variant { Array = vec {
                 variant { Text = "ic-http://2225w-rqaaa-aaaai-qtqca-cai/metadata/3456" };
                 variant { Text = "https://2225w-rqaaa-aaaai-qtqca-cai.icp0.io/metadata/3456" };
             }; };
        }
    }
    

    Notes:

    • The URL path is not a part of this standard and could be any provided value.
    • ICRC-91 is still work in progress and is likely to change, the value here should be seen as a placeholder.
    • Efforts are currently being made to align this standard with the ICRC namespacing and payment URI standards.
    • Multiple entries can be provided for resiliency. If the first one is not compatible with a client, the next one can be attempted.
    • HTTP cache headers can be used to optimize the number of incoming requests, particularly if metadata is immutable.
  • Recommended for Bringing NFTs from Other Chains
    Store metadata on IPFS, a common decentralized file system, to facilitate interoperability with NFTs from other blockchains.

    vec {
        record {
             "icrc97:metadata"; 
             variant { Array = vec {
                 variant { Text = "ipfs://bafybeihkoviema7g3gxyt6la7vd5ho32ictqbilu3wnlo3rs7ewhnp7lly" };
                 variant { Text = "https://ipfs.io/ipfs/bafybeihkoviema7g3gxyt6la7vd5ho32ictqbilu3wnlo3rs7ewhnp7lly" };
             }; };
        }
    }
    

    Notes:

    • Multiple entries can be provided for resiliency. If the first one is not compatible with a client, the next one can be attempted.
    • In IPFS, the URI itself is a content identifier (CID), derived from the hash of the file’s content, ensuring immutability and authenticity.

Handling Canister-Specific Metadata:

If canisters need direct access to collection-specific metadata (e.g., a game character’s level), developers can implement alternative entries with that data. These items should be namespaced to keep the global namespace clean and MAY be defined as alternative ICRCs.

vec {
    record {
        "icrc97:metadata"; 
        variant { Array = vec {
            variant { Text = "data:text/json;charset=utf-8;base64,ew0KICAgImtleSIgOiAidmFsdWUiDQp9" };
        }; };
    };
    record {
        "com.mygame.namespace";
        variant { Map = vec {
            vec {
                "level";
                variant { Nat = 6; };
            };
            vec {
                "name";
                variant { Text = "Rathgar the Wise" };
            };
            vec {
                "inventory";
                variant { Array = vec {
                    variant { Text = "Cooking Pot" };
                    variant { Text = "Asparagus" };
                    variant { Text = "Hot Chocolate" };
                }; };
            };
        }; };
    }
}

Notes

Please see below notes that further details our current viewpoint and approach:

  • Initially we considered the hybrid approach to cover all use cases.

    Looking further into the consequences of such an approach, we discovered it would make implementation and adoption a significant challenge.

    Two approaches in a single standard would result in developers needing to implement and maintain things twice everywhere.

  • Trying to define a metadata standards that covers all use cases is a big goal but is likely to result in a standard that falls short for each individual use case.

    So instead we decided to focus on a single use case user facing metadata, this use case covers the data shown to end users within wallets and marketplaces.

  • Interoperability with other chains and cross-chain wallets was an important requirement to make sure NFTs on the IC would gain more and wider adoption.

    Therefore, we think the JSON approach, which indeed seems less “IC” than candid, aligns better with this goal.

  • Immutability, dynamic and other metadata topics are interesting and should definitely be covered.

    But from our viewpoint, these topics require further discussion with developers within the WG and the community.

    Meanwhile, these topics are not directly affecting the use case of user facing metadata shown by wallets and marketplaces.

Join the discussion

Respond in this thread to join the discussion, additionally there’s the Tokenization WG meeting every other Tuesday.

Feedback:

  • Disagree with our viewpoint? Awesome, share your thoughts so we can find the right approach!
  • Agree with our viewpoint? Let us know your support by liking this post or commenting below.

Technical discussion:

  • Are there other better approaches we’ve missed?
  • What metadata fields and values do we need? Do we follow existing standards? Which one?
  • Input and discussions regarding technical details is highly appreciated.

    Example: Are multiple URLs (fallbacks) needed and what is the risk of data being different between these URLs?

6 Likes

Also with the metadata, do any of the options allow for dynamic updating of the data at any time.

This possibly includes updating of the image provided with them as well.

Yes, all of the options allow for updating of the metadata.

Though with option 1, there’s no possibility to have this metadata on another canister (e.g. game canister that rapidly updates a game character experience points).

To keep track of metadata updates, the 7update_token block type defined in ICRC-7 standard could be used.

In case ICRC-91 URLs are used, they should ideally contain a hash of their contents to make sure they’re tied tot the ICRC-7 metadata updates. This is already the case for IPFS urls as I’ve mentioned above.

1 Like

If you’d like a preview of a more explicit static/dynamic nft metadata standards, see NFT Working Group - Next Steps - ICRC-8, ICRC-56, ICRC-59, ICRC-60 for ICRC-59 and ICRC-60. These desperately need to be updated and streamlined, but they are generally in the right direction.

The idea here is that for WALLETs you would always want the ICRC-97 entry as it will be the most direct to implement. For other kinds of applications you would ADD the ICRC-59 or ICRC-60 entry to augment it for applications that want to handle processing static or dynamic data on-chain by other canisters. Similar to the example given with com.mygame.namespace above but with ICRC-59 or 60 fields.

I’d expect 59 to end up with something along the lines of “icrc59:isStatic”, #Text(“true”) to flag that the data in the icrc97 will never change.

Thanks I will be checking all of these out, as my game is neary ready for playtest. Once it is at that stage, I will be looking at NFT integration and will be starting with ICRC-7, and will look at all the other standard which could help it.

Currently I’m thinking having the meta data on a URL-Based JSON Metadata would be best for the game. But will need to check into it more.

Just wanted to give my input here. From my experience I believe URL-Based JSON Metadata would be the best option. We should try to align ourselves with industry standards rather than trying to reinvent things which already work quite well elsewhere. There is a “risk” that data may be stored off-chain, but this should be at the discretion of the creators of NFTs, and it should be up to the community to demand on-chain or immutable data if that is what they desire.

As for metadata fields, I absolutely insist on a thumbnail field. When building Cubetopia, we wanted to allow players to users to place their NFTs within our 3D game world. However, many ICP collections (particularly a few years ago) simply link to a HTML page, meaning that it was not possible to get an image suitable for use in our application. The workaround we had to settle on was an off-chain microservice which would render these NFTs in chrome, before taking a screenshot and returning it to the game. In hindsight, its a ridiculous workaround which would be totally avoided if creators were required to add a JPEG thumbnail, as is the standard on other chains. This is an amusing and perhaps unusual circumstance, but the principle would apply to many other applications that integrate and display NFTs.

The opensea metadata standards probably cover most use cases, but maybe others have suggestions for what additional fields should be added?

2 Likes

My understanding is that the idea is that either the data-uri or the Itemm pointed to would most likely be openSea standard. The nice feature of this setup is that it allows -BOTH- a standard current-nft standard in the icrc-97 field and allows you to add other metadata standards that may come along if you want to do something else possibly useful or something custom.

Unfortunately, unless I’m missing it, the openSea standard doesn’t have a thumbnail field. You could I guess use the attributes to put a link in there, but it would be unlikely to be standard. As absurd as it sounds the thing you mentioned about snapshotting and caching is precisely what most NFT marketplaces do today because, well, the existing ‘standards’ are barely standards, vary widely, and just don’t get the job done for full feature dynamic, professional nft that would be far better than today’s version of it.

…so we try to facilitate both.

You can see here in 59 we try to provide a specific preview endpoint, and experience endpoint(for web page or dapp), as well as a generic specification so if you want to deal with all the different sizes and flavors that someone like apple asks you to have for logos and what not you can include all of those pre rendered for your users: ICRC/ICRCs/ICRC-59 at icrc59and60 · skilesare/ICRC · GitHub so that you can load in things like icrc59:resource:ios:20x20 and have all kinds of different sizes and/or representations at different sizes.

That system could potentially handle all this craziness:

:mobile_phone: iPhone Icons

Icon Use Size (pt) Scale Size (px)
App Icon (iPhone) 60×60 @2x 120×120
60×60 @3x 180×180
Spotlight 40×40 @2x 80×80
40×40 @3x 120×120
Settings 29×29 @2x 58×58
29×29 @3x 87×87
Notification 20×20 @2x 40×40
20×20 @3x 60×60

:mobile_phone: iPad Icons

Icon Use Size (pt) Scale Size (px)
App Icon (iPad) 76×76 @1x 76×76
76×76 @2x 152×152
App Icon (iPad Pro) 83.5×83.5 @2x 167×167
Spotlight 40×40 @1x 40×40
40×40 @2x 80×80
Settings 29×29 @1x 29×29
29×29 @2x 58×58
Notification 20×20 @1x 20×20
20×20 @2x 40×40

:shopping_bags: App Store Icon (Required)

Icon Use Size (px)
App Store Icon 1024×1024
  • This icon should not have any transparency.
  • Used for display in the App Store.

:watch: Apple Watch Icons (optional, if supporting watchOS)

Icon Use Size (pt) Scale Size (px)
Notification Center 24×24 @2x 48×48
@3x 72×72
Companion Settings 29×29 @2x 58×58
@3x 87×87
Home Screen Icon 40×40 @2x 80×80
@3x 120×120
Long-Look Notification 44×44 @2x 88×88
@3x 132×132
App Icon (App Launcher) 86×86 @2x 172×172
98×98 @2x 196×196

:receipt: Quick Summary of Most Common iOS App Icon Sizes

Use Case Size (px)
iPhone App 180×180
iPad App 167×167
App Store 1024×1024
Notification 60×60
Settings 87×87
Spotlight 120×120
2 Likes

Ah, on second look I see that you’re right. I think going by the OpenSea standard we would use the image property for an image, and then use animation_url to link to the multimedia (for example: BTC Flower and Cubetopia Pets) which would resolve the issue I was mentioning. As long as we can represent all NFTs with an image, I’ll be happy, and it’ll no doubt save many headaches!

IRC59 looks interesting though, that certainly takes things a lot further!

3 Likes

59 and 60 take a specific approach of allowing multi asset NFTs with extensive(sometimes multi-party) data apps(or data regions) that can be given to specific principals for maintenance and updating. It is roughly based on the Origyn_nft standard and allows for things like keeping service records in the digital twin of your car, or a whole game in an NFT. The Origyn nft even had a way others to put entire Dapps into your NFT that could interact with the data stored there. I need to get back to refactoring them.

I love this discussion. I am strongly in favor of option #1 because it allows developers in the ICP space to innovate and disrupt the NFT space going forward.

That said, backwards compatibility is valuable and devs should have the option to become compliant with existing standards. However, we don’t want to allow existing standards to place limits on ICP developers.

I believe ICP can only win in the marketplace when it innovates, and that requires a bit of freedom beyond established standards. In the future, ICP will have wallets that bridge the gaps in standards. But if we place limitations on ourselves, then we will fail to innovate.

Thoughts?

To clarify, option 2 would not limit wallet and marketplace developers specifically since they’re not likely reading metadata fields on-chain specifically. Instead both would likely read this metadata from a frontend to display it to a user.

Option 2 would practically limit the metadata standard scope to user facing metadata but not restrict additional metadata standards with a different scope (possibly used in parallel).

Meanwhile option 1 keeps a larger more abstract scope for this single standard where metadata is easily accessible for on-chain processing at the cost of inoperability with other chain wallets and marketplaces.

From the WG perspective, we thought it would make more sense to have a standard compatible with other chain wallets and marketplaces. After which additional metadata standards could be defined if needed that aren’t compatible with other chains but have a different/larger scope.

2 Likes

This topic is on the agenda for the Token WG meeting 2025-03-25T16:00:00Z.

1 Like

Would it be possible for you to record the meeting and post the summary here? If you post the recording of discussions that will be plenty enough too. Just trying to catch up with the discussions.

2 Likes

Will link the recording after the call.

Though, it’s mostly appreciated if people from outside the WG join the call with input, feedback and questions at this stage.

3 Likes

Yes it would have been nice. Maybe eventually many will join once this discussion is jump-started

Hello @sea-snake any updates on this?