Network Topology

How nodes connect and relay data, which shapes speed, privacy and resilience.

Basically

Network topology is the pattern of connections between the computers that run Bitcoin. It shapes how they pass data to one another.

Key Takeaways

  • Network topology describes how Bitcoin nodes connect to each other: each node maintains a small set of outbound peers (11 by default) while accepting up to 114 inbound connections, forming a loosely connected random graph.
  • Nodes discover peers through DNS seeds at first startup, then maintain an address database populated via the gossip protocol for ongoing peer discovery without central coordination.
  • Topology design involves a fundamental trade-off: higher connectivity speeds up block propagation but exposes more information for graph analysis, making transaction origin tracing easier.

What Is Network Topology?

Network topology refers to the arrangement and connectivity pattern of nodes within a peer-to-peer network. In Bitcoin, it describes which nodes connect to which other nodes, how they discover new peers, and how data propagates through the resulting graph. Unlike centralised systems where all clients connect to a single server, Bitcoin's topology is decentralised: every full node connects to a small subset of peers and relays information to them, creating a mesh that collectively covers the entire network.

The topology of a blockchain network directly influences its security, performance, and privacy, which matters if you run a node, build wallet software, or evaluate the resilience of a layer-1 protocol. A well-connected graph ensures that blocks and transactions propagate quickly, reducing the risk of stale blocks and chain reorganisations. A poorly connected or manipulated topology can lead to network partitions, eclipse attacks, and transaction deanonymisation.

How It Works

Bitcoin Core organises its peer connections into several distinct types, each serving a different purpose. The default configuration allows up to 125 simultaneous connections.

The distinction between outbound and inbound connections is critical for security because your node chooses its own outbound peers, so an attacker cannot easily control them. Inbound connections, however, can come from anyone, including adversaries. Bitcoin Core's security model assumes that all inbound connections could be malicious and relies on its self-selected outbound peers for honest chain data.

Peer Discovery

A Bitcoin node needs to find peers to connect to when it starts for the first time. The discovery process follows a prioritised sequence.

The glossary entries on bootstrap nodes and peer discovery offer a deeper look at the bootstrap process. They explain how a node finds its first connections.

Eclipse Attack Defenses

An eclipse attack occurs when an adversary controls all of a victim node's connections, isolating it from the honest network. Bitcoin Core has added several topology-level defences over the years.

Connection Message Example

A node's handshake with a new peer begins with a version message. The message advertises the node's protocol version, services, and listening address.

The relay field indicates whether the node wants to receive transaction announcements. Block-relay-only connections set this to false, receiving only block data.

Lightning Network Topology

The Lightning Network maintains its own distinct topology, separate from Bitcoin's base layer. Bitcoin nodes form an unstructured random mesh, while Lightning nodes create a channel graph where edges represent funded payment channels and vertices represent nodes that can route payments.

BOLT 7 governs Lightning topology. It defines three gossip message types.

Lightning's public channel graph is visible to all participants, unlike Bitcoin's base-layer topology, which is intentionally hidden from outside observers. The transparency is necessary for pathfinding but creates a different set of privacy trade-offs. Private channels and blinded paths offer ways to reduce visibility.

Research from 2026 has proposed replacing Lightning's flooding-based gossip with set reconciliation techniques. For nodes rejoining the network after extended downtime, this could reduce gossip sync time from hours to minutes.

Why It Matters

Network topology has practical implications for anyone interacting with Bitcoin or building on top of it. These implications affect both the base network and the software that relies on it.

The recommended reading is Bitcoin P2P Network Resilience: How Topology Attacks Threaten Consensus. It provides a comprehensive analysis of how topology attacks threaten Bitcoin consensus.

Node Operators

Network topology matters when you configure your node for resilience. You can run a node with connections across multiple ISPs and geographic regions to reduce the chance of isolation by a localised outage or a targeted BGP hijacking attack. The addnode RPC command or configuration file lets you manually add trusted peers, ensuring at least some connections are to known-good nodes.

Network Researchers

Researchers study Bitcoin's topology to assess its decentralisation and attack surface. Academic studies have found that node hosting is concentrated: as few as 8 Autonomous Systems host roughly 30% of Bitcoin nodes, and 24 ASes host about 50%. This concentration increases the feasibility of routing-level attacks where an AS operator or upstream ISP intercepts traffic between nodes.

Wallet Developers

Wallets that run lightweight clients or connect to a single trusted node inherit the topology risks of that node. A wallet backed by an eclipsed node could be shown a false chain state. Connecting to multiple independent nodes or using compact block filters (BIP 157/158) helps mitigate this risk.

Network Partitioning

A network partition splits the Bitcoin network into two or more groups that cannot communicate. Research has identified several partition attack vectors: spatial attacks that exploit AS-level concentration, temporal attacks that target nodes during restarts, and logical attacks that leverage software version differences. A sustained partition could allow double-spend attacks against transactions confirmed on only one side of the split.

Transaction Origin Tracing

Bitcoin's default transaction relay uses diffusion: a node sends each transaction to its peers with independent random delays. A well-connected adversary monitoring many nodes can correlate these timing patterns to estimate which node first broadcast a transaction, linking IP addresses to on-chain activity and undermining pseudonymity. Countermeasures include broadcasting transactions over Tor, using the Dandelion protocol (not yet in Bitcoin Core), or submitting transactions directly to a miner.

Unreachable Node Majority

Research estimates that nodes behind NAT or firewalls (unreachable nodes) outnumber publicly reachable nodes by roughly 10 to 1. Unreachable nodes can only make outbound connections and cannot accept inbound ones, meaning they depend entirely on the reachable portion of the network for connectivity. A significant drop in the reachable node count could leave unreachable nodes struggling to find enough peers.

Topology Mapping

Bitcoin does not encrypt its P2P traffic by default, so network observers can identify connections between nodes by monitoring TCP sessions. BIP 324 (v2 transport protocol) introduces encrypted and authenticated connections to make passive topology mapping more difficult, though an observer can still see that two IP addresses are communicating.

The recommended reading is Eclipse Attacks on Bitcoin: How Adversaries Isolate Nodes and How the Network Defends. It explains how Bitcoin defends against P2P-level attacks.

The glossary entry is for informational purposes only and does not constitute financial or investment advice. You should always do your own research before using any protocol or technology.

0

← All 1876 glossary terms