lightningnetwork / lnd

Lightning Network Daemon ⚡️
MIT License
7.64k stars 2.08k forks source link

tor: deprecate --tor.v2 option for onion services #5771

Open Roasbeef opened 3 years ago

Roasbeef commented 3 years ago

The latest version of the Tor daemon won't connect to the "older" v2 onion service addresses. Instead, it'll only allow users to connect out to and create (?) v3 onion services. In roughly 2 weeks, Tor will release a new version of the client that will disable support for v2 onion services: https://support.torproject.org/onionservices/v2-deprecation/#:~:text=In%20July%202021%2C%200.4.,Service%20version%202%20deprecation%20timeline.

On our end, we mainly just need to remove the --tor.v2 arg and possibly add a new --tor.onion (or something) flag that selects the default since there no longer is a choice.

On the neutrino end, we still need to carry out this issue which is primarily a btcd/btcsuite issue as we need to add support for addrv2.

Spun off of: https://github.com/lightningnetwork/lnd/issues/5517#issuecomment-923439866

Roasbeef commented 3 years ago

If we detect that a user is running a new enough version of Tor that doesn't support v2 any longer, then we can also automatically (?) convert their v2 addr into a v3 (well just make a new one really) and advertise that on the network instead.

Roasbeef commented 3 years ago

Ran a quick script to see how many v2 nodes would be affected:

num nodes:  12844
num tor:  8793
num num v2:  66
num num v3:  8777

Looks like not many which is great, so perhaps we can just go w/ the option of removing the option and converting them to v3 (if their Tor daemon supports it, but I think those that do will be out of consensus come October?).

starius commented 8 months ago

It seems that v2 addresses haven't been used for a year now:

hidserv-dir-onions-seen-2021-10-24-2024-01-22

I suggest to deprecate the option and print a warning in case it is used. And later remove v2 from the code. I think it is already dead code.