Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: defa1 on July 02, 2021, 05:47:56 PM



Title: bind= option in bitcoin.conf
Post by: defa1 on July 02, 2021, 05:47:56 PM
I have a node running with Tor running as a service and proxy=127.0.0.1:9050 in the bitcoin.conf file. Does it make any difference if I add bind=127.0.0.1 and/or bind=127.0.0.1:9050 to the file?


Title: Re: bind= option in bitcoin.conf
Post by: NotATether on July 02, 2021, 06:11:53 PM
I have a node running with Tor running as a service and proxy=127.0.0.1:9050 in the bitcoin.conf file. Does it make any difference if I add bind=127.0.0.1 and/or bind=127.0.0.1:9050 to the file?

The -bind option listens for Tor connections on the address you give it, on port 8334 if you don't pass a port like your first bind syntax, so no, since the address is already connected as a SOCKS proxy.


Title: Re: bind= option in bitcoin.conf
Post by: defa1 on July 02, 2021, 11:16:20 PM
I have a node running with Tor running as a service and proxy=127.0.0.1:9050 in the bitcoin.conf file. Does it make any difference if I add bind=127.0.0.1 and/or bind=127.0.0.1:9050 to the file?

The -bind option listens for Tor connections on the address you give it, on port 8334 if you don't pass a port like your first bind syntax, so no, since the address is already connected as a SOCKS proxy.

So adding bind=127.0.0.1 does nothing? What's the point of this setting then?


Title: Re: bind= option in bitcoin.conf
Post by: vv181 on July 03, 2021, 01:06:25 AM
So adding bind=127.0.0.1 does nothing? What's the point of this setting then?

Adding bind=127.0.0.1 combined with proxy=127.0.0.1:9050 would make your Bitcoin core would only connect over Tor.

That config is to bind any Bitcoin core connection to 127.0.0.1 which it will be passed to port 8334(default tor inbound connections) and then addressed to your default bitcoin core port (8333). So it would make any connection using Tor.

These references might help u understand further:
https://en.bitcoin.it/wiki/Setting_up_a_Tor_hidden_service
https://github.com/bitcoin/bitcoin/blob/master/doc/tor.md

Correct me if I'm wrong tho, I just barely learn about bitcoin technical things.



Title: Re: bind= option in bitcoin.conf
Post by: ranochigo on July 03, 2021, 03:34:06 AM
So adding bind=127.0.0.1 does nothing? What's the point of this setting then?
It does. If you're using any proxy, Tor for example, peers can still connect to you via your clearnet address. This can happen even if you specify oniononly, which only ensures outgoing connections to onion address but doesn't restrict your incoming connections.

If your IP has previously been used with a clearnet address and you didn't bind your Core to your proxy, then incoming peers can still establish a connection without going through your proxy or Tor instance.

Adding bind=127.0.0.1 combined with proxy=127.0.0.1:9050 would make your Bitcoin core would only connect over Tor.
Using the proxy already routes the connections to the peers over the proxy that is specified.


Title: Re: bind= option in bitcoin.conf
Post by: defa1 on July 03, 2021, 08:58:52 AM
But isn't this is only relevant if you accept incoming connections? If I'm not mistaken, Bitcoin will not accept connections when running behind a proxy, except if you define listen=1.


Title: Re: bind= option in bitcoin.conf
Post by: ranochigo on July 03, 2021, 09:20:28 AM
But isn't this is only relevant if you accept incoming connections? If I'm not mistaken, Bitcoin will not accept connections when running behind a proxy, except if you define listen=1.
Yes, that is correct.

Binding that address will make your Core instance to only listen on that address so that connections from others to your node can only be done through the address that you've specified but connections to other nodes are already routed through the proxy.