sparrowwallet / sparrow

Desktop Bitcoin Wallet focused on security and privacy. Free and open source.
https://sparrowwallet.com/
Apache License 2.0
1.34k stars 190 forks source link

Samourai Remixing Postmix results only in transaction errors. Banned? #636

Closed Pleb4Fun closed 2 years ago

Pleb4Fun commented 2 years ago

I tried the integrated whirlpool mixing (my first time) as described in: https://sparrowwallet.com/docs/mixing-whirlpool.html The first mixing round went fine with my own electrum server over tor and therefore internal tor proxy. Now I have all Postmix Transactions with Mixes = 1.

image

There is no progress since 24h and looking on the logs I can see connectivity issues. (Not shown in the UI anyhow) Same applies for using an external TOR Browser as proxy...

2022-07-31 19:59:44,980 ERROR [JavaFX Application Thread] c.s.s.w.WhirlpoolServices [null:-1] Failed to start Whirlpool
com.sparrowwallet.sparrow.whirlpool.WhirlpoolException: Could not create whirlpool wallet 
    at com.sparrowwallet.sparrow@1.6.5/com.sparrowwallet.sparrow.whirlpool.Whirlpool.getWhirlpoolWallet(Unknown Source)
    at com.sparrowwallet.sparrow@1.6.5/com.sparrowwallet.sparrow.whirlpool.Whirlpool$StartupService$1.call(Unknown Source)
    at com.sparrowwallet.sparrow@1.6.5/com.sparrowwallet.sparrow.whirlpool.Whirlpool$StartupService$1.call(Unknown Source)
    at javafx.graphics@18/javafx.concurrent.Task$TaskCallable.call(Unknown Source)
    at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
    at javafx.graphics@18/javafx.concurrent.Service.lambda$executeTask$6(Unknown Source)
    at java.base/java.security.AccessController.doPrivileged(Unknown Source)
    at javafx.graphics@18/javafx.concurrent.Service.lambda$executeTask$7(Unknown Source)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.base/java.lang.Thread.run(Unknown Source)
Caused by: com.samourai.wallet.api.backend.beans.HttpException: java.util.concurrent.ExecutionException: java.net.ConnectException: Connection refused
    at com.sparrowwallet.nightjar@0.2.33/com.samourai.http.client.JacksonHttpClient.getJson(Unknown Source)
    at com.sparrowwallet.nightjar@0.2.33/com.samourai.http.client.JacksonHttpClient.getJson(Unknown Source)
    at com.sparrowwallet.nightjar@0.2.33/com.samourai.whirlpool.client.whirlpool.ServerApi.fetchPools(Unknown Source)
    at com.sparrowwallet.nightjar@0.2.33/com.samourai.whirlpool.client.wallet.data.pool.ExpirablePoolSupplier.fetch(Unknown Source)
    at com.sparrowwallet.nightjar@0.2.33/com.samourai.whirlpool.client.wallet.data.pool.ExpirablePoolSupplier.fetch(Unknown Source)
    at com.sparrowwallet.nightjar@0.2.33/com.samourai.whirlpool.client.wallet.data.supplier.ExpirableSupplier$1.getOrThrow(Unknown Source)
    at com.sparrowwallet.nightjar@0.2.33/com.zeroleak.throwingsupplier.ThrowingSupplier.get(Unknown Source)
    at com.sparrowwallet.nightjar@0.2.33/com.zeroleak.throwingsupplier.ThrowingSupplier.get(Unknown Source)
    at com.google.common@28.2-jre/com.google.common.base.Suppliers$ExpiringMemoizingSupplier.get(Unknown Source)
    at com.sparrowwallet.nightjar@0.2.33/com.samourai.whirlpool.client.wallet.data.supplier.ExpirableSupplier.load(Unknown Source)
    at com.sparrowwallet.nightjar@0.2.33/com.samourai.whirlpool.client.wallet.data.dataSource.WalletResponseDataSource.load(Unknown Source)
    at com.sparrowwallet.nightjar@0.2.33/com.samourai.whirlpool.client.wallet.data.dataSource.WalletResponseDataSource.open(Unknown Source)
    at com.sparrowwallet.sparrow@1.6.5/com.sparrowwallet.sparrow.whirlpool.dataSource.SparrowDataSource.open(Unknown Source)
    at com.sparrowwallet.nightjar@0.2.33/com.samourai.whirlpool.client.wallet.WhirlpoolWallet.open(Unknown Source)
    at com.sparrowwallet.nightjar@0.2.33/com.samourai.whirlpool.client.wallet.WhirlpoolWalletService.openWallet(Unknown Source)
    ... 11 common frames omitted
