Research·Protocol

How Bitcoin Nodes Find Each Other

Consensus decides what is valid. The peer-to-peer layer decides what your node ever gets to see, which is a different and under-examined problem. A node that validates perfectly while connected only to hostile peers is a node being shown a true but partial world.

Level
Advanced
Reading
8 min
Published
2026-11-19
Reviewed
2026-11-19

Almost every explanation of Bitcoin stops at consensus: these are the rules, nodes enforce them, invalid blocks are rejected. All true, and it leaves out the layer that decides which blocks your node is ever offered.

How does a new node find anybody?

Through a short bootstrap sequence, then by gossip.

A node starting with no peer knowledge queries a handful of DNS seeds — domain names maintained by long-standing contributors that return addresses of reachable nodes. If those fail, a list of hardcoded addresses compiled into the software is used as a fallback. Neither is consulted again once the node has its own address database.

After that it learns by asking. Peers send address messages advertising nodes they know about, and the node accumulates these into a local database. That database is not a flat list: addresses are bucketed by network group, so that a single operator controlling many addresses in one range cannot fill it. The bucketing is the first and most important eclipse defence, and it exists because the naive version was attacked.

A newer address message format carries addresses for networks the original could not express, which is what allows onion and other addresses to propagate alongside ordinary ones.

What are the connection slots for?

Different jobs, and the separation is deliberate.

A node maintains a small number of outbound full-relay connections — eight by default — chosen from its address database. These carry transactions, blocks and addresses, and they are the node’s main view of the network.

It also maintains two block-relay-only connections. These exchange blocks and nothing else: no transactions, no addresses. Because they are invisible to anyone mapping the network through transaction or address gossip, an attacker trying to occupy all of a node’s connections does not know they exist. That is a cheap and effective eclipse defence added precisely because the attack was demonstrated.

Occasional short-lived feeler connections test whether addresses in the database are still alive, so that the node is not left with a database full of stale entries when it next needs one.

Inbound connections are accepted up to a limit if the node is reachable. They do not improve the node’s own security — an attacker can always make inbound connections — which is why the defences focus on outbound.

How does a transaction actually travel?

By announcement rather than by sending, which is the design’s main bandwidth saving and its main privacy mechanism.

A node that has a new transaction announces its identifier to peers. A peer that does not have it requests it; a peer that already does says nothing. Over a network where most peers already have most transactions, that saves nearly everything.

The announcements are deliberately delayed by a random interval, different per peer, rather than sent immediately. This blurs the timing an observer would use to infer where a transaction originated. It helps and it is not a solution, which is why a proposal for relaying new transactions through a short private path before broadcasting them widely was specified — and never adopted.

There is a further proposal to replace announcement with set reconciliation: instead of announcing everything to everyone, two peers efficiently compute the difference between what they hold. It would cut announcement bandwidth substantially and allow more connections per node, which would improve eclipse resistance. It remains a draft.

How do blocks propagate?

Headers first, then compactly, because latency is money for miners.

A syncing node downloads headers before block contents, which lets it validate the chain’s work and choose what to download before committing bandwidth to anything.

For a new block at the tip, sending the full contents is wasteful: the receiving node almost certainly has most of the transactions in its mempool already. Compact block relay sends short identifiers instead, the receiver reconstructs the block from what it holds, and asks for only the few transactions it is missing. This cuts the bytes on the wire by about an order of magnitude.

The latency matters beyond bandwidth. A miner whose blocks propagate slowly loses more ties, which is a direct economic penalty and a centralising pressure. Compact relay shrinks that disadvantage, which makes it a decentralisation measure disguised as an optimisation.

What happens when a peer misbehaves?

It is scored and eventually dropped, and the deliberate absence of anything stronger is the interesting part.

A node tracks misbehaviour by peer: invalid messages, invalid blocks, protocol violations. Past a threshold the peer is disconnected and discouraged, meaning the node will prefer not to reconnect to it for a while.

What the node does not do is tell anyone else. There is no shared blocklist, no reputation gossip, no mechanism by which one node’s judgement about a peer propagates. That is a design decision rather than an omission: a reputation system is a channel for one participant to influence another’s view of the network, which is precisely the influence the whole architecture is built to avoid. An attacker who could get honest nodes widely banned would have an eclipse tool handed to them.

So every node forms its own opinion about its own peers, from its own observations, and shares none of it. The cost is that each node must be attacked individually before it learns anything. The benefit is that nobody can be attacked by proxy.

It is the same pattern as validation: judgement is local, cheap to perform, and never delegated.

What does this layer leak?

Where you are, and which transactions are yours.

An observer running many well-connected nodes watches which peer announces each transaction first and infers the origin with useful reliability. That attaches an IP address to a transaction before it confirms, which is information the chain never records and nobody can recover later.

Running over an anonymity network removes that and introduces a different exposure: addresses on those networks are free to create in unlimited numbers, so an attacker can populate a node’s peer set more cheaply than on the ordinary internet. The current advice — maintain connections across several networks rather than exclusively one — is a direct consequence.

What does the handshake establish?

Capabilities, which determine what each side will bother asking the other for.

Two nodes opening a connection exchange version messages before anything else. These carry the protocol version, the node’s view of the current block height, and a set of service flags advertising what it can do: whether it serves the full chain or only recent blocks, whether it understands witness data, whether it can serve compact block filters for light clients.

Those flags are load-bearing. A node needing historical blocks for initial sync must find peers advertising the full chain, which pruned nodes do not — so the population able to serve a new node is smaller than the population of nodes. A light client wanting filters needs peers that serve them, and that is a minority of a minority.

This is where a quiet dependency sits. The network’s ability to onboard new participants rests on archival nodes, which are a shrinking fraction as pruning becomes the sensible default for individuals. Nobody is obliged to serve history, nobody is paid to, and the number doing it is not something the protocol can measure or defend.

How much bandwidth is this?

Less than people assume, and asymmetric.

Downloading the chain once is the large cost. Afterwards, keeping up means receiving a block every ten minutes and the transactions that went into it, which is modest. Uploading is the variable part: a reachable node serving historical blocks to peers performing initial sync can send a great deal, and that is the figure worth capping if bandwidth is metered.

Bitcoin Core exposes a monthly upload target for exactly this, and it degrades gracefully — the node stops serving old blocks rather than dropping off the network.

Check it yourself

The connection structure is visible and worth looking at once, because the defaults are doing more work than most operators realise.

# Every peer, with its connection type and network.
bitcoin-cli getpeerinfo | grep -E '"connection_type"|"network"' | sort | uniq -c

# Totals, including what the address database knows about.
bitcoin-cli getnetworkinfo | grep -E 'connections|networkactive'
bitcoin-cli getnodeaddresses 0 | wc -l

A healthy node shows eight outbound full-relay peers, two block-relay-only, some inbound if reachable, and peers across more than one network. A node showing only inbound connections is not protected by any of the defences above, because it chose none of its peers.

What remains uncertain

Whether reconciliation-based relay ships. It would improve both bandwidth and eclipse resistance meaningfully, it has been a draft for years, and its deployment depends on review capacity rather than on disagreement.

How effective current eclipse defences are. They were designed against published attacks, and the cost of a successful eclipse today is not something anyone has measured publicly.

How much origin inference actually happens. The technique is known, the research is dated, and whoever is doing it at scale has no reason to say.

What the reachable node count really is. Published figures count nodes that answer, which excludes everything behind a firewall or on an anonymity network, and that is the wrong denominator for almost every question people ask of it.

Sources

Nearby