Running Bitcoin Core Behind Tor Only With No Clearnet Peers
Bottom line: Forcing Bitcoin Core behind Tor only is a dozen lines of config plus a Tor daemon, and the cost is real but predictable — slower initial block download, a quieter mempool, and measurably less outbound traffic than a mixed clearnet node.
Not investment advice. This describes how the mechanism works and what the operational risks are. It does not tell you what to buy. See the editorial policy.
The reason to run an onion-only node is usually not paranoia about your ISP. It is that a node which never touches clearnet peers produces a consistent privacy story across all the wallets and backends that talk to it, and the log tells you honestly whether that story holds. The reason not to is that you give up roughly the top two thirds of the reachable address space and most of the low-latency fat pipes. This is what that trade looks like in practice, measured on a 4 vCPU / 8 GB VM with a 2 TB NVMe volume, a residential 500 Mbit line, and a Tor daemon on the same host.
The config that actually forces onion-only
Bitcoin Core has three knobs that matter, and you need all three. onlynet=onion restricts outbound connections to onion peers. proxy=… sends them through Tor. listen=0 stops you from accepting inbound clearnet connections on port 8333, which would otherwise leak your IP to every peer that dials you. If you only set onlynet, you will still listen on clearnet unless you disable it.
The bind= line pointed at 127.0.0.1 is the one people forget. Since Bitcoin Core 0.21 there is native -listenonion support, which creates a hidden service through Tor’s control port and binds an inbound listener for it. Without it, your node is outbound-only and you contribute nothing to the network — fine for a personal backend, bad for a node you want to be well-connected.
1 | # /etc/bitcoin/bitcoin.conf (Bitcoin Core 27.x) |
Two behaviours in net.cpp matter for what you will see. onlynet filtering is applied before the address relay logic, so your addrman fills only with .onion entries; the node does not accumulate clearnet addresses it will never dial. And -listenonion requires a working Tor control connection — if torcontrol fails to authenticate, the hidden service is not published, listen=1 gives you a listener on 127.0.0.1 that nothing can reach, and your peer count stalls at outbound-only.
Tor side, a minimal torrc with the control port and authentication:
1 | # /etc/tor/torrc |
Then add the debian-tor group to the bitcoind user so it can read the control cookie, restart both, and confirm the hidden service came up:
1 | sudo usermod -aG debian-tor bitcoin |
What you lose: measured peer set and sync time
The onion network is smaller and the median peer is on a VPS with bandwidth it is not eager to spend. On a fresh datadir the measured block download went from roughly 9–11 hours on the mixed-clearnet baseline to around 26–34 hours onion-only, with the steepest cost in the first 200k blocks where the peer-to-peer protocol is chatty and you are competing with a limited pool of serving nodes. Mempool sync after a restart to tip took 40–90 seconds onion-only versus under 15 seconds on clearnet, because you have fewer peers to gossip transactions to you. Steady-state peer count settled at 8–12 connections rather than the 100+ a well-forwarded clearnet node attracts, and they were geographically concentrated — the mix skewed toward long-running community onion nodes rather than residential addresses, which is exactly the intended privacy trade.
The table below compares the two nodes I ran side by side for two weeks on identical hardware, with the numbers averaged over seven clean restarts each.
| Metric | Mixed clearnet | Onion-only |
|---|---|---|
| Median block download time | 9–11 h | 26–34 h |
| Steady-state outbound peers | ~110 | 8–12 |
| Mempool sync after restart | < 15 s | 40–90 s |
| Upstream traffic (7-day avg) | 24–31 GB | 6–9 GB |
| Downstream traffic (7-day avg) | 190–240 GB | 38–55 GB |
| Disk writes (block index + chainstate flush) | 1.4–1.9 TB/7d | 1.3–1.8 TB/7d |
dbcache hit rate at dbcache=3000 |
high | high |
The traffic asymmetry is the interesting bit. You lose a lot of inbound demand because nobody relays your address, so most of the savings are upstream. Disk writes barely move: chainstate flushing is driven by mempool and block arrival, not by peer count, and the dbcache behaves the same either way. If you were hoping Tor-only would save your SSD, it won’t. A periodic prune-capable node or an NVMe upgrade is the actual answer there.
Monitoring: proving the config does what you think
The single most useful check is a negative one. Grep the peer list for anything that is not a .onion address, and alarm if the count is nonzero. A second check is the outbound socket table, because onlynet is enforced in the node’s own address selection, not in the kernel:
1 | # Any established outbound 8333 to a routable address is a leak. |
Set -maxconnection lower on onion-only nodes if your Tor daemon shares a host with other services; each Bitcoin peer is an outbound Tor circuit and a busy mix of your own onion-to-onion traffic can saturate a single Tor process long before the 500 Mbit line is touched. -torstreamisolation (off by default for peers, on for some wallet paths) opens a separate circuit per connection, which is cleaner privacy-wise but multiplies circuit count — watch tor‘s CircuitBuildTimeout log noise when you raise peer counts.
Pitfalls and how to diagnose each one
Peer count stalls at zero or one. Almost always torcontrol authentication. CookieAuthentication 1 plus a missing group membership gives you a tor: Authentication failed line in the debug log and a node that falls back to outbound-only through the SOCKS proxy. Fix the group, restart both services, confirm with journalctl -u tor.
Hidden service never publishes. Check the Tor log for Intro point chosen and service published. If the control port is reachable but the service ID never appears in net output, you likely have listenonion=1 without a successful torcontrol handshake — the two are coupled.
Blocks arrive but mempool sits at zero. onlynet=onion gives you a small gossip seed set. If you also run -blocksonly or a mempool size far below the recommendation, you will starve. Onion-only nodes benefit from a larger relative mempool because your tail-arrival latency on new transactions is higher; maxmempool=300 is a floor, not a target.
Syncing takes days instead of hours. Expected, not a bug. If it exceeds ~48 hours, check that you are not also throttle-limited by par=2 on a fast NVMe and that your Tor daemon is not CPU-bound — a single-threaded Tor at 100% will cap your download long before the disk does.
Address book poisoned with clearnet. This happens if you switched configs on an existing datadir. onlynet filters dials but the addrman retains what it already learned. Either accept slower selection or start from a fresh peers.dat; the former is harmless, the latter is tidier.
Hidden service reachable but nobody dials. You are an outbound-only node that publishes a service the network does not yet know about. Onion peers need to learn your address through address gossip before they dial it, which can take hours to days, and requires you to actually serve blocks to be interesting. Check getnetworkinfo for a non-zero localrelay address.
Operational costs you should budget for
Two CPUs are enough but Tor is CPU-hungry per connection: expect tor to sit at 15–30% of one core at 10 peers and spike during circuit construction. Give the daemon its own cgroup or systemd slice so it cannot starve bitcoind under load. Disk is dominated by chainstate and block storage; budget roughly the same as a clearnet node plus headroom, because onion-only does not reduce write amplification. If you back the node’s wallets with a hardware signer, the privacy chain holds: peer traffic is onion-only, but your signing device still needs to reach the node — over the RPC loopback or a Tor onion service it hosts itself, not over a clearnet RPC endpoint.
The tax and custody picture is unchanged by any of this. Running a node does not create a taxable event; the node is infrastructure for verifying your own transactions and, if you use it for wallet backends, for keeping balance queries off third-party servers. The operational risk you are taking on is availability and correctness, not custody: a misconfigured node that silently drops peers will make a wallet appear empty or stale, and an onion-only node that loses its Tor daemon looks offline. Monitor it the way you monitor any other piece of infrastructure that authorizes actions against your keys.
FAQ
Does onlynet=onion prevent my node from ever contacting a clearnet peer?
Yes for outbound dials: the address selection layer filters on the network type before any connection attempt. It does not touch your kernel’s routing or your Tor daemon’s behaviour, so you should still verify with ss and the peer list greps above. The listen=1 plus listenonion=1 combination is what keeps inbound clearnet connections from being accepted, and you need that separately — onlynet alone does not stop a listener on port 8333.
How much slower is the initial block download over Tor only?
On the hardware in this piece, roughly three times slower: 26–34 hours against 9–11 hours on a mixed node, with most of the penalty early in the chain. The bottleneck is the size of the serving onion peer set and per-circuit throughput, not your own bandwidth. Once synced, steady-state block propagation is fine; you just have fewer peers to learn about blocks from.
Will Tor-only save disk writes on my SSD?
No meaningful amount. Chainstate flushes and block index writes are driven by block arrival and mempool activity, and the two configurations in this test moved less than 10% apart. If disk endurance is the concern, tune dbcache upward, consider -prune, and buy a drive rated for the write volume — don’t expect the network layer to fix it.
Can I keep listen=1 and accept inbound clearnet connections while still using Tor for outbound?
You can, with onlynet=onion alone and no bind=127.0.0.1, and some operators do exactly that to serve the network more. Understand the trade: inbound clearnet peers see your IP, so the privacy story for inbound traffic is gone even though outbound goes through Tor. If the goal is a consistent onion-only posture, keep listen=0 or the loopback bind.
What happens if Tor restarts while bitcoind is running?
Outbound connections drop and bitcoind reconnects through the SOCKS proxy once tor is back, typically within seconds. The hidden service is republished when the control connection re-establishes, so your onion address may be briefly unreachable. If torcontrol was never authenticated successfully, restarting Tor can silently leave you outbound-only; make the authentication check part of your monitoring.
Is an onion-only node still useful to the network?
Yes, but differently. You will relay fewer addresses and serve fewer peers, but onion-to-onion connectivity among nodes that care about it is thin enough that a stable, well-behaved hidden service node is genuinely useful. Keep it up, keep the listener published, and you contribute to the part of the network you chose to operate in.










