2 min to read.
P2P Network
A peer-to-peer network: computers that connect directly to each other as equals, without a central server.
What is a P2P Network?
A P2P network, short for peer-to-peer network, is a network in which the participating computers, called nodes or peers, connect directly with each other and share data as equals. There is no central server that everyone depends on. Blockchains such as Bitcoin and Ethereum use peer-to-peer networks to distribute transactions and blocks.
How it works
In a client-server system, such as a typical website, users' devices send requests to a central server that holds the data. In a peer-to-peer system, every node can both request and provide data.
On a blockchain network, a new node first discovers some peers, using addresses built into the software or supplied by other nodes. It connects to a handful of them. When it learns of a new transaction or block, it checks it against the rules and passes it on to its peers, who do the same. This relay method is called gossiping, and it spreads information across the world in seconds. Every full node keeps its own copy of the blockchain and verifies everything itself rather than trusting its peers.
Example
A wallet sends a Bitcoin transaction to one node. That node tells its peers, they tell theirs, and shortly afterwards the transaction sits in mempools all over the network, ready for a miner to include it.
Why it matters
- Resilience: no single machine can be switched off to stop the network.
- Censorship resistance: no gatekeeper decides who may join or transact.
- Openness: anyone can run a node with ordinary hardware and an internet connection.
The full title of the Bitcoin whitepaper, "Bitcoin: A Peer-to-Peer Electronic Cash System", reflects how central the idea is.
Limits and misunderstandings
A peer-to-peer network alone does not create agreement. Nodes also need a consensus mechanism, such as proof of work or proof of stake, to decide which version of the ledger is valid. Peer-to-peer does not mean anonymous either, since peers can see each other's network addresses. "P2P" is also used for peer-to-peer trading, where individuals buy and sell directly with one another, which is a different matter.