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
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
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: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.
Configuration options:
Authentication Methods
Cookie Authentication (recommended): Automatic if the user runningbitcoind has read access to Tor’s cookie file (/run/tor/control.authcookie).
Password Authentication:
3. Manual Onion Service
Create a persistent onion service manually: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.
Get Your Onion Address
7zvj7a2imdgkdbg4f2dryd5rgtrn7upivr5eeij4cicjh65pooxeshid.onionAdvanced Configuration
Tor-Only Mode
Connect exclusively to Tor peers: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:Monitoring and Verification
Check Your Onion Address
View Onion Peers
Enable Tor Debug Logging
~/.bitcoin/debug.log for Tor-related messages:
Troubleshooting
Authentication Cookie Error
Connection Issues
Port Conflicts
If using Tor Browser Bundle, it may use port 9150 instead of 9050:Privacy Recommendations
Best Practices:
- Dedicated onion service: Don’t add other services to the same onion address
- Single network: Use
-onlynet=onionfor maximum privacy - No dual-stack: Avoid running on multiple networks if unlinkability is required
- Block-relay connections: Consider using block-relay-only connections for additional privacy
- Regular monitoring: Check connections regularly with
-netinfo
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
See Also
- P2P Network - General network configuration
- I2P Support - Alternative privacy network
- CJDNS Support - Encrypted IPv6 network
- Tor Project Documentation