Where and How are NFTs Stored? On-Chain, Off-Chain and Decentralized Storage
NFTs are a form of digital media, whose data is stored on a computer. In this article, we’ll discuss the different types of NFT storage available as well as their advantages and disadvantages.
Non-fungible tokens (NFTs) are a form of digital media. They are unique digital assets that are stored on a blockchain, allowing them to be verified as authentic and owned by a specific person. This means that NFTs consist of data that’s stored on a computer - from the smart contract it lives on to the URL that’s used to view the image itself. But what happens if this data is stored improperly?
Not all NFT storage options are the same. This makes it important for NFT owners to understand how NFT storage works, so they can make informed decisions about how they want to store their prized possessions. In this article, we’ll discuss the different types of NFT storage available as well as their advantages and disadvantages.
What is NFT Media Storage?
NFTs are smart contracts created on a blockchain that represent digital deeds to a virtual item. In most cases, the NFT itself only holds the smart contract while the content that it claims ownership to is actually stored separately. The NFT’s smart contract is coded on a blockchain as a set of rules that facilitates transactions. The metadata is the file that holds the actual image, music or digital data that the NFT’s smart contract claims ownership over.
Having stored the NFT means that you have stored the contract, rather than the data. To find out how your NFTs are storing their data, you can search for this information on their smart contract using Etherscan. Another method is to use an NFT marketplace platform, such as OpenSea, and select the “Read Contract” option. NFTs that are stored off-chain typically have a “ipfs:/” or “https://api” followed by a project name in their smart contract with a token number.
Why is NFT Storage Important?
This separation of the NFT smart contract from the data it points to means that the contract can still exist even if the data disappears. It then becomes important to have proper storage for the data that NFTs refer to. The disappearance of NFT data has real life examples, such as the disappearance of a $11M NFT album sold in 2021 by 3LAU.
There are several ways that a purchased NFT can be lost or have its data changed. The NFT’s smart contract might not be linked to the asset directly or the asset might be hosted on a centralized provider that is shut down. The NFT’s smart contract can be linked to a URL, meaning that whatever is stored from that URL can be changed even after the NFT is sold.
It’s important for NFT holders to understand NFT storage so they can make informed decisions about how they want to store their NFTs.
What are the Different Options for Storing NFT Media?
On-Chain NFTs Storage
Storing an NFT on-chain means that all of the NFT’s data (ex. Image, metadata) exists on a blockchain. On-chain storage is generally preferable because this allows users to verify all aspects of the NFT. But storing data on-chain is not usually practical.
Few NFT projects actually use this method for storing NFT data. This is because JPEG images contain a lot of data, which is expensive for collections that have tens of thousands of JPEG images that they need to store. This means that most NFT projects store their images off-chain (ex. CryptoPunks, Bored Ape Yacht Club).
Some projects, such as OnChainMonkey, have found a way around this high cost by storing their images in vector format, instead of pixels. This makes the image file small and lowers the cost barrier to storing all their data on-chain. Another solution is to store the SVG code of the image on-chain. SVG code shows what the image should look like and is created using math formulas. This format requires less space and makes it less expensive to store data on-chain.
Off-Chain NFTs Storage
Storing an NFT off-chain means that some of most of the NFT’s data is stored outside of the blockchain. When an NFT is stored off-chain, the NFT’s smart contract contains information that reveals this off-chain location so it can locate the JPEG image. Often, this image and its metadata are stored in a hash that points to either a centralized or a decentralized hosting provider.
Centralized hosting providers include Amazon and Google, which can run servers that store the NFT’s data. Around 80% of NFTs store their data off-chain. Having data stored on centralized servers has both advantages and disadvantages.
On-chain storage is the lower cost option for NFT data storage. However, there is a risk with centralized providers that they can exercise control over the data that they store and can be shut down at any time. NFT owners would be unable to access their NFT’s data in this case. Centralized companies may also be hacked and lose the NFT data they were paid to store.
Decentralized Media Storage
Decentralized NFT storage refers to transferring authority from a single entity to a network of parties that work together to reach consensus. This means that there is no single point of control, failure or corruption.
Having a decentralized NFT storage system means that data is not held by a single entity, but rather it is held by multiple agents. This means that no individual agent can alter or delete files without the authorization of all others. Even if one platform fails, NFTs will remain accessible. Data kept in decentralized storage is also protected against modifications.
Using a decentralized NFT storage system is important because your NFT assets are precious. If you’re entrusting them to a third party, you need to ensure that they will be kept safe and that they will be accessible at all times.
One popular decentralized hosting solution for NFTs is the InterPlanetary File System (IPFS). IPFS is a distributed peer-to-peer network that stores files across multiple nodes. This distributed storage system makes them resistant to single points of failure such as server problems. This also makes IPFS more censorship-resistant compared to centralized hosting providers.
Using IPFS requires more technical understanding of data storage compared to on-chain or off-chain options. Users can upload files onto IPFS and create a unique content ID that can then be hosted on one node or distributed across multiple modes. It’s also important to know that IPFS data can’t be modified without changing its content ID, which is more secure compared to storing this data off-chain.
However, files stored on IPFS can still be lost. While the content ID of the file is permanent, a copy of the file has to be available in order to be accessible. If no one is hosting the file, it will be inaccessible. If the operator of an IPFS node deletes that file, then it will become inaccessible. Unless the creator of the NFT has pinned the NFT’s data to a public 24/7 server, it’s also possible for the data to “age out” of the system over time.
In addition to IPFS, other decentralized storage options include NFT.Storage, Crust and Arweave. Learn more about how to decentralize your NFT storage using Metacommerce by reading our article!
Although it’s easy to assume that once you buy an NFT, this means that the image, music or other digital information will be available to you forever, it’s vital to understand NFT data storage. There are multiple options for storing NFT data, such as on-chain, off-chain and decentralized storage. Each of these options have advantages and disadvantages. To avoid a negative surprise with your NFT data, make sure you understand how your NFTs store their data!