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 have the same capabilities and work on the same task.
In financial technology, the term peer-to-peer usually refers to the exchange of cryptocurrencies or digital assets over a distributed network. A P2P platform allows buyers and sellers to carry out transactions without the need for an intermediary. In some cases, website pages can also provide a P2P environment that connects fund providers and borrowers.
P2P architecture can be used in many ways, but it was especially popular in the 1990s when the first file sharing programs were created. Today, P2P networks are the core of cryptocurrencies, ruling most areas of the blockchain industry. However, it is also leveraged 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?
In essence, P2P systems are managed by a distributed network of users. Typically, these systems do not have a central administrator or server because each node holds a copy of the files - acting both as a client and as a server to other nodes. Thus, each node can download or upload files to and from other nodes. This is what differentiates P2P networks from more traditional client-server systems, where client devices download files from a centralized server.
In a P2P network, connected devices share files stored on the hardware. Using software applications designed to mediate data sharing, users can ask other devices on the network to find and download files. When one user has downloaded the file in question, then that user can act as the source of the file.
In other words, when one node acts as a client, it downloads files from other network nodes. But when acting as servers, these nodes become sources from which other nodes can download files. But in practice, both functions can be executed at the same time (e.g. downloading file A, and uploading file B).
Because each node stores, transmits and receives files, P2P networks tend to be faster and more efficient as the user base grows larger. Also, the distributed architecture makes P2P systems highly resistant to cyberattacks. Unlike traditional models, P2P networks do not have a single point of failure.
We can categorize peer-to-peer systems according to their architecture. The three main types are unstructured, structured, and mixed (hybrid) P2P networks.
P2P networks are unstructured
Unstructured P2P networks do not display the specific organization of the nodes. Participants communicate randomly with each other. The system is considered to be robust against high volatile activity (eg: Some nodes frequently join and leave the network).
Although easier to build, unstructured P2P networks may require higher CPU and memory usage because search requests are sent to as many peers as possible. This tends to flood the network with requests, especially if a small number of nodes offer the desired content.
Structured P2P network
In contrast, structured P2P networks represent an organized architecture, allowing nodes to search for files more efficiently, even if the content is not widely available. In most cases, this is achieved through the use of hash functions that facilitate database searches.
While structured networks may be more efficient, they tend to feature a higher degree of centralization, and typically require higher setup and maintenance costs as well. Additionally, structured networks are less robust when faced with high levels of volatility.
Mixed P2P Network
Mixed P2P networks combine the conventional client-server model with some aspects of a peer-to-peer architecture. For example, these networks can design a central server that facilitates connections between peers.
When compared to the other two types, hybrid/mixed models tend to show improved overall performance. These networks typically combine some of the key advantages of each approach, achieving a level of efficiency and decentralization simultaneously.
Distributed vs. Distributed not centered
Although P2P architectures are inherently distributed, 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 guide 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 they cannot participate in other processes, such as managing search queries.
Additionally, small networks controlled by a limited user base with a common goal can also be said to have a higher degree of centralization, despite the lack of a centralized network infrastructure.
The Role of P2P in Blockchain
In Bitcoin's early stages, Satoshi Nakamoto defined it as a “Peer-to-Peer Electronic Cash System.” Bitcoin was created as a form of digital money. It can be transferred from one user to another via a P2P network, which maintains a distributed ledger called a blockchain.
In this context, the P2P architecture inherent to blockchain technology is what allows Bitcoin and other cryptocurrencies to be transferred around the world, without the need for intermediaries or central servers. Additionally, anyone can set up a Bitcoin node if they want to participate in the process of verifying and validating blocks.
So, there are no banks that process or record transactions in the Bitcoin network. Instead, blockchain acts as a digital ledger that publicly records all activity. Basically, each node holds a copy of the blockchain and compares it with other nodes to ensure the data is accurate. The network quickly rejects suspicious or inaccurate activity.
In the context of a cryptocurrency blockchain, nodes can take on a variety of different roles. Full nodes, for example, are those that provide security to the network by verifying transactions against the system's consensus rules.
Each full node stores a complete and updated copy of the blockchain – allowing it to participate in the collective work of verifying the true state of the distributed ledger. It should be noted, that not all fully validating nodes are miners.
Profit
Peer-to-peer blockchain architecture provides many benefits. Among the most important is the fact that P2P networks offer greater security than traditional client-server setups. The distribution of blockchain over a large number of nodes makes it immune to the Denial-of-Service (DoS) attacks that plague many systems.
Likewise, because the majority of nodes must establish consensus before data is added to the blockchain, it is nearly impossible for an attacker to change the data. This is especially true for large networks like Bitcoin. Smaller blockchains are more vulnerable to attacks because one person or group can likely control most of the nodes (this is known as a 51 percent attack).
As a result, distributed peer-to-peer networks, paired with majority consensus requirements, make blockchains have a relatively high level of resistance to malicious activity. The P2P model is one of the reasons why Bitcoin (and other blockchains) are able to achieve what is called Byzantine fault tolerance.
Beyond security, the use of P2P architecture in cryptocurrency blockchains also makes them resistant to censorship by central authorities. Unlike standard bank accounts, cryptocurrency wallets cannot be frozen or drained by the government. This resistance also extends to censorship efforts with private payment processing and content platforms. Some content creators and online merchants are adopting cryptocurrency payments as a way to avoid having their payments blocked by third parties.
Limitations
Even though it has many advantages, the use of P2P networks on blockchain also has certain limitations.
Because the distributed ledger must be updated on each node, not on a central server, adding transactions to the blockchain requires a large amount of computing power. While this provides increased security, it greatly reduces efficiency and is one of the main obstacles in terms of scalability and widespread adoption. Nonetheless, cryptographers and blockchain developers are investigating alternatives that can be used as scaling solutions. Notable examples include the Lightning Network, Ethereum Plasma, and the Mimblewimble protocol.
Another potential limitation relates to attacks that may arise during the hard fork activity. Because most blockchains are decentralized and open source, groups of nodes are free to copy and modify the code and split off from the main chain to form new parallel networks. Hard forks are completely normal and not a threat. But if certain security methods are not adopted properly, both chains can become vulnerable to replay attacks.
Additionally, the distributed nature of P2P networks makes them relatively difficult to control and regulate, not only in blockchain environments. Some P2P apps and companies are involved with illegal activities and copyright violations.
Closing
Peer-to-peer architecture can be developed and used in a variety of ways, and is the core of the blockchain that makes cryptocurrencies possible. By distributing a ledger of transactions across a large network of nodes, P2P architecture offers security, decentralization, and resistance to censorship.
In addition to their use in blockchain technology, P2P systems can also serve other distributed computing applications, ranging from file sharing networks to energy trading platforms.