Caused by: java.util.concurrent.ExecutionException: java.net.ConnectException: Connection refused
    at com.sparrowwallet.merged.module@1.6.5/org.eclipse.jetty.client.util.FutureResponseListener.getResult(Unknown Source)
    at com.sparrowwallet.merged.module@1.6.5/org.eclipse.jetty.client.util.FutureResponseListener.get(Unknown Source)
    at com.sparrowwallet.merged.module@1.6.5/org.eclipse.jetty.client.HttpRequest.send(Unknown Source)
    at com.sparrowwallet.nightjar@0.2.33/com.sparrowwallet.nightjar.http.JavaHttpClient.requestJson(Unknown Source)
    at com.sparrowwallet.nightjar@0.2.33/com.sparrowwallet.nightjar.http.JavaHttpClient.requestJsonGet(Unknown Source)
    ... 26 common frames omitted
Caused by: java.net.ConnectException: Connection refused
    at java.base/sun.nio.ch.Net.pollConnect(Native Method)
    at java.base/sun.nio.ch.Net.pollConnectNow(Unknown Source)
    at java.base/sun.nio.ch.SocketChannelImpl.finishConnect(Unknown Source)
    at com.sparrowwallet.merged.module@1.6.5/org.eclipse.jetty.io.SelectorManager.doFinishConnect(Unknown Source)
    at com.sparrowwallet.merged.module@1.6.5/org.eclipse.jetty.io.ManagedSelector.processConnect(Unknown Source)
    at com.sparrowwallet.merged.module@1.6.5/org.eclipse.jetty.io.ManagedSelector.access$1500(Unknown Source)
    at com.sparrowwallet.merged.module@1.6.5/org.eclipse.jetty.io.ManagedSelector$SelectorProducer.processSelected(Unknown Source)
    at com.sparrowwallet.merged.module@1.6.5/org.eclipse.jetty.io.ManagedSelector$SelectorProducer.produce(Unknown Source)
    at com.sparrowwallet.merged.module@1.6.5/org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.produceTask(Unknown Source)
    at com.sparrowwallet.merged.module@1.6.5/org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(Unknown Source)
    at com.sparrowwallet.merged.module@1.6.5/org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(Unknown Source)
    at com.sparrowwallet.merged.module@1.6.5/org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.produce(Unknown Source)
    at com.sparrowwallet.merged.module@1.6.5/org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(Unknown Source)
    at com.sparrowwallet.merged.module@1.6.5/org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(Unknown Source)
    ... 1 common frames omitted

Not using TOR but some VPN gets me those errors:

