The Decentralized Internet and Off-Chain Storage with IPFS

During the Smart Contracts and Blockchain series we have seen different ways to decentralize part of the logic of an application, but Smart Contracts and Blockchain technology are not the only way to do it. In its early days, the Internet could have been considered decentralized since it only ran on a few computers distributed in a few garages and university halls around the world. Over the years and the creation of data centers and the arrival of “Cloud Computing” Internet has been centralized until today in which a couple of companies practically have Internet.
Figure 1: Blockchain & Smart Contracts: The Decentralized Internet

And Off-Chain storage with IPFS

With the resurgence of Blockchain technology in 2013, the idea of decentralizing the Internet returned, in order to have a global network resistant to censorship in which the owners of the data had true control over them. And since then there have been great advances such as the emergence of decentralized social networks and Open Source, protocols for the decentralization of the Internet such as the DUST-RSS project to use PGP and P2P to have a serverless blog without censorship, serverless web portals distributed with Osiris SPS or the arch-famous today IPFS that we are going to see in this series

Decentralized social networks

It is clear that the paradigm today followed by most social networks is that of WEB2.0, a model in which the centralization and trading of user data governs, in which the user has almost no control over how manage your own information. Currently we have the WEB3 paradigm in which, thanks to Blockchain technology and Smart Contracts, decentralized platforms can be “easily” created. However, this technology has not been entirely necessary to create social networks of this type, see the example of the following, some of which even emerged before smart contracts.
● Mastodon: This social network is totally Open Source as well as clearly being decentralized given its architecture. The structure that follows is very similar to that of interlaced nodes, in addition to the fact that it implements the Activity Pub protocol, an open source protocol for the decentralization of services.
In this network, each node can be hosted on a normal server or on your own PC and it does not matter which node you connect to, whether it is a large server or your own computer, you will be connected to all the others.
● Diaspora: It emerged around August 2012, although its creators started with it in 2010. Its three key ideas as a means of social connection are: freedom, decentralization and privacy (where you are the owner of your data), it is also Open Source (repo).
To achieve decentralization, they follow an architecture similar to that of Mastodon, only in this case, instead of using nodes, they use pods, which are self-hosted servers when executing the app.
● Matrix: It was created in 2019 and defines itself as follows “Matrix is an open source project that publishes the Matrix open standard for secure, decentralized, real-time communication.”
Figure 4: Graphic representation of the operation of the Matrix
They provide a great SDK for developers so that they can create different apps and websites that work on their infrastructure, which is also decentralized and works in a similar way to the nodes of the blockchain in which all the information is replicated. in real time.
● Block Square: A few weeks ago Jack Dorsey left his position as CEO of Twitter to continue his personal project, at the time it was called Square and its objective was to be a decentralized social network that offered SaaS services.

But now, with its departure from Twitter, Block has emerged, which will be a technological conglomerate that brings together Square, Cash app, Spira and Afterparty with its recent acquisition to be able to operate transactions in Europe.

Decentralized Storage

If you have read any of my previous articles on Smart Contracts, you will know that when creating one it is very important to optimize the storage that it is going to use as much as possible, since there are limits that cannot be exceeded and everything that is stored in the Blockchain It has a cost and it is usually not low.
Having this we see that it is practically impossible to set up a completely decentralized social network in which all the data is stored in the Blockchain itself and if it were still possible today the costs would be unaffordable.
For this reason, there are Off-Chain solutions (outside the Blockchain chain itself) that are responsible for storing data in a decentralized manner, ensuring that the uploaded files are immutable.
Thus allowing us to delegate part of the storage to other services other than the Blockchain without having to break the principles of decentralization in our application.

IPFS

A good example of Off-Chain storage is IPFS or “Inter Planetary File System”, a system that allows files to be stored on its decentralized network so that they are always accessible. On the official website they are defined as:
“A peer-to-peer hypermedia protocol designed to preserve and grow humanity’s knowledge by making the web upgradeable, resilient, and more open.”
At a high level, when a file is uploaded to the system, it separates your file into smaller pieces and assigns each one a unique identifier, then sends each one to different nodes of the network that will be in charge of storing them.
When a file is required from the system it will ask the different nodes to send the different parts that they store with the unique identifier that you gave us before. In addition, when a node downloads or observes a complete file, it copies and caches it so that next time the file is available more quickly. Then, the more times a file is accessed, the faster it will be available from the different nodes of the network, thus creating a kind of CDN (Content Delivery Network) service in which the most “popular” files are those that will be more quickly accessible. .

The files, once uploaded to the network, are immutable and therefore resistant to censorship and change. And the most interesting thing is that to upload a file to the network you simply have to run its program on your computer or use a service like Infura that will charge us 0.2 dollars/GB. These are ridiculous sums compared to the figure of $76,000/GB that Ethereum charges today.

Of course, this is an explanation of the operation of IPFS made in a very abstract way and at a high level, for those who want to understand more in depth how the system works, here is the link to the original IPFS whitepaper. Today there are more and more protocols and networks such as IPFS that facilitate the decentralization of applications and their data, but there is still a long way to go and technologies for the internet to be decentralized, but who knows what the future will bring us;)

Related Posts

Leave a Reply

%d bloggers like this: