Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support of Torv3 (Required for BTCPay Server) #2873

Closed
NicolasDorier opened this issue Jun 6, 2019 · 14 comments
Closed

Support of Torv3 (Required for BTCPay Server) #2873

NicolasDorier opened this issue Jun 6, 2019 · 14 comments

Comments

@NicolasDorier
Copy link

NicolasDorier commented Jun 6, 2019

I recently added Bisq to the supported software to connect to your BTCPay hosted node.

image

I tried it today, and sadly it does not work.

BTCPay use Tor version 3 for exposing the full node.

Tor v2 is not adapted to connect to your own node because you want your own BTC node to whitelist any connection using the Tor address to guarantee having a connection slot available.

But if your Tor is version 2, then your address become discoverable and anybody could connect to it and DDoS you.

Jun-07 00:23:18.233 [JavaFX Application Thread] INFO  b.c.b.s.WalletsSetup: Socks5Proxy for bitcoinj: socks5Proxy=sampleapi.example.com:61780	Version 5 
Jun-07 00:23:18.256 [JavaFX Application Thread] INFO  o.b.c.Context: Creating bitcoinj 0.14.7.bisq.1-SNAPSHOT context. 
Jun-07 00:23:18.263 [JavaFX Application Thread] ERROR b.c.s.CommonSetup: Uncaught Exception from thread JavaFX Application Thread 
Jun-07 00:23:18.263 [JavaFX Application Thread] ERROR b.c.s.CommonSetup: throwableMessage= Invalid hostname: ######################.onion 
Jun-07 00:23:18.264 [JavaFX Application Thread] ERROR b.c.s.CommonSetup: throwableClass= class java.lang.IllegalArgumentException 
Jun-07 00:23:18.273 [JavaFX Application Thread] ERROR b.c.s.CommonSetup: Stack trace:
java.lang.IllegalArgumentException: Invalid hostname: ######################.onion
	at org.bitcoinj.net.OnionCatConverter.onionHostToIPV6Bytes(OnionCatConverter.java:28)
	at org.bitcoinj.net.OnionCatConverter.onionHostToInetAddress(OnionCatConverter.java:46)
	at bisq.core.btc.nodes.BtcNodeConverter$Facade.onionHostToInetAddress(BtcNodeConverter.java:130)
	at bisq.core.btc.nodes.BtcNodeConverter.convertOnionHost(BtcNodeConverter.java:61)
	at bisq.core.btc.nodes.BtcNodesRepository.lambda$getOnionHosts$1(BtcNodesRepository.java:74)

Torv2 seems required at BitcoinJ level, but there is normally NO NEED to require it. If you have your own fork of BitcoinJ, I advise you to patch it.

@NicolasDorier NicolasDorier changed the title Support of Torv3 Support of Torv3 (Required for BTCPay Server) Jun 6, 2019
@NicolasDorier
Copy link
Author

Actually the code break at Bisq level!

@ripcurlx
Copy link
Contributor

ripcurlx commented Jun 6, 2019

@freimair Could you please have a look at this issue/requirement?

@freimair
Copy link
Member

freimair commented Jun 6, 2019

yes will do. but please allow for a week or so as I am off to having a sail in Scotland

@NicolasDorier
Copy link
Author

@freimair cool I hope you can do something about it and that's not a block at BitcoinJ level!

@NicolasDorier
Copy link
Author

@freimair any chance to do something about it?
Also if a user try to do it, then it can't open Bisq again without crashing like @britttttk reported.

@freimair
Copy link
Member

freimair commented Jul 4, 2019 via email

@freimair
Copy link
Member

freimair commented Jul 4, 2019

may require the functionality of #1056

@ripcurlx
Copy link
Contributor

@NicolasDorier Just a heads-up that the tor upgrade roadmap is discussed internally right now. Should be an update available soon.

@wiz
Copy link
Member

wiz commented Oct 12, 2020

@cd2357 can you unassign florian and look into this? ❤️

@freimair freimair removed their assignment Oct 12, 2020
@cd2357
Copy link
Contributor

cd2357 commented Oct 12, 2020

Seems to depend on bitcoinj

java.lang.IllegalArgumentException: Invalid hostname: wizbit5555bsslwv4ctronnsgk5vh2w2pdx7v7eyuivlyuoteejk7lid.onion
	at org.bitcoinj.net.OnionCatConverter.onionHostToIPV6Bytes(OnionCatConverter.java:28)
	at org.bitcoinj.net.OnionCatConverter.onionHostToInetAddress(OnionCatConverter.java:46)
	at bisq.core.btc.nodes.BtcNodeConverter$Facade.onionHostToInetAddress(BtcNodeConverter.java:130)
	at bisq.core.btc.nodes.BtcNodeConverter.convertOnionHost(BtcNodeConverter.java:61)
	at bisq.core.btc.nodes.BtcNodesRepository.lambda$getOnionHosts$1(BtcNodesRepository.java:74)
	at java.base/java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:271)

Will have another look once 1.4.0 is out, since that starts using a new bitcoinj branch.

@wiz
Copy link
Member

wiz commented Oct 12, 2020

Yes I guess might have to PR the code in Bisq's fork of bitcoinj https://github.com/bisq-network/bitcoinj
Altho the main bitcoinj repo might be working on this already so probably a good idea to check upstream/master

@cd2357
Copy link
Contributor

cd2357 commented Oct 12, 2020

Unfortunately it looks like bitcoinj has no native support for tor, all of that that is added as a custom modification to our own bitcoinj fork (bisq-network/bitcoinj#25).

Our tor code also seems to go pretty deep, affecting PeerAddress, serialization, onioncat format support, etc.

I'd rather let someone more knowledgeable handle this, like perhaps @oscarguindzberg if he's interested.

@ripcurlx
Copy link
Contributor

ripcurlx commented Jun 8, 2021

bitcoinj/bitcoinj#2067 is implemented already and we are in the process of migrating and testing the Tor v3 support.

@cd2357
Copy link
Contributor

cd2357 commented Oct 28, 2021

Bisq now supports Tor v3 addresses.

@cd2357 cd2357 closed this as completed Oct 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants