This isn't an article saying decentralized storage is the only correct method for storing NFT assets. There are different use cases of NFTs that require different considerations.
With that out of the way let’s dive in!
Typically you have three scenarios:
First option could be PFPs who want to validate asset rarity via permanent decentralized storage and changing the image would require a baseURI update. Let’s look at an example of this method being used.
In order to look up where a NFTs media is hosted look at the smart contract.
Look for a function named "tokenURI", this will let you look up an NFTs metadata. Add the token ID you are looking up and click "Query".
Because @DeadHeadsNFT uses IPFS a gateway is needed to view the metadata directly.
Copy the CID string given to you by the response to the Query “QmXWterRf7TsZsbbFvRUmYyw42fW7fyAjd21yoRXePrvnv“ and use a gateway like gateway.pinata.cloud/ipfs/ to view the NFTs JSON file
Copy + paste the CID from the "image" object into a gateway like before, "QmabBHDdH6q77mt7AmfPjzWHdRi1NXLNV4hjUaR1ftU7jw".
Navigate to the CID with a gateway and you can now see the image used for the NFT
Follow the exact steps as above to view the NFTs metadata. Then instead of an IPFS response you will find the projects internal server. An example of this is @OthersideMeta where the NFT metadata and image is stored on their own servers.
Here is a link to Otherside Deed 82785 metadata.
Looking at the deeds metadata notice the image is stored on their own server also, this is so they can change it at any time they want with no ETH gas fees.
In the future when users move over to layer 2 solutions like Optimism, Arbitrum and Immutable there wont be as much of a need to use internal servers. Transaction fees will be fractions of a penny to execute.
This results in more transparent data for users and a more decentralized web!
This time there are no servers you navigate to in order to see the assets image. The image itself is saved as a base64 encoded SVG. An example of this is @wolfdotgame sheep.
Use the same step by step process as above but this time there is a twist. The metadata is base64 encoded.
That big chunk of text above equals the sheep metadata in base64 format. You will need to convert that into JSON and you can then see the base64 SVG string under the image object. That is the NFT SVG completely on chain!
SVG images are also infinitely scalable because it’s a vector image. You can make the image as big as you want and it won’t sacrifice quality or sharpness.
Enjoy digging into NFT smart contracts and gathering more information about what you are purchasing!
Written by Squirt11e
Dev / PM @DeadHeadsNFT
Team Lead @rebudNFT
Twitter @squirt11e
Web3 builder | NFT collector | DeFi believer | Glass always half full