Decentralized Data Storage
While DeFi focuses primarily on the movement and storage of cryptocurrencies, blockchain networks are capable of storing more advanced data mediums including files, images, and videos. Instead of relying on a huge centralized server powered by the likes of Amazon or Google, decentralized data storage works by creating an open market for providing and using storage, where users are able to contribute to the network by providing storage space in exchange for payment.
Decentralized data storage is possible through technology such as Merkle Trees, which are special data structures that allow users to easily find and retrieve data across a network. This system is what is responsible for assigning hashes to each transaction created on-chain and makes it possible to determine the exact block number in which it was created. Merkle Trees are often found outside of the blockchain world and used in various databases. Applications such as GitHub use Merkle Trees to track code repositories.
To learn more about Merkle Trees, check out this GeeksForGeeks article as well as the Ethereum documentation on Merkle Patricia Trie, which is a version of a Merkle Tree that Ethereum uses.
InterPlanetary File System (IPFS)
IPFS is the base layer for operating a decentralized storage network. It is responsible for distributing and identifying data across the network and making it available to everyone - it is not the data storage medium itself but rather a protocol designed to replace ineffective centralized systems of finding and retrieving data.
IPFS acts as a decentralized alternative to HTTP, the current standard for retrieving data from centralized servers. HTTP works by sending a request to access a web page from your device to a centralized server using the URL of the website to find its location on the server. Websites on the Internet operate by this standard, where if a user searches for a site, an HTTP call is made that retrieves the site from the server.
Source: CCNA
IPFS, on the other hand, works by using a blockchain system to retrieve data stored on nodes across a network. Each piece of data has its own unique identifier that lets the system find and retrieve it from the network and present it to the requestor. Instead of using the URL of a site to determine which server to retrieve data from, IPFS uses this unique identifier system to validate and pull data from the network.
Here is how IPFS stacks up to HTTP:
Source: DCFT
To learn more in-depth about how IPFS works, check out the IPFS documentation.
What are some applications built on IPFS?
Since IPFS is just the system responsible for routing requests, actual applications need to be built in order to harness its true potential.
One such application is Filecoin, a fully decentralized storage network. Filecoin works by creating a blockchain that operates as a huge decentralized database, with each node contributing storage space to the network for consumers to use. In return for providing storage space on their devices, node operators are paid in FIL, the network’s token.
Source: Filecoin
When a user wants to store data on the network, they are able to view the available providers and their prices to decide which best suites their needs. Once a provider is chosen, the user will send them the data and they will store it in exchange for payment in FIL. This system operates purely peer-to-peer, with no intermediaries - the client picks a provider, sends them their data to store, and pays for it in FIL.
Even though the data is stored directly on a provider’s device, they can’t view it because it is encrypted. In order to earn money on their work, storage providers must prove to the network that the data is being securely held and is properly encrypted. They must submit proof of encryption by adding new blocks to the Filecoin network that contain transactions, which validate that the system is secure and encrypted. Once they prove that the data is safe, they earn FIL from the deal they made with the client as well as via block rewards for operating the network.
💡 An example of data being stored on Filecoin
Imagine you are a small business that has 10 TB of important data. You need a cost effective and secure solution to store your data, so you decide to use the Filecoin network.
- You would find a storage provider on Filecoin that matches your storage and cost needs
- You would agree to a deal and then securely send your data for storage to the node
- You would pay for the storage in FIL for as long as you need it based on the agreed upon rate
- You would be able to retrieve the data at anytime and terminate the deal
Filecoin operates by minimizing proximity from the user to the data being stored. With a global network of nodes, clients are able to store data on the node closest to them, which makes it much faster and cheaper to send and retrieve data to and from storage.
Multiple nodes can also contain copies of the same data, making it even more accessible to everyone.
For example, if you are based in Philadelphia and create a website, you would host it on a Filecoin node that is located in or near Philadelphia. If the website becomes popular with users in London, instead of requesting the site from the nodes based in Philadelphia, London-based nodes could repost it so the data is physically near the new users.
This maximizes the efficiency of the network while also creating a scalable economy that optimizes the flow of data worldwide.
Check out the Filecoin website and documentation for a more detailed and technical understanding of how the system operates.
Another popular protocol for data storage is Arweave. Arweave functions in a similar manner by sending requests and data to nodes across its network. This lets users utilize Arweave for a whole variety of tasks, including file storage, site hosting, and creating shareable content. for a more complete overview of available applications, check out this list by Alchemy for a whole suite of other decentralized storage tools and learn how they differ from one another in terms of efficiency and capability.
📋 Practice Question