What is peer-to-peer (P2P)?
In computer science, a peer-to-peer (P2P) network consists of a group of devices that collectively store and share files. Each participant (node) acts as an individual peer. All nodes usually have equal power and perform the same tasks.
In financial technology, the term peer-to-peer usually refers to the exchange of currencies or digital assets over a distributed network. P2P platforms allow buyers and sellers to execute trades directly without the need for intermediaries. In some cases websites may also provide a P2P environment that connects lenders and borrowers.
The P2P architecture can be suitable for many different use cases but became particularly popular in the 1990s when the first file sharing software was created. Today, P2P networks have become the core of most digital currencies, which constitute a large part of the blockchain industry. However, it is also currently supported in other distributed computing applications including web search engines, streaming platforms, online marketplaces, and the InterPlanetary File System (IPFS) web protocol.
How does P2P work?
Basically, P2P systems are maintained by a distributed network of users and usually do not have a central administrator or server because each node contains a copy of the files and acts as a client and server for the other nodes. Therefore each node can download files from other nodes or upload files to other nodes. This is what distinguishes P2P networks from traditional server systems in which devices download files from a central server.
Devices connected on P2P networks share files stored on their hard drives using software applications designed to mediate data and file sharing. Users can also query other connected devices on the network to find and download files. Once a user downloads a particular file they can then act as the source of that file.
In other words, when a node acts as a client it downloads files from other network nodes. But when nodes act as a server, they become the source from which other nodes can download files. However, in practice both functions can be performed at the same time (such as downloading file A and uploading file B).
P2P networks tend to become faster and more efficient as their user base grows because each node stores, transmits, and receives files. Also, its distributed architecture makes P2P systems highly resistant to cyberattacks because P2P networks do not have a single point of failure, unlike traditional models.
We may classify peer-to-peer systems according to their architecture. The three main types of P2P networks are called unstructured, structured, and hybrid.
Unregulated P2P networks
Unstructured P2P networks do not provide any specific organization of nodes. Where participants communicate randomly with each other. These systems are effective when there is a state of high activity (e.g. many nodes join and leave the network frequently).
Although unstructured P2P networks are easy to build, they may require higher CPU and memory usage because search queries are sent to as many peers as possible. This tends to flood the network with queries especially if there are only a few nodes providing the requested content.
Organized P2P networks
In contrast, structured P2P networks offer an organized structure as the name suggests. This allows nodes to efficiently search for files even if the content is not widely available. In most cases this is achieved through the use of hash functions that facilitate database searches.
Although organized networks may be more efficient, they tend to introduce higher levels of centralization and usually require higher setup and maintenance costs. Otherwise, organized networks are also less robust when they face high rates of disruption.
Hybrid P2P networks
Hybrid P2P networks combine the traditional client-server model with some aspects of a peer-to-peer architecture. For example, you design a central server that facilitates communication between peers.
When compared to the other two types of peer-to-peer networks, the hybrid type tends to offer improved overall performance. As it usually combines some of the main advantages of each type. Which achieves great degrees of efficiency and decentralization simultaneously.
Distributed and decentralized
Although the P2P environment is distributed in nature, it is important to note that there are varying degrees of decentralization. So not all P2P networks are decentralized.
In fact, many systems rely on a central authority to direct network activity, making them somewhat centralized. For example, some P2P file sharing systems allow users to search for and download files from other users but are unable to participate in other operations such as managing searches.
In addition, we can say that small networks controlled by a limited user base with common goals have a higher degree of centralization despite the lack of a central network infrastructure.
The role of peer-to-peer (P2P) in blockchain
In the early stages of Bitcoin, Satoshi Nakamoto defined it as a “peer-to-peer electronic cash system.” Bitcoin was created as a digital form of money. It can be transferred from one user to another through a P2P network that runs a distributed ledger called a blockchain.
In this context, the P2P architecture inherent in blockchain technology is what allows Bitcoin and other digital currencies to be easily transferred/transferred around the world without the need for intermediaries or any central server. Anyone can also set up a node on the Bitcoin blockchain if they wish to participate in the process of verifying and authenticating blocks.
So there are no banks processing or recording transactions in the Bitcoin network. Instead, the blockchain acts as a distributed digital ledger that records all activity publicly so that other participants can see it. Basically, each node maintains a copy of the blockchain and compares it with other nodes to ensure data accuracy. The network quickly rejects any malicious or inaccurate activity.
In the cryptocurrency blockchain, nodes can play a variety of different roles. For example, full nodes are the ones that provide security to the network by verifying transactions according to system consensus rules.
Each full node maintains a complete, up-to-date copy of the blockchain, allowing it to participate in the collective work of verifying the current state of the distributed ledger. However, it should be noted that not all full verification nodes are represented by miners.
Advantages
The peer-to-peer structure of blockchain offers many benefits. Chief among these is the fact that P2P networks offer greater security than traditional client-server arrangements. As the blockchain is distributed over a large number of nodes, it is virtually immune to denial of service (DoS) attacks that infect many systems.
Also, since the majority of nodes must reach consensus before data is added to the blockchain, it is almost impossible for an attacker to change the data. This is especially true for large networks like the Bitcoin network. Smaller blockchain networks are more vulnerable to attacks because one person or group can eventually control the majority of nodes (this is known as a 51% attack or majority attack).
As a result, a distributed peer-to-peer network combined with majority consensus requirements gives blockchain networks a relatively high degree of resistance to malicious activity. The P2P model is one of the reasons why Bitcoin (and other blockchains) are able to achieve so-called Byzantine fault tolerance.
In addition to the protection it provides, the use of P2P architecture in cryptocurrency blockchains also makes them resistant to censorship by central authorities. Unlike traditional bank accounts, digital currency wallets cannot be frozen or cashed out by governments. This resistance also extends to censorship efforts undertaken by private payments and content platforms. Some content creators and online merchants have adopted cryptocurrency payments as a way to avoid having their payments blocked by third parties.
Restrictions
Although there are many advantages, using P2P networks on blockchain also has definite limitations.
Because the distributed ledger must be updated on each participating node rather than on a central server, adding transactions to the blockchain requires an enormous amount of computing power. While this measure provides increased security, it greatly reduces efficiency and is one of the major drawbacks when it comes to widespread scaling and adoption. However, those interested in cryptography and blockchain developers are currently searching for alternatives that can be used as solutions to this scaling. Notable examples include the Lightning Network, Ethereum Plasma, and the Mimblewimble protocol.
Another potential limitation relates to attacks that may arise during hard fork events. Due to the fact that most blockchain networks are decentralized and open source, groups of nodes are free to copy and modify the code, fork away from the main chain and form a new parallel network. Hard forks are completely normal and do not pose a threat on their own, but if certain security methods are not implemented properly, both chains may become vulnerable to replay attacks.
Furthermore, the distributed nature of P2P networks makes them relatively difficult to control and make legal, not just in the blockchain space. Many P2P applications and companies have been involved in illegal activities and copyright violations.
Concluding thoughts
Peer-to-peer architecture can be developed and used in many different ways. It is the core of blockchain that makes digital currencies possible. P2P architecture provides security, decentralization, and censorship resistance by distributing transaction ledgers across large networks of nodes.
In addition to their utility in blockchain technology, P2P systems can also be used in other distributed computing applications ranging from file-sharing networks to energy trading platforms.


