You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Documentation trap when using -bind in conjunction with (automatically configured) Tor hidden services #33458
To start with the conclusion: everything appears to work as intended, so this should probably not be considered a bug as such, but some logging and telemetry output could be improved to make things clearer.
If you use -bind to manually specify which (public) IPs to listen to, Bitcoin Core will also no longer create the (local) default socket for incoming Tor connections at 127.0.01:8334 unless you specify it manually in your list - this is probably working as intended. When automatically creating a Tor hidden service, it will instead be routed to the public IPv4 port, and incoming Tor connections still work just fine.
However, without the dedicated Tor socket, Bitcoin Core is unable to distinguish between regular IPv4 connections and Tor connections, so all of the latter will be counted as the former.
The specific case that had me scratching my head for a bit: -netinfo reported zero incoming Tor connections
ipv4 ipv6 onion total block
in 291 28 0 319
out 5 3 2 10 2
total 296 31 2 329
while the true number of incoming Tor connections was 29.
ss -tupan | grep tor | grep 8333 | wc -l
29
As expected, removing the -bind statements from the config and restarting fixed it.
ipv4 ipv6 onion total block
in 25 4 5 34
out 4 1 5 10 2
total 29 5 10 44
While the documentation for -bind hints towards why this is the case, Bitcoin Core gives no indication in the logs or the -netinfo output that the configuration is suboptimal, and I feel like maybe it should do that just to save people (like me) from getting confused.
Maybe during startup, if no Tor socket is created and a Tor hidden service is created, it should add something like "Warning: -bind was specified but lacks a dedicated Tor socket; incoming Tor connections will be counted as regular connections", and when using -netinfo it should show a "?" or "-" instead of "0".
I think the right approach might not be a warning. Since-listenoniondefaults to true, we start StartTorControl
by default. If we are still accepting incoming Tor connections, my suggestion is that we should try to make the count correct for -netinfo.
Two possible solutions come to mind(I have not tested any, so I don't know if they are accurate)
Option 1
Override -listenonion If -bind is specified and no =onion is in the bind list, automatically set listenonion=0:
No Tor hidden service created
User gets exactly what their -bind implies -netinfo gets correct count
Option 2
Enforce =onion binding If -bind is specified and listenonion=true, and no =onion is in the bind list, automatically add 127.0.0.1:8334=onion:
Tor socket created inbound_onion=true
-netinfo Count is accurate
I think the right approach might not be a warning. Since-listenoniondefaults to true, we start StartTorControl by default. If we are still accepting incoming Tor connections, my suggestion is that we should try to make the count correct for -netinfo.
Two possible solutions come to mind(I have not tested any, so I don't know if they are accurate) Option 1 Override -listenonion If -bind is specified and no =onion is in the bind list, automatically set listenonion=0: No Tor hidden service created User gets exactly what their -bind implies -netinfo gets correct count
Option 2 Enforce =onion binding If -bind is specified and listenonion=true, and no =onion is in the bind list, automatically add 127.0.0.1:8334=onion: Tor socket created inbound_onion=true -netinfo Count is accurate
On second thought, this suggestions would not work. listenonion and -bind should not be coupled.
Activity
Add warning and documentation for -bind with Tor hidden services (bit…
ArmchairCryptologist commentedon Jan 21, 2026
I haven't heard otherwise so I believe it's up for grabs, thanks!
naiyoma commentedon Mar 27, 2026
I think the right approach might not be a warning. Since
-listenoniondefaults totrue, we startStartTorControlby default. If we are still accepting incoming Tor connections, my suggestion is that we should try to make the count correct for
-netinfo.Two possible solutions come to mind(I have not tested any, so I don't know if they are accurate)
Option 1
Override
-listenonionIf-bindis specified and no=onionis in the bind list, automatically setlistenonion=0:No Tor hidden service created
User gets exactly what their
-bindimplies-netinfogets correct countOption 2
Enforce
=onionbinding If -bind is specified andlistenonion=true, andno =onionis in the bind list, automatically add127.0.0.1:8334=onion:Tor socket created
inbound_onion=true-netinfo Count is accurate
naiyoma commentedon Mar 30, 2026
On second thought, this suggestions would not work. listenonion and -bind should not be coupled.
net: Warn when Tor onion service lacks a dedicated onion bind
net: warn when Tor onion service shares a bind