Skip to main content

Overview

Bitcoin Core can run as a Tor onion service and connect to other onion services, providing enhanced privacy and resistance to network surveillance. Tor routes your traffic through multiple relays, making it difficult to trace your connection origin.
Starting with Bitcoin Core 22.0, only Tor v3 addresses are supported. Tor v2 addresses are ignored and neither relayed nor stored.

Quick Start

1

Install Tor

Install Tor on your system:
2

Start Tor Service

3

Run Bitcoin Core Behind Tor

This configuration anonymizes all outbound Bitcoin connections through the Tor network.

Compatibility

  • Bitcoin Core 22.0+: Tor v3 only
  • Tor 0.4.6+: v2 support removed
  • Recommended Tor version: 0.4.6 or later
Tor v2 addresses are no longer supported. Ensure you’re using Tor v3 addresses ending in .onion (56 characters).

Configuration Methods

There are three main ways to configure Tor with Bitcoin Core:

1. Run Behind a Tor Proxy

The simplest method - route all connections through Tor:
Configuration options:
The Tor Browser Bundle uses port 9150 by default, while system Tor installations typically use port 9050.

UNIX Domain Sockets

You can use UNIX domain sockets for proxy connections:

2. Automatic Onion Service

Bitcoin Core can automatically create ephemeral onion services using Tor’s control socket API.
1

Configure Tor Control Port

Edit /etc/tor/torrc and add/uncomment:
2

Restart Tor

3

Configure Permissions (if needed)

If you see authentication errors:
4

Enable in Bitcoin Core

Configuration options:

Authentication Methods

Cookie Authentication (recommended): Automatic if the user running bitcoind has read access to Tor’s cookie file (/run/tor/control.authcookie). Password Authentication:

3. Manual Onion Service

Create a persistent onion service manually:
1

Configure Tor

Add to /etc/tor/torrc:
Virtual port (8333) should match Bitcoin’s P2P port. Target address (127.0.0.1:8334) is where Tor forwards connections.
2

Restart Tor

3

Get Your Onion Address

Example output: 7zvj7a2imdgkdbg4f2dryd5rgtrn7upivr5eeij4cicjh65pooxeshid.onion
4

Run Bitcoin Core

Advanced Configuration

Tor-Only Mode

Connect exclusively to Tor peers:
Using -onlynet=onion may make your node more susceptible to Sybil attacks. Consider combining with other networks for better security.

Dual-Stack Configuration

Run reachable from both Tor and clearnet:
Dual-stack nodes help strengthen the Bitcoin network but may allow traffic analysis to correlate your clearnet and Tor identities.

Tor for Onion Access Only

Use Tor only for .onion addresses, clearnet for others:

Bind to Specific Interface

Prevent clearnet connections to your onion-only node:

Multiple External IPs

Advertise multiple addresses:
Bitcoin Core will advertise the most compatible address to each peer using heuristics.

Monitoring and Verification

Check Your Onion Address

View Onion Peers

Enable Tor Debug Logging

Check ~/.bitcoin/debug.log for Tor-related messages:

Troubleshooting

Solution:

Connection Issues

Port Conflicts

If using Tor Browser Bundle, it may use port 9150 instead of 9050:

Privacy Recommendations

Best Practices:
  1. Dedicated onion service: Don’t add other services to the same onion address
  2. Single network: Use -onlynet=onion for maximum privacy
  3. No dual-stack: Avoid running on multiple networks if unlinkability is required
  4. Block-relay connections: Consider using block-relay-only connections for additional privacy
  5. Regular monitoring: Check connections regularly with -netinfo
Operating bridge nodes (listening on both Tor and clearnet) can be correlated through timing analysis and shared runtime characteristics. Only use bridge mode if you don’t require strict identity separation.

Configuration Examples

Maximum Privacy

bitcoin.conf

Bridge Node

bitcoin.conf

Automatic Ephemeral Service

bitcoin.conf

Performance Considerations

Tor connections are generally slower than clearnet due to routing through multiple relays:
  • Latency: 3-10x higher than direct connections
  • Bandwidth: Limited by slowest relay in circuit
  • Initial sync: Significantly slower, consider using clearnet initially
For faster initial blockchain download, sync over clearnet first, then switch to Tor-only mode.

See Also