Dynamic NFTs and Their Potential
From Static to Dynamic — How NFTs are Changing the Face of Digital Ownership
- Dynamic NFTs are interactive tokens that change on-chain data based on events.
- Current NFTs face challenges with static data or centralization risks.
- Starknet enables dynamic, decentralized NFTs with reduced computation and storage costs.
- Dynamic NFTs allow for innovative applications in gaming, music, and art.
- The emergence of dynamic NFTs signifies an evolution in the NFT space, providing increased flexibility and adaptability.
If you’ve been following web3 for the past couple of years, you’ve probably heard of the Bored Ape Yacht Club — NFTs that have sold for hundreds of ETH. (The largest Bored Ape Yacht Club sale was made for a whopping $3.4 million.)
These JPEG images of pixelated characters are probably what comes to mind when you hear the word “NFT.” However, the concept of a non-fungible token is much more diverse than just JPEGs, and potentially much more powerful.
In this article, we’ll look at the concept of dynamic NFTs — NFTs that can change their on-chain data in response to an on-chain (or even real-world) event. We’ll look at a few current examples, some potential future uses, and then at how Starknet enables this new kind of NFT with its cheap computation and storage costs.
What Are Dynamic NFTs?
NFT stands for “non-fungible token,” a digital asset that represents ownership of some unique item/information. Creators can tokenize their works by representing them with NFTs. For example, tickets to events can be represented as NFTs, real-world assets such as real estate property can be bound to such tokens and become tradeable, and even music and movies can be captured as NFTs.
But these NFTs can still be considered “first generation” — the more interesting use cases have yet to be explored, and evolutions of the standard are being created.
One example of the future of NFTs is Dynamic NFTs — NFTs that can change the value they represent. For example, NFTs that represent an image can have the image change colors and shape or even attain a completely new appearance. Audio NFTs can evolve their audio in reaction to on-chain events.
Since all the data related to such NFTs is stored on-chain, these changes are transparent and can be tied to certain permissions or events. We’ll get into the details of how such a project might work later in this article, but first, let’s look at NFTs from a technical perspective and consider why most NFTs today can’t be dynamic.
The Current State of NFTs
Usually, when we talk about NFTs, we refer to the ERC-721 standard, which was formally created in 2018. The ERC-721 standard is a base interface for non-fungible tokens that declares a few of the functions that every smart contract implementing ERC-721 must support. (For those with no Solidity background, it is a kind of blueprint that defines how to interact with a contract/class, specifying functions but not their implementations).
Whenever an NFT changes hands, the `transferFrom` function is called, which changes the owner of the NFT in the ledger. Similarly, when we check who owns a particular token, we call the `ownerOf` function.
Marketplaces like OpenSea rely on NFTs to support this standard in order to display tokens on their websites and transfer NFTs between buyers and sellers.
However, let’s look deeper at one of the BAYC NFTs: Ape #8817. If you visit the page on OpenSea, you’ll see the image associated with the 8817 Ape. However, where is this image stored? It’s not on-chain! Storing the whole image on the Ethereum mainnet would cost a small fortune in storage space, and considering that there are millions of NFTs on Ethereum, it’s not possible to store all those images on-chain.
Instead, what these smart contracts do is store all of their NFT-related data (i.e., “metadata”) on some URL that is accessible from the internet. The two main options for NFTs are keeping the metadata off-chain but on a decentralized storage solution such as IPFS (here is an example of the metadata related to Ape #8817), or storing the data on a centralized source like traditional cloud storage.
The first choice — IPFS — creates a fundamental constraint: the data becomes static. Since data, once stored on IPFS, cannot be modified, making any amendments to IPFS is impossible.
The second solution allows modification of NFT-related metadata but introduces the serious problem of centralization, which goes against the ethos of blockchain.
Hence, in this constant conflict of increased accessibility vs increased centralization, we end up with NFTs that stay “the same” even for use cases that need dynamic changes, such as gaming, SBTs, creator tokens, etc.
NFTs that get the benefits of both of these options — dynamic and decentralized — are needed. This is where dynamic NFTs come into play.
Dynamic NFTs Made Possible by Cheap Computation and Storage on Starknet
Starknet is a validity rollup (commonly known as a zero-knowledge rollup) developed by StarkWare that uses cryptographic systems called STARKs to massively decrease computation and storage costs. Because of these savings, Starknet finally makes the concept of dynamic NFTs — dynamic and decentralized — a possibility.
Let’s look at how it works with an example.
The Carbon Protocol is a project that is a hub for carbon neutrality, from funding regeneration projects to managing companies’ net zero programs and reporting. Their strong commitment to decentralization and transparency led them to develop one of the first proofs of concept for “dynamic” NFTs, such that the metadata for the NFT is stored completely on-chain. Below is an example token of the NFT contract that Carbonable deployed.
As an experiment, I transferred a major chunk of this “value” to another address — and automatically, the metadata related to the token was updated. The image describing my token also changed, and as we can see below, the color of the text changed from golden to bronze. Note that this change has happened completely on-chain. This is the power of dynamic NFTs!
Unlike ERC-721’s, where the balance and ID of a specific token are used to understand the ownership of an NFT, for dynamic NFTs, the main information is the value stored in a token.
What this means is that whenever a user requests the value stored in the token, the value can change. This is implemented by declaring a simple contract (let’s call it the “metadata” contract) that handles both the dynamic and the static part of the NFT metadata. For a more superficial understanding, we can think of the “static” part as a short string that stores some property of the NFT.
On the other hand, the “dynamic” part is different because to return some information (for simplicity, let’s assume it also returns a string), it can run some code on the metadata contract. The code can be dynamic in the sense that the values it returns can change with different chain-specific parameters or the state of the contract itself. It would be possible to change the state of the contract upon external interaction.
Note that the metadata contract only has to be declared on Starknet; there is no need even to deploy it as such. Unlike Ethereum, Starknet distinguishes between a contract class and a contract instance. A contract class represents a contract’s code (but with no state), while a contract instance represents a specific class instance with its own state. When you declare a contract class, the code is stored on-chain, but there is no state to upkeep. Since the metadata contract does not necessarily have to have a state, simply declaring it is enough to run the code inside the functions which are called by the NFT contract.
The proof of concept deployed by the Carbonable team is completely decentralized since the SVG stored by the image has all the code deployed on the contract (see code here). This allows anyone to keep track of the changes made to the SVG. As soon as the token is transferred from one user to another, the token’s value can change, showing its ability to adapt.
Use Cases for Dynamic NFTs
This example deployed for testing purposes only opens the door to a vast array of possibilities, such as:
Images and animations. As the example above shows, amendable images can be stored on-chain. However, similar to that, animations can also be stored on-chain and can be modified with user interaction. Several teams are working on this right now with massive possibilities in the crypto-gaming space. For example, in the proof of concept project by Carbonable (that we mentioned earlier), the color of the text changes with the value stored in the token. So, if a user has a token with value > 1000, the color of the text can be golden, where it would be silver if the value is in the range of 100–1000.
Music and audio. When we listen to music or audio files, these files are often in a .mp3 or .wav format. This format of an audio file is “finite” in that there is no quick way to change a beat or a small part of the clip. Audio formats (like WAV or MP3) store actual sound data, while MIDI (Musical Instrument Digital Interface) files contain instructions for synthesizers or other devices to generate sounds.
Raphael Doukhan, the co-founder of Rosis Lab, worked on a proof of concept for generative music by storing a MIDI file as a JSON object on Starknet and allowed the file to be modified by external interaction. Some parts of the music file were constant (e.g., music structure, melody theme, etc.), and others were amendable (e.g., BPM, tension profile, keys, etc.). This proof of concept was a prime example of generative music where an artist’s work “is not a finite object anymore but just lives beyond the creator and beyond the creation.” For example, the beat frequency of the audio file can be changed as users interact with the file, and hence, the music would attain a unique characteristic upon new interactions.
Gaming, fantasy sports, and collectibles. On-chain games could harness the power of dynamic NFTs to make in-game changes to the environment, objects, and characters based on different gameplay.
For example, Realms, a multiplayer on-chain game on Starknet, is exploring the use case of dynamic NFTs to have on-chain character skins (and even music) that changes with the game.
In fantasy sports, character features could be upgraded/downgraded based on the player’s real-life performance (which could be retrieved from oracles). An example of this is LaMelo Ball’s ChainLink-powered NFT. After each game, the NBA player’s stats are brought on-chain using an oracle, and the fans can collect the player’s “talent” as tokens. There are 4 different categories of LaMelo’s NFTs: Red Mars, Blue Neptune, Silver Moon, and Gold Sun. They are all tied to different statistics of the NBA player. For instance, Red Mars is tied to the points scored, and Silver Moon is tied to assists made. Hence, each time LaMelo scores points or makes an assist, the value inside the respective NFT increases.
This idea can be incorporated in games so that skins of the characters become “cooler” as the player’s level increases, or the player’s achievements are shown on the NFT as medals and trophies.
Generative art. Art comes in many forms, some of which have been discussed above. However, the notion of art is wide open. OG:CR (Organic Growth: Crystal Reef) is a dynamic NFT project that bridges digital and physical art. Users can collect NFTs of crystals on-chain, and the NFTs evolve with every transfer between the users. The user’s wallet history (with a hint of randomness) decides the changes made to the crystals. The end idea is to convert the digital crystals into a physical art piece that can be displayed in museums worldwide.
Dynamic NFTs Are an Evolution
NFTs, though still early in their development, offer a myriad of applications. The emergence of Dynamic NFTs represents a further evolution in the uptake of this technology. Storing a considerable amount of information efficiently and modifying it consistently is made possible by chains with low-cost computation like Starknet. Starknet is witnessing significant ongoing development, and now is an opportune moment to join the developers of the future and consider building projects with exciting new use cases on Starknet.
Dynamic Non-Fungible Tokens (NFTs) are at the vanguard of a digital asset metamorphosis, responding and evolving in concert with on-chain or real-world events. These enhanced versions of traditional NFTs shatter the mold of static data, introducing transformative changes in value and form. The power of Starknet’s cost-effective computation and storage brings the dream of dynamic NFTs into reality, unveiling an abundance of possibilities such as adaptable images, evolving music, interactive gaming, and generative art. As our exploration of the blockchain and digital asset universe continues, dynamic NFTs embody an exciting evolution, marking a new era in the spheres of technology and creativity.