2022-07-31 19:53:49,154 ERROR [Thread-140] c.s.s.w.Whirlpool [null:-1] Error retrieving pools
com.samourai.wallet.api.backend.beans.HttpException: java.util.concurrent.ExecutionException: java.io.IOException: SOCKS4 tunnel failed, connection closed
    at com.sparrowwallet.nightjar@0.2.33/com.samourai.http.client.JacksonHttpClient.getJson(Unknown Source)
    at com.sparrowwallet.nightjar@0.2.33/com.samourai.http.client.JacksonHttpClient.getJson(Unknown Source)
    at com.sparrowwallet.nightjar@0.2.33/com.samourai.whirlpool.client.whirlpool.ServerApi.fetchPools(Unknown Source)
    at com.sparrowwallet.nightjar@0.2.33/com.samourai.whirlpool.client.wallet.data.pool.ExpirablePoolSupplier.fetch(Unknown Source)
    at com.sparrowwallet.nightjar@0.2.33/com.samourai.whirlpool.client.wallet.data.pool.ExpirablePoolSupplier.fetch(Unknown Source)
    at com.sparrowwallet.nightjar@0.2.33/com.samourai.whirlpool.client.wallet.data.supplier.ExpirableSupplier$1.getOrThrow(Unknown Source)
    at com.sparrowwallet.nightjar@0.2.33/com.zeroleak.throwingsupplier.ThrowingSupplier.get(Unknown Source)
    at com.sparrowwallet.nightjar@0.2.33/com.zeroleak.throwingsupplier.ThrowingSupplier.get(Unknown Source)
    at com.google.common@28.2-jre/com.google.common.base.Suppliers$ExpiringMemoizingSupplier.get(Unknown Source)
    at com.sparrowwallet.nightjar@0.2.33/com.samourai.whirlpool.client.wallet.data.supplier.ExpirableSupplier.load(Unknown Source)
    at com.sparrowwallet.sparrow@1.6.5/com.sparrowwallet.sparrow.whirlpool.Whirlpool.getPools(Unknown Source)
    at com.sparrowwallet.sparrow@1.6.5/com.sparrowwallet.sparrow.whirlpool.Whirlpool.getPool(Unknown Source)
    at com.sparrowwallet.sparrow@1.6.5/com.sparrowwallet.sparrow.whirlpool.Whirlpool$RegisteredInputsService$1.call(Unknown Source)
    at com.sparrowwallet.sparrow@1.6.5/com.sparrowwallet.sparrow.whirlpool.Whirlpool$RegisteredInputsService$1.call(Unknown Source)
    at javafx.graphics@18/javafx.concurrent.Task$TaskCallable.call(Unknown Source)
    at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
    at javafx.graphics@18/javafx.concurrent.Service.lambda$executeTask$6(Unknown Source)
    at java.base/java.security.AccessController.doPrivileged(Unknown Source)
    at javafx.graphics@18/javafx.concurrent.Service.lambda$executeTask$7(Unknown Source)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.util.concurrent.ExecutionException: java.io.IOException: SOCKS4 tunnel failed, connection closed
    at com.sparrowwallet.merged.module@1.6.5/org.eclipse.jetty.client.util.FutureResponseListener.getResult(Unknown Source)
    at com.sparrowwallet.merged.module@1.6.5/org.eclipse.jetty.client.util.FutureResponseListener.get(Unknown Source)
    at com.sparrowwallet.merged.module@1.6.5/org.eclipse.jetty.client.HttpRequest.send(Unknown Source)
    at com.sparrowwallet.nightjar@0.2.33/com.sparrowwallet.nightjar.http.JavaHttpClient.requestJson(Unknown Source)
    at com.sparrowwallet.nightjar@0.2.33/com.sparrowwallet.nightjar.http.JavaHttpClient.requestJsonGet(Unknown Source)
    ... 22 common frames omitted
Caused by: java.io.IOException: SOCKS4 tunnel failed, connection closed
    at com.sparrowwallet.merged.module@1.6.5/org.eclipse.jetty.client.Socks4Proxy$Socks4ProxyConnection.onFillable(Unknown Source)
    at com.sparrowwallet.merged.module@1.6.5/org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(Unknown Source)
    at com.sparrowwallet.merged.module@1.6.5/org.eclipse.jetty.io.FillInterest.fillable(Unknown Source)
    at com.sparrowwallet.merged.module@1.6.5/org.eclipse.jetty.io.ChannelEndPoint$2.run(Unknown Source)
    at com.sparrowwallet.merged.module@1.6.5/org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(Unknown Source)
    at com.sparrowwallet.merged.module@1.6.5/org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(Unknown Source)
    ... 1 common frames omitted

In the docs a ban is described. Does the UI reflect such a ban or could my error logs also indicate such a ban? The Whirlpool coordinator implements an automatic temporary ban to protect itself against attacks or unstable clients. Such ban automatically expires after some time (about 12h).

