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.
How to Share File in IPFS Blockchain?
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.