Dynamic NFTs

What are Dynamic NFTs?

Dynamic NFTs, or Dynamic Non-Fungible Tokens, are a type of NFT that can change or evolve over time. Unlike traditional NFTs, which are static and represent a single unique item, such as an image or video, dynamic NFTs can be programmed to display different content, attributes, or behavior based on certain conditions or user interactions.

For example, a dynamic NFT representing a piece of art could change its appearance depending on the time of day or the weather conditions. Or a dynamic NFT representing a game item could gain new abilities or features as the player achieves certain milestones or completes certain challenges.

This guide will explain how to set up a dynamic NFT project using the Crossmint Mint API.

Example use-cases

Some examples include but are not restricted to:

  • Gaming: NFTs that represent in-game items or characters that can evolve or gain new abilities.
  • Art: NFTs that create pieces that change over time based on viewer interaction.
  • Collectibles: NFTs that create limited edition collectibles that change over time.
  • Fashion: NFTs that create unique clothing or accessories that change in appearance based on the wearer's location or weather.
  • Music: NFTs that create tracks or albums that change based on the listener's preferences or mood.
  • Real Estate: NFTs that represent properties that can change in value or appearance based on market conditions or renovations.
  • Advertising: NFTs that create interactive ads that change based on the viewer's actions or interests.
  • Education: NFTs that create interactive learning experiences that adapt to the learner's needs or progress.
  • Sports: NFTs that represent player contracts that update in real-time based on the player's performance or injury status.
  • Charity: NFTs that create limited edition NFTs that change over time based on donations received.

…and many more!

Want to see dynamic NFTs in action? plantoids is real example of these that evolve based on age or ownership.

Updating Dynamic NFTs

1️⃣ On-chain

This approach ensures that your data is on IPFS (blockchain) and not centralized on a server that someone would have access to.

This approach will etch the metadata into the blockchain forever.Every change requires a new blockchain transaction which can be expensive.
Requires a web3 wallet owner to edit the URI in order for the NFT to change metadata.Tracking transaction nonce and blockchain speeds can affect your update performance.

On-chain Flow

  1. Mint an NFT pointing the URI at decentralized data
  2. Process triggers for metadata updates
  3. Interact with a contract to edit the NFT URI while tracking transaction nonce
  4. Pay the transaction fees and execute the transaction
  5. Wait for the blockchain to index and process your transaction
  6. Wait for IPFS to resolve the updated metadata

2️⃣ Off-chain

This approach utilizes centralized servers (such as webservers, S3, etc.) and is accessible by anyone that has access to the storage medium.

Cheaper and easier to implement since data is controlled on the storage medium.Anyone with access to the storage medium can edit metadata.
Metadata can be updated in real-time without the limitation of blockchain speeds.Single point of failure that can cause NFT metadata loss.

Off-chain Flow

  1. Mint an NFT pointing the URI at centralized data
  2. Process triggers for metadata updates
  3. Update the metadata file on the server

Choosing a method

Whether you choose on-chain or off-chain dynamic NFTs, please consider the following:

  • Update frequency
  • Budget
  • Blockchain & associated performance
  • NFT mechanics
  • Operational security

Feel free to hop on our Discord server to understand how Crossmint can help you best!

Crossmint gives you the best of both worlds!

Regardless of which approach you take, Crossmint makes it easy for you to mint NFTs and update them dynamically.

When you use the Crossmint Minting API to mint an NFT you can specify how you'd like to manage your metadata.

On-chain approach

By default, we re-upload the metadata to IPFS. You can dynamically update NFT metadata by invoking the Edit NFT method on the Crossmint Minting API.

Off-chain approach

We do however have an option that lets you keep the metadata centralized by disabling the reuploadLinkedFiles flag on the mint request body.

Here is an example of how this would look like:

body: JSON.stringify({
		reuploadLinkedFiles: false,
    	recipient: <RECIPIENT>,
    	metadata: <URL_TO_METADATA_FILE>

The above method will ensure the metadata URI for the NFT does not get uploaded to IPFS and points at the metadata file provided.