Author

Topic: How to verify that Core is using Tor? (Read 187 times)

legendary
Activity: 2716
Merit: 1387
Ukrainians will resist
September 03, 2021, 12:57:16 AM
#8
Here is a detailed instruction on how to set up Bitcoin core through the Tor - https://bitcointalksearch.org/topic/ann-bitcoin-btc-on-tor-addnodes-project-5177001
In fact, there is nothing complicated in setting up, literally in a few clicks everything is done.
HCP
legendary
Activity: 2086
Merit: 4314
September 01, 2021, 08:45:55 PM
#7
Yeah, I could definitely see how words like that could cause confusion without the proper context Wink
member
Activity: 266
Merit: 36
September 01, 2021, 08:06:40 PM
#6
Indeed... assumption is the mother of all fuck ups Wink

May I ask what lead to you assuming that Bitcoin Core would just use Tor by default? I'm curious to know if there is a learning opportunity here for everyone. Huh

It was a stupid misreading, out of context, of some phrase like "Bitcoin Core v0.12 and later automatically tries to connect to Tor" [following context omitted; in https://en.bitcoin.it/wiki/Setting_up_a_Tor_hidden_service], but I'm not sure that precisely was the source.
HCP
legendary
Activity: 2086
Merit: 4314
September 01, 2021, 07:47:59 PM
#5
Indeed... assumption is the mother of all fuck ups Wink

May I ask what lead to you assuming that Bitcoin Core would just use Tor by default? I'm curious to know if there is a learning opportunity here for everyone. Huh
member
Activity: 266
Merit: 36
August 31, 2021, 09:12:23 AM
#4
You're not using Tor. Bitcoin Core cannot connect to the Tor instance, are you running Tor at all?

You have to use -onlynet=onion and -bind=127.0.0.1 to force Bitcoin Core to only connect to onion nodes and for incoming connections to go through Tor. If done correctly, bitcoin-cli getnetworkinfo should return reachable for onion and have a network score.
[...]

I'm sure tor is running. E.g., it shows in ps output and I can get Firefox to use tor by setting it to use tor's Socks proxy.

As mentioned in the OP I presumed Core uses tor by default even with no (relevant) changes to bitcoin.conf or to tor's configuration (torrc). I now know, with the prodding of your and other responses here, that presumption was incorrect. Thanks!
legendary
Activity: 2954
Merit: 4158
August 30, 2021, 10:51:16 PM
#3
You're not using Tor. Bitcoin Core cannot connect to the Tor instance, are you running Tor at all?

You have to use -onlynet=onion and -bind=127.0.0.1 to force Bitcoin Core to only connect to onion nodes and for incoming connections to go through Tor. If done correctly, bitcoin-cli getnetworkinfo should return reachable for onion and have a network score.

Not sure how it works for inbound. probably best practice to disable all of it with nolisten as listen=1 may allow nodes to connect over clearnet in certain instances?
When a proxy is enabled, Core automatically sets listen=0 unless specified otherwise.
legendary
Activity: 1946
Merit: 1427
August 30, 2021, 04:44:09 PM
#2
All outbound connections can be forced through tor with onlynet=onion if i recall correctly

as to how you can check this, not sure. -netinfo 4? (not sure what the 4 stands for exactly)

Not sure how it works for inbound. probably best practice to disable all of it with nolisten as listen=1 may allow nodes to connect over clearnet in certain instances?

Maybe check out:

https://bitcoin.stackexchange.com/questions/70069/how-can-i-setup-bitcoin-to-be-anonymous-with-tor/

And:

https://bitcoin.stackexchange.com/questions/103402/how-can-i-use-bitcoin-core-with-the-anonymous-network-protocol-i2p

I have no idea what i2p is myself.
member
Activity: 266
Merit: 36
August 30, 2021, 02:29:52 PM
#1
Installed Bitcoin Core 0.21.1 on a Ubuntu system, copied over the contents of the .bitcoin directory (including blockchain data) from another system on which I'd been running Core for years. Installed Tor, with which I've no prior experience. Started bitcoin-qt having only these parameters in ~/.bitcoin/bitcoin.conf:
dbcache=1024
datadir=[path to .bitcoin data directory on volume different from /home volume]
debug=tor

I presumed that Core defaults to using Tor for its output.

There were a sizeable number of connections, both in and out, and my blockchain was brought up to date. The only evidence I see of Tor in debug.log is numerous periodic instances of:
tor: Error connecting to Tor control socket
tor: Not connected to Tor control port 127.0.0.1:9051, trying to reconnect

--until I closed bitcoin-qt, which generated:
tor: Thread interrupt
Shutdown: In progress...
addcon thread exit
torcontrol thread exit

In neither the "New outbound peer connected" entries in debug.log nor in the Peers window did I see anything that specifically indicated Tor to me, but then I don't know what I'm looking for. I retained the debug.log and screenshots of the Peers window for review. I can issue CLI commands if helpful.
Jump to: