Decentralized Files Storage — IPFS (interplanetary file system)

When it comes to mass usage of web3 features, it is important to not get lost in combination of decentralized solutions with highly…

Decentralized Files Storage — IPFS (interplanetary file system)
43th day of a challenge

When it comes to mass usage of web3 features, it is important to not get lost in combination of decentralized solutions with highly centralized tools. In some cases it can totally centralize dapp what is like making fire with a bucket of water. Just do not make sense.

In many dapps it is needed to store some informations, previously it could have been made by databases of big companies like AWS or Google. It is not bad, but for example metadata of NFTs should be recorded on decentralized services.

Fortunately, there is a solution for such cases. It just requires to use, for example IPFS — interplanetary file system, which prevents from decentralization. Let’s take a closer look for this tool.


Agenda:

  • intro,
  • definition,
  • how content is addressed?
  • DAGs,
  • DHTs,
  • Conclusion

Definition

IPFS is a peer to peer (p2p) storage network, what means that content is accessible through peers who can be located all around the world. IPFS returns data to user by content address, rather than its location.


How content is addressed?

In IPFS, addressing is proceeded by referencing the content. It means that file you seek is found by what it includes, not where it is, like in standard browsing.

Right now, Internet is basing on url, paths to content, but IPFS uses hashes, which are generated individually for each item.


Directed acyclic graphs

IPFS and other decentralized structures use Directed acyclic graphs, what means that each node in network has an unique identifier. To be more precise, IPFS implements Merkle DAG. It is very similar to BitTorrent.

Each file is divided into smaller blocks, and they are stored in different sources. Simultaneously, it is super easy and quick to verify each blocks within the file. It is the clue of decentralization on storage level.


Distributed hash tables

In case of finding which peer is hosting the content you search, IPFS uses hash tables. To sum up, hash table is a database which stores keys to values. It is distributed among nodes in the ecosystem.


Conclusion

IPFS is one of the best solutions to store files in decentralized way. It uses content addressing instead of location, what makes it really useful in web3 world. Moreover, splitting each file into blocks, is increasing decentralization dramatically.

What is worth to mention is that, hashes are not directly referring to complete file you look for. It shows the divided content which is linked by DAGs. It is the real power of mentioned technology.