What is an NFT?
NFT stands for Non-Fungible Token, a digital asset which is unique and indivisible. Non-fungible tokens are digital certificates of ownership for things like collectibles, artworks, or items inside of video games. The NFT is stored on the blockchain, and essential fields of information stored on-chain include the NFT name, description, date created, and the address of the creator. The on-chain data will also typically include an image URL pointing to where the visual content is stored, and custom property information like rarity, collection name, and license information. The fee associated with minting and transferring ownership of an NFT increases with the amount of information stored on-chain. As a result, many NFT’s keep information off-chain in decentralized storage like InterPlanetary File Storage (IPFS) or in a typical cloud service like Microsoft Azure or Amazon S3, and include a link or hash of this data on-chain.
Each NFT is tracked by a smart contract, which defines the ownership of the NFT and the ability to transfer it. It is the code written onto the blockchain. ERC-721 is the most common token standard for writing NFT smart contracts. ERC-721 specifies some minimum functions and events that must be included in any smart contract to be compliant with the standard. The most popular implementation of the ERC-721 standard is from OpenZeppelin, which is open-source and can be copied freely as a preset or with modification. As implied in the name, the NFT is a token, or certificate of ownership, made possible by a publicly verifiable and timestamped transaction on the blockchain, and is not the media itself. This distinction causes confusion for many people, sparking the “right-click, save-as” meme. The combination of the smart contract, metadata, and media, comprise the token that you hold.
On-Chain vs. Off-Chain
When developing an NFT project, you have some choices about what data is written to the blockchain itself, and what remains off the chain and is instead referenced within the NFT smart contract. Below is a chart which lays out the pros and cons of operating a few key mechanisms and NFT data either on or off the blockchain. It is organized first by describing transfers and ownership, payments and auctions; followed by token metadata, media, and token-gated media.
Striking a Balance
In general, the on-chain/off-chain tradeoff is always between security, reliability, and verifiability; vs. cost, flexibility, and speed. However, some types of data (as illustrated in the chart above) are more suited to being stored off-chain to reduce the size and complexity of the NFT smart contract. One possible strategy would be as follows:
- Keep NFT ownership and transfers on-chain.
- Allow payments to be made both on and off-chain.
- Any mechanisms for auctioning NFTs and storing token-gated media can remain off-chain for cost-savings and ease of operation.
- Token metadata and the media itself can be stored off-chain in a decentralized storage system like IPFS, with backups on a cloud storage provider.
This setup optimizes the benefits of both on-chain and off-chain solutions. Of course, this is just one way of structuring an NFT project, and thousands of successful platforms use a wide range of tactics. The strategy is developed with the Ethereum Mainnet in mind, where gas fees and minting costs can be prohibitively expensive. More token metadata could be written directly onto the on-chain smart contract if using a blockchain with lower fees like Avalanche, or a side-chain/layer 2 like Polygon or Optimism.
Additionally, the amount of data that should be stored on-chain depends on the goals and complexity of your NFT project. If you don’t know where to start, we can help. Get in touch about using our blockchain application server MultiBaas to help build a customized NFT project, or if you want to start selling NFTs right away on Shopify, take a look at our NFTeapot Shopify App.