To understand exactly what I mean by dynamic NFTs, we must first take a quick look at how the blockchain works and how data is stored there. Only then is it possible to understand what this concept is exactly.
A blockchain is immutable, any data written in there safely stored and cannot be modified at a later time. This is one of it's core offerings. Nobody, not even the creators, can alter the blockchain in any way. This apparently contradicts the idea of Dynamic NFTs
, but there's a few "gotcha"s in the story
The main issue is that storing data in the blockchain is expensive. No wonder, any data stored in the blockchain is part of it forever, cannot be deleted and every node that forms the blockchain must store it as well. As blockchains only add data, the amount of data stored keeps growing and becoming more expensive to maintain.
So, to try to make it as cheap and accessible as possible, NFTs don't usually store their metadata in the blockchain. Instead, they store an URL that contains their metadata. Storing a simple URL is much cheaper than storing all the data directly.
You would typically store the metadata in an immutable URL, using a service such as IPFS. This approach guarantees that the URL remains valid and contains the metadata. However, this is not a requirement, you can put any URL as the metadata URL, and that's exactly how this concept was born.
I created a Smart Contract that allows me to create exactly 1 NFT. I deployed the contract on Polygon and minted the NFT. As you can see, the metadata URL for the NFT is hardcoded. It is set to https://jorge.aguirre.sexy/nft/profile.json.
Since I own that domain, I can update the content at any time. This means I can always change the contents of the NFT to match whatever I want, without paying gas fees or interacting with the blockchain. You can see what the NFT looks like in Open Sea (although I can change the data at any time).
⚠️ Warning: One of the key features of NFTs (and blockchain) is immutability. Taking that away to make something dynamic is probably not the way to go. It defeats the whole purpose of NFTs. It's fine if you are experimenting, developing or whatever, but a solid NFT project should not use dynamic URLs to store their metadata. DYOR!