Pleb4Fun commented 2 years ago

Short follow-up. I read in another issue that the whirlpool client "only registers one input per pool size for remixing". Maybe it's all ok - one input has the progress bar with Registered Input (1 of 154) So maybe this is just fine and I need to be more patient while ignoring the appearing errors in the log? If this is how it should look like we can probably close this issue...

Screenshot 2022-07-31 at 20 20 58

Suggestion: Maybe add a screenshot of how a successfully registered postmix looks like in the docs and add this "only registers one input per pool size for remixing" information - for me it was not clear that only 1 by 1 can be remixed - this could take ages then... https://sparrowwallet.com/docs/mixing-whirlpool.html#further-postmix-rounds I'm glad I didn't choose smaller chunks. I also couldn't see a recommendation in the docs for how many chunks is good practice.

Thanks overall for this great wallet. I'm currently migrating slowly from Electrum to Sparrow trying all those nice integrated features on the way.

Pleb4Fun commented 2 years ago

Somehow the log keeps having error messages over error messages. The UI progress bar is unchanged and it all looks like the thing is online...

Stuff like:

2022-07-31 21:05:27,019 ERROR [Whirlpool-HttpClient-COORDINATOR_WEBSOCKET-676] c.s.w.c.w.WhirlpoolWallet [null:-1]  - 
[MIX] 0.xxxbtc ⣿ WHIRLPOOL FAILED ⣿ Mix failed, receiveAddress=bc1xxxxxxxxx, path=m/84'/0'/2147483646'/0/20, type=POSTMIX

2022-07-31 21:12:50,908 WARN [Thread-521] c.s.w.c.w.d.p.ExpirablePoolSupplier [null:-1] load() failure => last value fallback
com.samourai.wallet.api.backend.beans.HttpException: java.util.concurrent.TimeoutException: Total timeout 30000 ms elapsed
    at com.sparrowwallet.nightjar@0.2.33/com.samourai.http.client.JacksonHttpClient.getJson(Unknown Source)
    at com.sparrowwallet.nightjar@0.2.33/com.samourai.http.client.JacksonHttpClient.getJson(Unknown Source)
    at com.sparrowwallet.nightjar@0.2.33/com.samourai.whirlpool.client.whirlpool.ServerApi.fetchPools(Unknown Source)
    at com.sparrowwallet.nightjar@0.2.33/com.samourai.whirlpool.client.wallet.data.pool.ExpirablePoolSupplier.fetch(Unknown Source)
    at com.sparrowwallet.nightjar@0.2.33/com.samourai.whirlpool.client.wallet.data.pool.ExpirablePoolSupplier.fetch(Unknown Source)
    at com.sparrowwallet.nightjar@0.2.33/com.samourai.whirlpool.client.wallet.data.supplier.ExpirableSupplier$1.getOrThrow(Unknown Source)
    at com.sparrowwallet.nightjar@0.2.33/com.zeroleak.throwingsupplier.ThrowingSupplier.get(Unknown Source)
    at com.sparrowwallet.nightjar@0.2.33/com.zeroleak.throwingsupplier.ThrowingSupplier.get(Unknown Source)
    at com.google.common@28.2-jre/com.google.common.base.Suppliers$ExpiringMemoizingSupplier.get(Unknown Source)
    at com.sparrowwallet.nightjar@0.2.33/com.samourai.whirlpool.client.wallet.data.supplier.ExpirableSupplier.load(Unknown Source)
    at com.sparrowwallet.sparrow@1.6.5/com.sparrowwallet.sparrow.whirlpool.Whirlpool.getPools(Unknown Source)
    at com.sparrowwallet.sparrow@1.6.5/com.sparrowwallet.sparrow.whirlpool.Whirlpool.getPool(Unknown Source)
    at com.sparrowwallet.sparrow@1.6.5/com.sparrowwallet.sparrow.whirlpool.Whirlpool$RegisteredInputsService$1.call(Unknown Source)
    at com.sparrowwallet.sparrow@1.6.5/com.sparrowwallet.sparrow.whirlpool.Whirlpool$RegisteredInputsService$1.call(Unknown Source)
    at javafx.graphics@18/javafx.concurrent.Task$TaskCallable.call(Unknown Source)
    at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
    at javafx.graphics@18/javafx.concurrent.Service.lambda$executeTask$6(Unknown Source)
    at java.base/java.security.AccessController.doPrivileged(Unknown Source)
    at javafx.graphics@18/javafx.concurrent.Service.lambda$executeTask$7(Unknown Source)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.util.concurrent.TimeoutException: Total timeout 30000 ms elapsed
    at com.sparrowwallet.merged.module@1.6.5/org.eclipse.jetty.client.HttpDestination$TimeoutTask.onTimeoutExpired(Unknown Source)
    at com.sparrowwallet.merged.module@1.6.5/org.eclipse.jetty.io.CyclicTimeout$Wakeup.run(Unknown Source)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
    at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
    at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
    ... 3 common frames omitted
