Open In App

How to Share File in IPFS Blockchain?

Last Updated : 01 Dec, 2023
Improve
Improve
Like Article
Like
Save
Share
Report

IPFS stands for Interplanetary File System. It is a distributed peer-to-peer network and a protocol for organizing, storing and sharing files and data. It works on the blockchain principle as IPFS itself is a decentralized file system on a distributed network. So, before moving ahead with the file transfer mechanism in the IPFS network and directly understanding the procedure of file transfer, we should first understand in brief about the IPFS and its terminology, which will help us understand the mechanism easily and how it actually works.

What is IPFS?

The IPFS protocol not only helps us to store or share files, but it also helps us to track new modifications or versions done on a file over a distributed network, just like on open source platforms. In IPFS, if a person’s system is connected to a network or is an IPFS node, then any changes or edits to the file done by one node are seen by all other nodes because every file has its own unique hash, just like blockchain, so it also provides transparency to the data.

Through out the article of understanding the file transfer procedure, we will be covering the following headings and before moving ahead we must be aware of these followings:

  • IPFS node
  • Hashing system of IPFS
  • Working mechanism of file sharing on IPFS
  • IPFS software installation Process
  • Working of IPFS
  • File sharing steps in IPFS
  • Asymmetric IPFS Encryption
  • Uses of IPFS
  • Who is using IPFS
  • Conclusion

So, let’s begin with IPFS node.

IPFS Node

It is basically a machine or a computer system that runs IPFS software in it and is connected to the IPFS network to store, share and retrieve data from the IPFS network of many nodes. Many IPFS nodes of a computer system that runs IPFS software in them make an IPFS peer-to-peer network in which files are shared and retrieved from one node to another node throughout the network and data is maintained by all nodes of the network.

What is Hashing System in IPFS?

Unlike the traditional system of data transfer over the internet, which uses many centralized protocols (ex. HTTP or HTTPS), whose job is to send requests for accessing a client’s data to a server and then retrieve data from the server for the client, IPFS uses the Content Addressing system rather than the Location Addressing system (used in HTTPS).

In Content Addressing system, the content or the data itself acts as an address for its location or its referencing. In IPFS, each piece of data is stored using a unique distributed Hashing system and we can say that content stored or organized in an IPFS network is based on its unique cryptographic hash rather than its location.

Cryptographic Hashing is performed using a special hashing algorithm called as SHA-256. Each file is identified by the unique hash allotted to it and this hash is used while transferring of files between the nodes. This unique cryptographic hash of each file is known as the Content Identifier (CID).

A cryptographic hash is the unique identity of a file stored on the IPFS network.

IPFS Software Installation Process

Let’s start with the IPFS software installation process and then we will jump into the file sharing steps in our IPFS network.

1. Open the browser and search for IPFS desktop install, if you are on Windows, click on Windows.

2. In the Windows section, at the first point, we can find the link to the IPFS desktop download page (click on it).

3. The IPFS GitHub Repository will be opened, click on the (.exe) file for the latest version.

blog7-(1)-(5)-(1)

Click on the .exe file

4. When you click on the.exe file, your downloads will start.

5. Once it has been downloaded, click on the file, start the installation process and click on Next.

6. Your Windows version of the IPFS file gets installed on your system.

Working of IPFS

1. Let’s assume that node 1 has a file and upload that file to the IPFS network.

2. Now, this file is accessible to all the nodes connected to node 1 and they can request that node 1 provide that file.

3. If Node 3 wants a file, then Node 3 can request that Node 1 send that file. Then, node 1 can provide the CID (Content Identifier), which is the cryptographic unique hash of that specific file.

4. Node 3 can then download that file from the browser using the CID address of that file.

5. If some of the nodes in the network are shutdown or detached from the network, the files that were uploaded to the IPFS won’t get destroyed and are accessible. The network of left-out nodes still contains the files that we want and we can request that they get the files.

Blue-Green-Minimalist-and-Modern-Architecture-Presentation-(1)

Nodal Network of IPFS

File sharing steps in IPFS

After the installation process, open the IPFS software and follow these steps to transfer files:

  • In IPFS, go to the left-hand side and click on the Files section, then click on the Import button (to import and upload your files from your local system to the IPFS network).

You can upload files or folders according to your choice.

screen1-(1)-(1)

Importing files from our local system to our IPFS network

  • One image is uploaded from the local file directory and there you can see the green tick mark, which shows that the file is successfully uploaded to the network.
  • Click on the three dots on the right-hand side, a drop-down menu will appear.
  • Now, if you want to share this image file with any of your friends, you can either copy the share link or copy the CID address and give it to your friend. Your friend can then paste this CID on the IPFS browser to get the image.
  • If you copy the link and paste it in the browser, then you can get the downloaded file.

