For two people to exchange information, they need to agree upon certain rules that define what information will be transmitted, when the information will be transmitted and how the transmission will be done. These rules are termed as communication protocols. The internet is largely controlled by the HTTP protocol. In HTTP, the data is stored in centralized servers. This information is accessed using location-based addressing. However, HTTP causes certain security, privacy and efficiency problems. These problems have given rise to the need for a better and more reliable solution.
What is IPFS?
IPFS (Interplanetary File System) is a P2P file system. This distributed File system connects all computing systems to one single file system. IPFS provides an always available and secure storage and sharing medium. In general terms, IPFS is a versioned file system which can store files as well as track its versions over time. Similar to Bit Torrent, it defines how the files on the network move across the network making it a distributed file system. IPFS enables a durable web and elevates the way we use existing internet protocols like HTTP.
Flaws in HTTP
In HTTP, if there are n number of requests for a particular page at the same time from the same or geographically close location, the same response will be sent to each of the requests individually. This, however, is not an efficient way of serving requests. Ideally, the users could leverage their physical proximity to more efficiently retrieve the desired information. Also, HTTP has certain problematic scenarios such as:
- If there is a problem in the line of communication and the client could not connect to the server
- If the client did communicate with the server but the server was unable to find what was requested
- When the requested content has been moved or deleted
Along with the above-mentioned scenarios, there are some serious problems that have emerged because of HTTP. Some of the problems are:
- Inefficacious content distribution emanating from downloading data from a single server at a time
- Soaring bandwidth costs and data duplication leading to inflated storage
- Growing centralization of servers and providers leading to augmented Internet censorship
- Vulnerable history of information stored on the Internet and short lifespans of web pages
- Irregular connections leading to a world developing offline and slow connection speeds
How does IPFS work?
IPFS assigns a unique hash (fingerprint to identify the file) to each file. The hash is totally unique even with the slightest of difference. Unlike HTTP, IPFS uses the content of a file and not the domain name to locate its address.
IPFS removes unnecessary files from the entire network along with performing version control for the files. Every edit history is recorded and can be traced easily. When a search query is fired, IPFS searches for the document based on its hash. As the hash is unique, it’s easy to fire a query and fetch the desired result.
Both, hashes in IPFS and the IP address in HTTP, are difficult for a human to remember. In HTTP, the domain name is used to locate an IP address whereas, in IPFS, IPNS is used to locate an IPFS hash. All the nodes in IPFS store a hash table. This hash table is used to record the location of the file.
In distributed hash tables (DHT) the data is spread across a network of computers and coordinated to enable quick access and lookup between nodes. DHT provides powerful advantages of decentralization, fault tolerance and scalability. The nodes in the network need not be centrally coordinated. The system functions smoothly even if a node fails or leaves the network. DHTs can scale to accommodate millions of nodes. Together these features result in a system that is more flexible and robust in comparison to the client-server structures.
Summarizing, with decentralization and IPFS, censorship over the web, invasion and access control can be avoided. Things can be made more adaptable to the changing needs of society.