What is IPFS? IPFS is the abbreviation for Interplanetary File System. The concept is built upon the vision of a decentralized Internet infrastructure. It integrates ideas known from approaches like BitTorrent and Git repositories, and is based on the concept of a distributed hash table, which is mapping all content identifiers (CID) to people who addressed a content with this identifier. A simple description would be, that IPFS is a decentralized peer-to-peer file sharing infrastructure. This peer-to-peer file sharing concept in combination with (decentralized) applications on a blockchain is a proper setup to solve interesting use cases, like NFTs.
An important aspect to mention is the immutability of files on the IPFS network: “Once a file is added to the IPFS network, the content of that file cannot be changed without altering the content identifier (CID) of the file” (source: ipfs.io). For the storage of files not one central infrastructure is the answer, but a distributed storage and file exchange is in focus. Many IPFS nodes supply the requested files, as one might know it from peer-to-peer file sharing networks. There are already commercial services like Pinata by which can be used to serve files via IPFS.
Commercial services identified the relevance of the NFT use case in the IPFS context, Pinata writes: “Pinata provides secure and verifiable files for your NFTs. Whether you are a platform, creator, or collector, simply upload through Pinata, copy your IPFS CID, and attach to your NFT before minting to have secure and verifiable NFT files.” (source: Pinata)
Cloudflare has a read-only distributed web gateway for IPFS and it’s possible to deploy an IPFS cluster to AWS.
IPFS and NFT
NFTs are one use case for IPFS. And not only the file distribution is of interest here, the immutability is a relevant aspect in this context, so that the NFT metadata can be connected to a content, that cannot be changed and is therfore unique and ‘original’ as intended.
Hic Et Nunc minted NFTs (or better say the files connected to this, like a JPG or PNG) are stored and served based on IPFS. A pinned file associated with a particular NFT can (by concept) be made available in a decentralized way. This means, that you could set up an IPFS node by yourself to make your NFTs available and so to secure the availability as well. You can use IPFS Desktop for setting up your node on your local computer system. A very good instruction on how you could pin your own NFTs can be found here (kudos to Matt DesLauriers). There is also a Twitter thread on this topic by @antic. Generally speaking, the procedure is: 1. setting up a node (with IPFS Desktop) 2. use a script to assign / pin all files of your collection with your node by using your Tezos wallet address. Then you can run the node based on the IPFS Desktop client and serve the files. With IPFS Companion, which is a browser extension and supports the ipfs:// addresses, your node can be accessed via local gateway, so that your NFTs can be loaded locally when you open your Hic Et Nunc profile. This is good for your internet traffic consumption, but it can lead to some caching problems (at least that is my experience). But overall this works and the primary target would be to secure your NFTs by joining the IPFS network with your local node, which then holds the files as well.
One thing should be very clear: The more people are running nodes to serve content of the internet, the more relevant will IPFS become. It’s up to you if you want to set up a node by yourself or not, if you want to use a service like pinata or if you do nothing. But data via IPFS can only be served in a secure or sustainable way, if there are enough nodes serving these files.
Note: I am absolutely not an expert on the subject. I set up my own node and explored background information etc. But if I missed important aspects or explained anything wrong, then just drop me a line and I will be happy to update this post. The ambition was, to create a basic idea of what IPFS is and how it’s used in the context of NFT.
Links for further reading:
- Klint Finley on Wired: “The Inventors of the Internet Are Trying to Build a Truly Permanent Web” – https://www.wired.com/2016/06/inventors-internet-trying-build-truly-permanent-web/
- Pinata blog posts on medium: https://medium.com/pinata
- IPFS infrastructure https://docs.ipfs.io/concepts/usage-ideas-examples/#ipfs-as-infrastructure
- Immutability of objects https://docs.ipfs.io/concepts/immutability/
- “Pinning” of files https://docs.ipfs.io/how-to/pin-files/
- Hic Et Nunc list of community tools, incl. a section on IPFS Pinning