Skip to main content

Overview

Bitcoin Core operates on a peer-to-peer (P2P) network where nodes communicate directly with each other to relay transactions and blocks. The network is designed to be decentralized, resilient, and resistant to censorship.

Network Types

Bitcoin Core supports multiple network types, each identified by a specific address format:
  • IPv4 - Traditional internet addresses (e.g., 192.168.1.1)
  • IPv6 - Modern internet addresses (e.g., 2001:db8::1)
  • Tor (Onion) - Privacy network addresses ending in .onion
  • I2P - Privacy network addresses ending in .b32.i2p
  • CJDNS - Encrypted IPv6 network using fc00::/8 range

Peer Discovery

Bitcoin Core uses several mechanisms to discover and connect to peers:

DNS Seeds

When a node first starts or has few connections, it queries DNS seeds to obtain initial peer addresses.
DNS seed queries are delayed based on the number of known peers:
  • Few peers (< 1000): 11 second delay
  • Many peers (≥ 1000): 5 minute delay
Configuration options:

Address Manager (AddrMan)

The address manager maintains a database of known peer addresses, stored in peers.dat. It implements a tried-and-new bucketing system:
  • Tried table - Addresses of peers successfully connected to
  • New table - Recently learned addresses not yet connected
The address database is automatically dumped to disk every 15 minutes to preserve peer information across restarts.

Anchor Connections

Bitcoin Core maintains up to 2 block-relay-only anchor connections that persist across restarts. These connections are stored in anchors.dat and help prevent eclipse attacks.

Connection Types

Bitcoin Core establishes different types of connections for various purposes:

Outbound Connections

  1. Full Relay - Full transaction and block relay
  2. Block Relay Only - Only blocks are relayed, no transactions
  3. Feeler - Short-lived connections to test peer responsiveness
  4. Address Fetch - Connections specifically to fetch peer addresses

Inbound Connections

Incoming connections from other nodes. By default, listening is enabled unless running behind a proxy.

Configuration Options

Basic Network Configuration

Network Selection

External IP Advertisement

Network Discovery

Privacy Network Integration

1

Understand Network Separation

Bitcoin Core separates privacy networks from clearnet to prevent address correlation. Privacy network addresses (Tor, I2P) are not advertised to clearnet peers and vice versa.
2

Configure Multi-Network Operation

You can run Bitcoin Core on multiple networks simultaneously:
3

Monitor Network Status

Use bitcoin-cli -netinfo to view connection information:
Operating a node on multiple networks (e.g., IPv4 and Tor) can help strengthen the network but may allow adversaries to correlate identities through shared runtime characteristics. This is not recommended if you require unlinkability across networks.

Network Reachability

The network layer uses a reachability scoring system to determine the best local address to advertise to each peer:

Monitoring and Debugging

Get Network Information

Network Statistics

Debug Logging

Enable network-specific debug logging:

Performance Tuning

Upload Limits

The default timeframe is 24 hours (86400 seconds).

Connection Limits

Security Considerations

Best Practices:
  • Use multiple network types for redundancy
  • Enable block-relay-only connections for privacy
  • Monitor peer connections regularly
  • Keep peers.dat backed up for faster restarts
  • Consider using -onlynet=onion for maximum privacy

Advanced Features

Feeler Connections

Bitcoin Core periodically creates short-lived “feeler” connections to test if addresses in the new table are responsive. A random 0-1 second delay is added to prevent synchronization.

Extra Network Peers

Every 5 minutes, Bitcoin Core attempts to connect to reachable networks it’s not currently connected to:

Bridge Nodes

Nodes listening on multiple networks act as bridge nodes, increasing the cost and complexity of eclipse and partition attacks against the Bitcoin network.

RPC Commands

See Also