stack_wallet icon indicating copy to clipboard operation
stack_wallet copied to clipboard

Bug: Connection to Bitcoin node via Tor not possible (SW:Win, SD:Android)

Open lasermind opened this issue 1 year ago • 1 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Current Behavior

After enabling Tor in the apps settings, the user sets up his own Bitcoin node by providing the credentials for the Electrum server (*.onion, port 50001, Tor traffic). Testing the connection fails after roughly 30s and a red "server unreachable" note appears. No connection is established.

This happens with Stack Wallet 2.1.9 on Windows and Stack Duo 1.2.4 on Android.

stackwallet-win-tor-connection-error

Expected Behavior

When testing the connection or connecting to an already saved connection, the connection should be established, with no error.

Reproduce Steps

In Stack Wallet or Stack Duo: · Enable Tor (in Tor Settings) · Provide credentials to a Bitcoin node (Electrum) behind Tor (in Manage nodes) · Tap "Test connection" button · Test should be successful

Environment

Behaviour occurs in: · Stack Wallet 2.1.9 on Windows 11 · Stack Duo 1.2.4 on Android 11 (… and most likely in all other permutations.)

It is not clear, whether Stack Wallet/Duo spins up its own Tor proxy or expects a Tor proxy to be present (Tor Browser, or daemon). There is no documentation on this. I assumed it spins up its own proxy, for user friendlyness. However, I tested all two scenarios; the outcome was the same: not working.

Also please note: I can connect without a problem to the Electrum server via Tor using Sparrow Wallet. So it is not a problem on the node side, with the network connection, or anything else. There must be something wrong with Stack Wallet/Duo.

Also: Stack Wallet/Duo can connect locally to the node (by providing the clearnet IP address from the local network) and not using a Tor connection. So all this suggests, that there is something wrong with the Tor implementation.

Logs and further Information

Here I post the logs from Stack Wallet 2.1.9 on Windows:

As text
[Info][2024-12-06 15:59:44.009Z]: TorSyncStatusChangedEvent fired with arg newStatus = TorConnectionStatus.connecting (TorService.start call in progress)
[Info][2024-12-06 15:59:44.556Z]: User does not want to use external calls
[Info][2024-12-06 15:59:44.678Z]: TorSyncStatusChangedEvent fired with arg newStatus = TorConnectionStatus.connected (TorService.start call success)
[Warning][2024-12-06 15:59:44.678Z]: TorStatusChangedEvent changed to "TorStatus.enabled" with message: useTor updated in prefs
[Info][2024-12-06 16:01:44.557Z]: User does not want to use external calls
[Info][2024-12-06 16:03:44.556Z]: User does not want to use external calls
[Info][2024-12-06 16:04:44.557Z]: User does not want to use external calls
[Info][2024-12-06 16:06:44.557Z]: User does not want to use external calls
[Info][2024-12-06 16:09:11.952Z]: User does not want to use external calls

stackwallet-win-tor-connection-error-log



And here the log from Stack Duo 1.2.4 on Android:

As text
[Info][2024-12-06 18:28:43.277Z]: TorSyncStatusChangedEvent fired with arg newStatus = TorConnectionStatus.connecting (TorService.start call in progress)
[Info][2024-12-06 18:28:44.118Z]: TorSyncStatusChangedEvent fired with arg newStatus = TorConnectionStatus.connected (TorService.start call success)
[Warning][2024-12-06 18:28:44.118Z]: TorStatusChangedEvent changed to "TorStatus.enabled" with message: useTor updated in prefs
[Info][2024-12-06 18:29:04.340Z]: User does not want to use external calls
[Info][2024-12-06 18:29:07.223Z]: Periodic notifications update check
[Info][2024-12-06 18:30:04.340Z]: User does not want to use external calls
[Info][2024-12-06 18:30:07.224Z]: Periodic notifications update check
[Info][2024-12-06 18:30:48.452Z]: This is the .swb content from intent: null
[Info][2024-12-06 18:31:00.037Z]: This is the .swb content from intent: null

stackwallet-android-tor-connection-error-log


Hope this helps, to get a clue, what this error is all about!

Thanks! ✌️ L

lasermind avatar Dec 06 '24 19:12 lasermind

Hello, sorry it took a while to get to this. We're now in bug fixing mode again. Is this still happening?

rehrar avatar Oct 21 '25 15:10 rehrar