screen2-(1)-(1)

  • Here, we can copy the link. In this link, CID is something which always starts from Qm………..
    screen3-(1)-(1)
  • So, in conclusion, we required CID (Content Identifier), which is the unique cryptographic hash of each file. We can request the particular node that contains the file that we want and get the CID through it. This will help us access the file and download it to our local system.

Asymmetric IPFS Encryption

Let’s understand what encryption is, what it’s needed for, and then what asymmetric encryption is.Uses of IPFS

When we convert sensitive information or data into a code form, only a person who has the access key (private key) to that data can access it, which prevents unauthorized access. The message encrypted by the public key can be converted into readable form or decrypted only by someone with the private key to that encrypted file.

  • Let us assume that a person ‘A’ wants to send a file to a person ‘B’ and puts a file on the IPFS network. As long as any node that is connected to the nodal network has the cryptographic hash of that file, it can access the file from the network.
  • This becomes so crucial when we have so much sensitive information, like healthcare reports, money-related issues or any security-related official work, that we can’t share with everyone but only a specific person. Here, asymmetric encryption helps us.
  • Encryption can be Symmetric or Asymmetric, but here we will study asymmetric encryption.
  • Asymmetric encryption allows us to encrypt our file using a complex algorithm with the associated public key of the receiver, ‘B’.
  • When the sender ‘A’ puts the file on the IPFS network and encrypts it with the public key of the specific receiver, a unique cryptographic hash gets generated.
  • Since the file is available on the Nodal Network but no one can decrypt it or access the information after retrieving it, only a person who has a private key to the file associated with the public key can decrypt it and access the information.
  • No malicious party can access or change the information.

Uses of IPFS

IPFS with blockchain provides a more secure, trustworthy, and decentralized storage system that has brought many industries and economic sectors to its door for trustworthy and transparent storage. Some uses are listed below:

  • IPFS on the Internet of Things(IOT):– Data/information generated by devices and sensors are so significant for decision-making purposes and with this, IPFS helps to ensure the integrity and authenticity of each piece of data.
  • Government-related works: the electronic voting machine (EVM) could be hacked to modify the results of the election, but with the IPFS, this can be solved as the IPFS acts like a version control system, tracking all the changes at every step and also generating a unique cryptographic hash that is seen by all the nodes in the network. It keeps records of many of the confidential tasks related to foreign affairs or even military affairs that need to be kept secret and stored on the IPFS network.
  • Healthcare: IPFS stores the more critical information of the patient and keeps all the records of the hospital in check, and they can retrieve the correct information whenever they require it.
  • Supply chain management: We can track the product from its manufacturing to its overall journey and save those changes in our IPFS system for future purposes.
  • Entertainment and media: The distribution and storage of media such as videos, images, audios, etc. becomes more cost-effective as IPFS distributes content in a decentralized manner, removing the central authority and its control. With IPFS, media can be downloaded from the nearest node rather than from a distant server, increasing the loading process and also controlling server traffic.
  • Version control: IPFS acts like a version control system, just like GitHub tracking and preserves all the modifications done to the files. A modified file generates its own unique cryptographic hash that is different from the previous one. In this way, we can also ensure security and keep an eye on any undesirable changes made to the data or the product.

Who is using IPFS?

Those who want more security, trust and tracking of all the changes done to the data stored over a period of time on IPFS. Some of them include:

  • Developers: They use IPFS to share their codes in decentralized manner to ensure that codes are secure and can’t be deleted or censored by anyone.
  • Artists: They use IPFS to secure and store their artwork in decentralized manner. On the other hand, they showcase their artwork to the world without fear of plagiarism and have full control over their works.
  • NFT Creators: They use IPFS to store and share their NFT media files on their NFT marketplace. One such NFT marketplace is OpenSea. It uses IPFS for storing all their media files of all their NFTs that are listed on the marketplace, and in case the marketplace goes down, users will still have access to their NFTs.
  • Designers: Designers use this decentralized platform for sharing and storing their images, videos and 3D models, etc. They can also host a portfolio website of their work and do collaborations for their next project.
  • Researchers: Researchers use IPFS to store their research data more securely and confidentially, preserving their data when other researchers are working on the same project.

Conclusion

Nowadays, the security of our private information has become an important task that needs to be resolved. Here, our blockchain-based technology called as IPFS comes into play, storing and helping us share large amounts of data on its network without paying any gas fee, which we pay for storing on the blockchain. We can easily upload our file and share it with our network or a specific person, as it generates a unique hash. Big tech giants are adopting this technology to ensure security; even the different government sectors are bringing this technology into their work. IPFS with blockchain is ready to bring about change in the new digital world and keep promising that trust and security will be at the top.



Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads