Typefully

IPFS: Half of the missing piece of Web3 Infrastructure

Avatar

Share

 • 

4 years ago

 • 

View on X

Say you spend a solid 120⟠ on an NFT, just to have your new precious JPEG hosted on S3 🙈 Even worse, the location is permanently stored in the Contract. If someone tampers with the file then what? Let's look at an alternative that fits Web3 better 🧵👇
When you buy an NFT, your ownership is indisputably stored on the Blockchain. But the data, say a JPEG, is too expensive to store so it ends up somewhere else. One day you might wake up and your NFT doesn't show anymore, because the file was deleted.
Unlike Ethereum, most options for storing data on the internet are not permanent. Hosters might remove the file, Goverments might censor it and networks might break. Not the indisputable ownership you were looking for? Let's look at an alternative suited to Web3: IPFS
IPFS, short for Interplanetary File System, is a protocol and peer-to-peer network for storing and sharing data. The core idea of the network is to separate content from location. Separate the what from the where.
Before we get into it, let's look at three problems of data on the internet as we know it: 1️⃣ Integrity: You might get different content for the same location, depending on when you ask. This is because the internet relies on content by name, mostly in the form of DNS.
2️⃣ Availability: When the server to which the location is pointing fails, the content cannot be reached. This is because the internet relies on centralised data centres, like AWS.
3️⃣ Reliability: If the provider of the content decides to take it off the network, there is little you can do. This is because we put our trust into BigTech, hoping they will act honest.
Do I expect Yuga Labs to secretly change your Ape? No. Do I expect AWS to have an outage? No. Do I expect OpenSea to delete your JPEG? No. (Actually, not sure about the last one) But the power of Web3 all comes from not relying on a single company like in Web2.
Ok. This is what we don't want. Next, let's understand how IPFS works, to see how to design a system better suited for the next version of the Web.
Similar to a Blockchain, IPFS has a protocol at its core that defines how the network operates. Everyone can decide to participate by running the IPFS Client. Doing so makes you a Node in the network.
Here is what happens, when adding a file to IPFS: The file is cut into equally-sized chunks and given a unique fingerprint, called Content Identifier (CID). The CID is a permanent identifier that allows to retrieve the file from the network, regardless of where it is located.
Whenever another network participant retrieves the file, they store it in their cache. That way, they act as “Seeders” of the file and allow other Nodes to retrieve it from various places.
To make sure that a file remains on the network, Nodes can pin them. Pinning prevents the file from being Garbage Collected (=deleted). Garbage Collection has the same purpose as in runtimes like Java: get rid of stuff that's no longer required.
The most important concept in this is the CID. CIDs are generated using a cryptographic hash function, which guarantees two important properties of the content that is stored on the IPFS:
1️⃣ Uniqueness: The hash function will always result in the same output, given the same input. That way, no piece of content is ever store twice in the network.
2️⃣ Integrity: When you request data from the IPFS network, you do not ask for the location, but for the content (CID). This has the nice side effect of guaranteeing that the content you are asking for is exactly what you want and hasn’t been changed or tampered with.
IPFS is a decentralised, permissionless database, without any central authority controlling it. So... Is IPFS a Blockchain? Short answer: No. But let me give you a long answer as well.
It shares some of the traits of a Blockchain: 1️⃣ Nodes can permissionlessly participate in the network. 2️⃣ Due to the decentralised nature, IPFS can’t be censored and doesn’t have a single point of failure.
But it's also different in important aspects: 1️⃣ Nothing is permanent on IPFS. Once data isn't pinned by at least one node anymore, the GC will get rid of it and it’s gone. 2️⃣ IPFS isn't incentivised. The protocol doesn’t reward users in any way for provisioning data.
And this is pretty much the core problem of IPFS: There is no guarantee for data to be available The only guarantee is that if you pin it on your Node, it won’t be garbage collected there.
So, while IPFS sounds like a centre piece of Web3 Infrastructure, it's missing two key features: 1️⃣ An incentive-system 2️⃣ Data persistence guarantees As you can imagine, someone already had that in mind 😁 Filecoin is a Blockchain that does just that. Let’s explore it next 💪
If you want to read more of this, my goal is to write 1 Thread every week of 2022. In simple language that anyone (in particular, me) can understand. twitter.com/CordtMinzer/status/1477305115254177796
Avatar

cordt.lens

@CordtMinzer

Product @Ledger // Nights+Weekends @lentilapp