craigraw commented 2 years ago

There is no progress since 24h

This is not unusual in normal circumstances. Remixes depend on being selected (at random) as new liquidity enters the pool. Some days you might get no remixes, and some days you might get several. However, your anonymity set is not just dependant on your remix count, but those of your peers too. Read https://medium.com/samourai-wallet/diving-head-first-into-whirlpool-anonymity-sets-4156a54b0bc7 to understand this further.

Re selecting a pool, ultimately ending up with a variety of UTXO sizes is optimal. Use https://www.whirlpoolfees.com/ to help work out which pool is best for your input amount and goals.

The UI does reflect bans. If you don't see anything in the UI, your UTXOs are not banned. Bans resolve in 24 hours.

I've added a line to the docs to reflect that only one UTXO per pool get registered for a potential remix at a time.

It does look like your VPN is giving you intermittent connectivity issues connecting to the coordinator, so I would try to resolve that.

Pleb4Fun commented 2 years ago

Thanks for coming back to me and mentioning in the docs that only 1 UTXO will be remixed at a time. This was really non-obvious to me. Also I wasn't sure if potential bans are reflected in the UI - good to know that this "Registered input" status seems to be ok. For me this is the most confusing part that the mixing gets stuck here for days - even if mentioned in the docs that it will get slower by design... If it takes in average let's say 24h and I want to remix 11 utxos minimum 3 times this is more than 1 month of non stop running a hot wallet letting this thing run. Not sure I want this hassle with all my corn in the future...

All those different errors in the logs were/are really a bit disturbing to me - as my connection is perfectly stable for any other application. But it seems like I need to ignore those and be more patient. I'll confirm here once remixing is done with some short status update.

craigraw commented 2 years ago

If it takes in average let's say 24h and I want to remix 11 utxos minimum 3 times this is more than 1 month

Probably less, but yes it takes time in order to achieve a real anonymity set. Study the literature and it will become clearer why this is the case.

as my connection is perfectly stable for any other application.

If you are not using Tor (check if there is a Tor icon next to the toggle in the status bar) then you can ping pool.whirl.mx to check your connectivity to the coordinator. The Tor address is different.

Pleb4Fun commented 2 years ago

Yeah, I think all is fine. Still getting occasional ERROR messages in the log but probably the retries then succeed without really causing any visible hick-ups. Just started more mixes with two other granularities (without any issues) so now it is at least 3 postmix utxos waiting to increase my chances to be selected one day...

Thanks for your work Craig! Listening to last years podcast with Stephan Livera (https://stephanlivera.com/episode/262/) made me finally have a serious look at Sparrow and give it a try over the good old Electrum. Never got warm with the web-based competitor for reasons you also mentioned.

Pleb4Fun commented 2 years ago

🥳 Sorry for spamming this (closed) issue. Just so happy this all works like a charme. Now I had multiple utxos re-mixed already with the new granularities (maybe the smaller pools are more popular or its just the random luck I'm lacking in the initial pool). This is awesome and I should have just had more patience.

I also love the little details like

Once all this is upgraded to taproot that will be even better. Currently, the multi-sig setup will get revealed when spending from it...