Immutable means unchanging. An immutable non-fungible token (NFT) must not change from the moment you mint to the end of blockchain's life. This means an immutable NFT must always represent the same object. This should be a core property of NFT artworks. Just like the painter of a painting you own should not be able to barge into your home and repaint or smear the artwork you hanged on your wall, the NFT creator should have no power to change or destroy an NFT after it came to your posession. Unfortunately, almost all current NFT projects lack this basic immutability property. This is a non-trivial issue that is overlooked by most NFT enthusiasts. Even if the NFT creator might be incentivized to not tamper with the NFTs after they are sold, it is undeniable that mutable NFTs bring “trust” to NFT ownership. What is the purpose of owning an artwork on a trustless ledger (i.e., blockchain) if you have to trust the creator of the artwork to not tamper with the art you bought? So, how are most NFTs mutable?
NFTs can be mutable through three ways: (1) changing the token URI (i.e., metadata URI) itself, (2) changing the contents of the token URI, or (3) changing the contents of external URIs in the metadata (e.g., image URI). Most collectibe ERC-721 NFTs are defined by their tokenURI
read-function. This function returns the URI of the NFT's metadata. The metadata is a plain text file that stores all the information about the NFT, such as its name, description, and it's image URI. Therefore, only a single link to NFTs metadata is defined on the blockchain, and everything else about the NFT is stored off chain.
(1) Most NFTs have a setBaseURI
write-function. This allows the NFT contract owner (i.e., the creator of the collection, not the owner of individual NFTs) to easily change the string returned by the tokenURI
read-function, essentially changing the collection all together.
CryptoFrens NFT contract is not ownable, and it lacks a
setBaseURI
write-function.
(2) Most NFTs link their metadata as HTTP URIs. HTTP was not designed with immutability in mind, therefore the content of each HTTP URI can be freely changed by the server owner. For immutable NFTs, metadata should be linked as an IPFS URI. IPFS URIs have the hash of the file they identify in their URI scheme, therefore an IPFS URI always points to the same file. Also a file linked with an IPFS URI can be decentrally recovered, which makes it resistant to censorship. IPFS is essential for persistence too. Because it allows anyone interested in the project to host its files to ensure that the links never die. Some NFT projects claim that they host with IPFS, however they instead use HTTP gateways of certain IPFS services. HTTP gateways still rely on centralized servers, therefore they should not be used for token URI. Only proper IPFS URIs (i.e., ipfs://CONTENT_ID
) must be used for linking NFT metadata and images.
CryptoFrens metadata and images are linked with IPFS URIs, hence they are immutable.
(3) The same points for metadata URI also apply for the image URI. IPFS must be used when linking images for immutable NFTs.
With our attention to elegant and robust design, we made CryptoFrens immutable. The contract creator is on equal grounds as any other address on the blockchain. Contract creator cannot change the token URIs. Both the metadata and image URIs link to IPFS, ensuring immutability of NFTs' contents. Anyone can download all the images and metadata in the collection, and host them on their IPFS node to ensure persistence of the IPFS URIs. We hope that future NFT projects on Avalanche will also stay true to the spirit of the blockchains and pay similar attention to trustless and immutable design.