Understanding the Anatomy of an NFT: What Data is Stored on The Blockchain?
Understanding NFT data has become increasingly critical for creators, developers, and brands that want to build new experiences with NFTs. Despite this, the anatomy of an NFT - its media, metadata and where it’s all stored - is commonly misunderstood. Let’s change that, shall we?
NFTs and Metadata: Two different things
Many of us have come to know NFTs as media files that have been tokenized, and attached to the blockchain. In reality, an NFT isn’t composed of just one thing, nor is the actual content of an NFT typically stored on the blockchain.
You can think of an NFT as a package that contains two key components: the token itself and the digital content, which is typically a media file. This file – the NFTs content – is known as the metadata. Let’s take a closer look at the role each of these components play and how they both work.
Most NFTs are represented by a snippet of code on the Ethereum blockchain. These token standards (ERC-721, -115, -5605) form the backbone of an NFT, existing as a permanent record of ownership by attaching it to the blockchain.
Your token does not usually contain any media (artwork, video, or audio files). Instead, the NFTs smart contract contains a link to the address where the media files are stored.
The NFTs content and metadata are not usually stored on the blockchain (ArtBlocks being one example). While this is possible, it’s prohibitively expensive and the blockchain is not really designed to handle the high volumes of traffic we’re seeing today, nor was it intended for storing large files. This is why managing NFTs usually involves splitting tokens into on-chain and off-chain components to enable them to run more efficiently on the network.
Can NFT metadata be changed?
Yes, depending on where the media is stored, NFT metadata can be changed in a number of ways. This includes pushing updates to your NFT images as well as changing the JSON to change traits or values. The only data that cannot be changed post contract deployment is the token numbers.
So where, exactly, is NFT media stored?
Each NFT token contains an on-chain field called a token URI (Universal Resource Identifier) which is sort of like digital coordinates pointing to the location where the media is actually stored. This is also what marketplaces look to when reading all of the information pertaining to an NFTs metadata. In the vast majority of cases, the URI will point to either an InterPlanetary File System (IPFS) hash or an HTTP URL on the web.
Centralized servers (HTTP) allow the blockchain to handle NFTs in a streamlined way by keeping your ownership on-chain and the media somewhere else. However, if the host entity disappears, the media files are lost forever. In this scenario, the link contained within the smart contract of an NFT would point to nothing, and the NFT would essentially become a broken web address. Some early works such as John Karel’s genesis NFT, Skull Still Life (2018), have already had content disappear due to their reliance on centralized storage solutions.
In contrast to a centrally located server, IPFS is a distributed storage solution that enables computers to store and serve files as part of its extensive peer-to-peer network, making it much less likely to be exposed to server issues. However, the content of an NFT will only remain on IPSF permanently insofar as one of the nodes in the network is storing the content and making it available. To ensure the longevity of their NFTs, many projects and marketplaces either pin their data manually or use a pinning server to ensure that there’s always at least one IPFS node that holds a copy of the data.
The problem with this method is that should the platform or project that’s maintaining an NFT’s IPFS data fail and stop pinning files, all the information stored through IPFS could be lost over time as nodes that held copies clear their memory caches or get shut down.
How to retrieve and analyze NFT data
Parsing and retrieving NFT data and metadata, especially at scale, can be extremely difficult. This typically requires sifting through individual smart contracts, understanding and working with various encodings and edge-cases, crawling HTTP or IPFS servers, and oftentimes dealing with unresponsive third party providers. Maintaining up-to-date metadata is a whole other ball game.
As it stands, there are limited resources and a lack of usable standardized tooling for analyzing on and off-chain data. The tools and protocols that do exist, like the Graph, can take several months to index, making app development an extremely time-consuming process. That’s where we come in.
The Blockparty Node: All the data you need to start building NFT projects or applications
Our node is one of the fastest and most reliable NFT indexers on the market, capable of capturing all NFT data on Ethereum and Polygon (over 500MM tokens) in less than 48 hours. This saves you time and effort parsing individual smart contracts, sorting irregular datasets, and making tens of calls to get the data you’re looking for.
Have an idea for a project or application? We’re currently looking for alpha partners with big ideas to build with. Our team will work with you on a case-by-case basis to create custom implementations that are uniquely tailored to your individual needs. Contact us to request a consultation.