Peer to Peer Networks or P2P

To understand cryptocurrency and the working of a blockchain, you first need to understand the terms used in it. One such term is Peer to peer network or P2P. Blockchain technology is built on the concept of P2P networks hence, it is very important to know what P2P is to understand blockchain. Peer to peer networks was first pioneered by Napster, the music-sharing software and even though that was illegal, it helped pave the way for many other software and concepts. Before we understand the peer to peer network, let’s first understand the centralized system and how it works.

Centralized System
Imagine a town in the old days, which worked on a barter system. People traded commodities with commodities, for example, a rice farmer traded rice with the butcher for meat. Over time, people made promises saying, “Give me the meat now and I will give you the rice once my harvest is out.’. Promises increased and got forgotten or were not kept. So, everyone got together and decided to keep a book with all the promises and transactions in it. But someone needed to keep it updated, right? So they appointed a person to keep track of it and keep the database updated. This way it became a centralized system. Everyone went to the Tracker for their transactions and promises, who noted them down.

To brief it, in a centralized system, there is one center node, i.e. the Tracker, to which all other networks send their data and then the center node sends the data to the intended recipients. 

Now, after a while, the tracker decided to charge a small fee for keeping track of everyone’s promises and over time decided to misuse his power. He started accepting bribes, erasing promises from the book, etc. 

In a centralized financial system, the company or bank has complete control over your account. The central server checks the validity of your transactions as they keep records of all balances. A centralized system has to store endless personal data about the customer to work out who to trust but that leaves them more vulnerable to hacking of private data and the user has no control over their information. It’s the same as your posts on social media. Once you post something, the company owning the social media platform owns your information and can do anything they like with it and is also susceptible to being hacked and your information being leaked.  They usually charge a fee which can be exorbitant over time.

So now how does peer to peer network relate to this?
Continuing the earlier example, the tracker is now holding a lot of personal information about the people in the town and is misusing his power. People started noticing it and one citizen decided that it can’t work like this. He realized that the only way out of this as to decentralize the system and maintain complete transparency. If everyone had a copy of the book it would be difficult for people to cheat each other out of promises. This is like a peer to peer network. 

Peer to peer networks are decentralized and distributed networks. They are a group of individual computers, i.e. the townspeople, and each computer is referred to as node or peer. They exchange information and share data with each other without a centralized computer. They are called peer because each node has the same capabilities and are equal to each other.

In 2008, during the Financial Crisis, Satoshi Nakamoto, a software developer,  invented Bitcoin and from there Cryptocurrency emerged. It is a payment system that is completely electronic and based on mathematical proof. The idea behind the invention was to find a way to be independent of a central authority while producing a means of exchange that could be electronically transferred in a secure, immutable, and verifiable way.

Even though all P2P networks are distributed, not all are decentralized. There are some P2P networks that are somewhat centralized. They rely on a central authority to guide network activity.

Types of Peer to Peer Networks
There are 3 types of P2P networks. Unstructured, Structured, and Hybrid. 

Unstructured Networks
In unstructured networks, there is no organization of peers. Anyone can communicate with anyone else randomly. The content here is widely available and so it requires high computing power. 

Structured Networks
Structured networks are organized. They are more efficient but are more centralized. 

Hybrid Networks
Hybrid networks combine the peer to peer network with client and server model. They are both efficient and decentralized.

Data Propagation
Data propagation is when data is moved from one node to another. It takes some time to propagate the same data to all the nodes of the network i.e. A might be able to send data to B much faster than to M who is farther away.

Network Latency
Any delay in data communication over a network is known as Network Latency. Latency is the time it takes for data to travel from Point A to Point B. Low latency is when there is a small delay whereas high latency is when there are long delays. Lots of different factors can affect data latency such as long distances, international communication via undersea cables, issues with the router, etc.

Peer to Peer networks are the key part of blockchains. 
Blockchains are different, as they are based on a peer to peer networks, they are decentralized. They are like a spreadsheet which constantly record and transfer data between the networks and store multiple identical copies of the networks information. As the blockchain technology is built on the P2P network, it has no central point. This makes it far less vulnerable to being hacked or the data being lost. Blockchain works on a consensus mechanism, as there is no central body that is bookkeeping to ensure the validity and consistency of every transaction. All the peers on the network, who mine and store data need to look into it and validate the status of the transaction and reach a consensus.

Since 1999, peer to peer networks has been successfully used to help develop software and concepts. An entire form of currency was invented on the basis of Peer to Peer networks. With peer to peer networks along with the blockchain, we have improved the future of data storage and ownership.