# The peer-to-peer network

Bitcoin nodes connect to a handful of peers and pass on new transactions and blocks, so news spreads worldwide in seconds. Learn how gossip works.

Canonical page: https://mybitcoinexplorer.com/learn/peer-to-peer-network
Topic: Nodes and the network
Published: 2026-10-29
Updated: 2026-10-30


## Gossip
There's no central server. Each node connects to some **peers** (by default 8 outgoing connections in Bitcoin Core, plus extra block-relay-only ones) and can accept incoming connections on port 8333.

> Diagram: A new transaction spreads peer to peer, each node checking it before passing it on — 

When a node learns of something new, it tells its peers it has it (an "inv" message). Peers that don't have it ask for it, check it, and tell **their** peers. Within seconds, most of the network knows.

## Finding peers
A brand-new node uses **DNS seeds** (domain names run by community members that return addresses of active nodes) and a hardcoded fallback list. After that, nodes exchange addresses of other peers.

## Faster blocks
- **Compact blocks** (BIP 152): peers usually already have most of a block's transactions in their mempool, so a node sends only short IDs and the receiver rebuilds the block.
- Faster relay means fewer [stale blocks](https://mybitcoinexplorer.com/learn/stale-blocks-and-reorgs).

## Privacy and resilience
- Transactions are relayed with small random delays, which makes it harder to tell which node created them.
- Nodes can connect over Tor or I2P to hide their IP address.
- Connecting to diverse peers protects against an **eclipse attack**, where an attacker surrounds a node with only their own peers.


## How fast is the network?
A new block usually reaches the vast majority of reachable nodes within a few seconds, thanks to compact block relay. Unconfirmed transactions spread more slowly on purpose: small random delays protect the privacy of the sender.

## Inbound vs outbound connections
| | Outbound | Inbound |
|---|---|---|
| Who starts it | Your node | Another node |
| Default in Bitcoin Core | 8 full-relay plus 2 block-only | Up to the connection limit, if port 8333 is open |
| Purpose | Get data you can trust | Help other nodes |


## Key takeaways

- Nodes connect to peers and gossip new transactions and blocks.
- New nodes find peers via DNS seeds.
- Compact blocks and diverse connections make the network fast and resilient.

## Common questions

### How many nodes are there?

Tens of thousands of reachable nodes are visible publicly, plus many more that don't accept incoming connections. Exact numbers can't be known.

### Does my node need an open port?

No. It works with outgoing connections only, but opening port 8333 helps the network.

### What port does Bitcoin use?

Port 8333 for mainnet peer-to-peer connections.

### Can someone block my node from the network?

Diverse peers, Tor or I2P, and manual trusted peers make that very hard.

## Related lessons

- [What is a Bitcoin node?](https://mybitcoinexplorer.com/learn/what-is-a-bitcoin-node)
- [What is the Bitcoin mempool?](https://mybitcoinexplorer.com/learn/what-is-the-mempool)
- [Initial block download (IBD)](https://mybitcoinexplorer.com/learn/initial-block-download)
- [Stale blocks and chain reorganizations](https://mybitcoinexplorer.com/learn/stale-blocks-and-reorgs)
