Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: vinshet on May 25, 2022, 12:41:53 PM



Title: Connecting from an IP node to a TOR node
Post by: vinshet on May 25, 2022, 12:41:53 PM
Hi,
I am running a pruned IP node and a pruned TOR node. How do I connect to the TOR node from the IP node?


Title: Re: Connecting from an IP node to a TOR node
Post by: vv181 on May 25, 2022, 12:59:39 PM
You can allow your clearnet node to interact with the Tor network by setting up proxy config on your bitcoin.conf. Additionally, of course, you have to run the Tor first on the system.

Code:
proxy=127.0.0.1:9050

And proceed to connect to the Tor nodes, by using addnode or connect.


Title: Re: Connecting from an IP node to a TOR node
Post by: n0nce on May 25, 2022, 01:02:09 PM
On different systems? Why do you want to connect them?

Usually Bitcoin nodes connect automatically to whatever other node is reachable and meets certain conditions (e.g. not sending bogus or invalid data).
To connect to a peer, you send a version message containing your version number, block count, and current time. The remote peer will send back a verack message and his own version message if he is accepting connections from your version. You will respond with your own verack if you are accepting connections from his version.

The time data from all of your peers is collected, and the median is used by Bitcoin for all network tasks that use the time (except for other version messages).

You then exchange getaddr and addr messages, storing all addresses that you don't know about. addr messages often contain only one address, but sometimes contain up to 1000. This is most common at the beginning of an exchange.

If thirty minutes or more has passed since the client has transmitted any messages it will transmit a message to keep the connection to the peer node alive.

If ninety minutes has passed since a peer node has communicated any messages, then the client will assume that connection has closed.

According to [1], you can directly connect to another node using addnode. Then check connection using getaddednodeinfo.

[1] https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_calls_list


Title: Re: Connecting from an IP node to a TOR node
Post by: ranochigo on May 25, 2022, 02:53:25 PM
If you're running a Tor node, then you are also running the node behind an onion address. These onion address only exist within the Tor network and cannot access them without running a Tor instance of some sort.

The reverse is true however, you can connect to a node on the clearnet just from your Tor node. The connection is bi-directional, so you'll receive and send data regardless of whether the node is an incoming or an outgoing one. You can just connect to the clearnet node from the Tor node and it will be fine.


Title: Re: Connecting from an IP node to a TOR node
Post by: vinshet on May 26, 2022, 07:40:30 AM
I wanted to get details on the contents of the addr messages from a IP node to a TOR node and vice versa. I was able to connect by installing tor and then restarting bitcoin core. It automatically creates a hidden service for me without having to change the config file.


Title: Re: Connecting from an IP node to a TOR node
Post by: Hamza2424 on June 11, 2022, 10:50:29 AM
I wanted to get details on the contents of the addr messages from a IP node to a TOR node and vice versa. I was able to connect by installing tor and then restarting bitcoin core. It automatically creates a hidden service for me without having to change the config file.


Well thats ok, But i am trying to understand Why Tor node is required ( For Privacy ??? ) thats what all i know about it as First time I'm actually Getting it in a way that how it is used and what are the reasons tha we should use it.

I'll be grateful if you explain 🙂....

Tor addresses are more Encrypted that it....


Title: Re: Connecting from an IP node to a TOR node
Post by: NotATether on June 13, 2022, 04:04:01 AM
Well thats ok, But i am trying to understand Why Tor node is required ( For Privacy ??? ) thats what all i know about it as First time I'm actually Getting it in a way that how it is used and what are the reasons tha we should use it.

Data sent through the TOR network is obfuscated by the relay nodes (on the TOR network, not the Bitcoin network), to the hidden service - that huge jumble of letters inside an .onion domain name, and in this case points to another Bitcoin node - and then back again to the Tor client, in this case, the Bitcoin node.

When you use IP addresses, the data is sent in plain-text because it's not encrypted with TLS first.


Title: Re: Connecting from an IP node to a TOR node
Post by: n0nce on June 15, 2022, 01:25:39 AM
I wanted to get details on the contents of the addr messages from a IP node to a TOR node and vice versa. I was able to connect by installing tor and then restarting bitcoin core. It automatically creates a hidden service for me without having to change the config file.


Well thats ok, But i am trying to understand Why Tor node is required ( For Privacy ??? )
Exactly; the biggest benefit is going to be that nobody can see that you're running a node in your home and track you / come to your house based on your IP address.
There are many oppressive governments that do this (also if you publish something online they don't like, or if you criticize them) so having Tor is a huge blessing since it doesn't allow them to track you like this anymore.

As was pointed out, Tor traffic is also encrypted and it's also a convenient and secure way to bypass a firewall. For instance, you can access your node from on the go through Tor without opening ports on your router.