WalletWasabi: Optimizing Anonymity Gain By Optimizing Timeouts

Background

There’s a constant 2h timeout in Wasabi, however this could be made dynamic and optimized for anonymity gain.

Quantifying Anonymity Gains

Take a round where 3 peer participated. All 3 got back 1BTC mixed coins, and 2 of them got back 2BTC mixed coins. In this case we quantify the quality of this coinjoin as 3*3*1 + 2*2*2, as 3 peer gained 3 anonymity set to 1BTC and 2 peer gained 2 anonymity for 2BTC. Let’s call this number Wasabi Coinjoin Quality: WCQ. In this case WCQ = 44. The higher the WCQ is for a given coinjoin, the better it is.

Optimizing Timeouts

The idea is to aim for the highest possible WCQ by dynamically adjusting timeouts. After every coinjoin, we calculate WCQ and adjust the timeout depending on WCQ’s direction by a 1m.

Examples

  1. Start server.
  2. Coinjoin 1 happened with WCQ = 10 and timeout = 120m.
  3. Lower timeout by 1m.
  4. Coinjoin 2 happened with WCQ = 11 and timeout = 119m.
  5. Lower timeout by 1m.
  6. Coinjoin 3 happened with WCQ = 10 and timeout = 118m.
  7. Increase timeout by 1m.
  8. Coinjoin 4 happened with WCQ = 11 and timeout = 119m.

Notes

  • This is purely server side change, so it does not requires client updates.
  • With this algorithm we can make sure to deliver the greatest value with our current architecture to our users, as the timeouts would slowly converge towards the most optimal one.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 4
  • Comments: 29 (1 by maintainers)

Most upvoted comments

The trend is turning around.

Day 1,  TxCount: 20,    WCQ Avg: 598,   WCQ Total: 11963,       Income Avg: 0.0171469,  Income Total: 0.3429381
Day 2,  TxCount: 22,    WCQ Avg: 575,   WCQ Total: 12657,       Income Avg: 0.01583459, Income Total: 0.34836114
Day 3,  TxCount: 18,    WCQ Avg: 709,   WCQ Total: 12779,       Income Avg: 0.0190894,  Income Total: 0.34360934
Day 4,  TxCount: 20,    WCQ Avg: 685,   WCQ Total: 13707,       Income Avg: 0.01877776, Income Total: 0.37555536
Day 5,  TxCount: 18,    WCQ Avg: 685,   WCQ Total: 12343,       Income Avg: 0.01848049, Income Total: 0.33264889
Day 6,  TxCount: 21,    WCQ Avg: 524,   WCQ Total: 11019,       Income Avg: 0.01391941, Income Total: 0.29230762
Day 7,  TxCount: 18,    WCQ Avg: 743,   WCQ Total: 13386,       Income Avg: 0.02097988, Income Total: 0.37763789
---
Day 8,  TxCount: 27,    WCQ Avg: 619,   WCQ Total: 16738,       Income Avg: 0.01676519, Income Total: 0.4526603
---
Day 9,  TxCount: 37,    WCQ Avg: 412,   WCQ Total: 15255,       Income Avg: 0.01113924, Income Total: 0.41215224
Day 10, TxCount: 39,    WCQ Avg: 403,   WCQ Total: 15729,       Income Avg: 0.01117022, Income Total: 0.43563858
Day 11, TxCount: 41,    WCQ Avg: 282,   WCQ Total: 11573,       Income Avg: 0.00786254, Income Total: 0.32236444
Day 12, TxCount: 40,    WCQ Avg: 312,   WCQ Total: 12510,       Income Avg: 0.00880085, Income Total: 0.35203404
Day 13, TxCount: 34,    WCQ Avg: 228,   WCQ Total: 7776,        Income Avg: 0.00676652, Income Total: 0.23006198
Day 14, TxCount: 48,    WCQ Avg: 342,   WCQ Total: 16456,       Income Avg: 0.01030176, Income Total: 0.49448484
Day 15, TxCount: 40,    WCQ Avg: 400,   WCQ Total: 16014,       Income Avg: 0.01329587, Income Total: 0.53183509

Lowballing and increasing as needed is cheaper than overshooting and we can fail at overshooting and be in the same situation. Seems only ideal for it being easier to code.

On Mon., Jan. 13, 2020, 11:41 Aviv Milner, notifications@github.com wrote:

A more ideal solution is that the coordinator should set fees that roughly guarantee confirmation within 6 blocks. Currently it is set to 144 blocks.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/zkSNACKs/WalletWasabi/issues/2940?email_source=notifications&email_token=AAC643ADH7TGZROCLSJ7GQTQ5SKU5A5CNFSM4KCYM2MKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEIZNGQQ#issuecomment-573756226, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAC643F6JPUTHHFL7H5QZHLQ5SKU5ANCNFSM4KCYM2MA .

These are the daily incomes since 1 Jan:

1 | 0.3429381 2 | 0.34836114 3 | 0.34360934 4 | 0.37555536 5 | 0.33264889 6 | 0.29230762 7 | 0.39711304 8 | 0.44784824 9 | 0.40725297 10 | 0.42587476 11 | 0.32236444 12 | 0.35203404

When we started the timeframe decrease there was an obvious jump, but the last two days shows a slight drop. IMO this timeframe is still too short to base statistics on it, so lets wait a bit more and evaluate on 27 Jan as discussed previously.

Final Results

Total WCQ

image

Total Income

image

Data

Day 293,        TxCount: 22,    WCQ Avg: 627,   WCQ Total: 13814,       Income Avg: 0.01606907, Income Total: 0.35351961
Day 294,        TxCount: 18,    WCQ Avg: 748,   WCQ Total: 13468,       Income Avg: 0.01951842, Income Total: 0.35133162
Day 295,        TxCount: 20,    WCQ Avg: 985,   WCQ Total: 19705,       Income Avg: 0.02609909, Income Total: 0.52198194
Day 296,        TxCount: 20,    WCQ Avg: 915,   WCQ Total: 18313,       Income Avg: 0.02430677, Income Total: 0.48613545
Day 297,        TxCount: 10,    WCQ Avg: 570,   WCQ Total: 5705,        Income Avg: 0.01646815, Income Total: 0.16468155
Day 298,        TxCount: 27,    WCQ Avg: 710,   WCQ Total: 19185,       Income Avg: 0.0188368,  Income Total: 0.50859374
Day 299,        TxCount: 24,    WCQ Avg: 748,   WCQ Total: 17970,       Income Avg: 0.02069698, Income Total: 0.49672762
Day 300,        TxCount: 19,    WCQ Avg: 667,   WCQ Total: 12681,       Income Avg: 0.01892273, Income Total: 0.35953205
Day 301,        TxCount: 16,    WCQ Avg: 856,   WCQ Total: 13699,       Income Avg: 0.02452474, Income Total: 0.39239596
Day 302,        TxCount: 18,    WCQ Avg: 714,   WCQ Total: 12865,       Income Avg: 0.02100671, Income Total: 0.3781208
Day 303,        TxCount: 17,    WCQ Avg: 877,   WCQ Total: 14911,       Income Avg: 0.02501448, Income Total: 0.4252462
Day 304,        TxCount: 15,    WCQ Avg: 869,   WCQ Total: 13037,       Income Avg: 0.0248396,  Income Total: 0.372594
Day 305,        TxCount: 19,    WCQ Avg: 660,   WCQ Total: 12543,       Income Avg: 0.0186098,  Income Total: 0.35358638
Day 306,        TxCount: 14,    WCQ Avg: 775,   WCQ Total: 10861,       Income Avg: 0.02117372, Income Total: 0.29643218
Day 307,        TxCount: 21,    WCQ Avg: 465,   WCQ Total: 9773,        Income Avg: 0.01305526, Income Total: 0.27416054
Day 308,        TxCount: 17,    WCQ Avg: 711,   WCQ Total: 12094,       Income Avg: 0.01970905, Income Total: 0.33505388
Day 309,        TxCount: 20,    WCQ Avg: 928,   WCQ Total: 18561,       Income Avg: 0.02589982, Income Total: 0.51799643
Day 310,        TxCount: 20,    WCQ Avg: 702,   WCQ Total: 14048,       Income Avg: 0.02078946, Income Total: 0.41578924
Day 311,        TxCount: 22,    WCQ Avg: 554,   WCQ Total: 12189,       Income Avg: 0.0168651,  Income Total: 0.3710323
Day 312,        TxCount: 9,     WCQ Avg: 580,   WCQ Total: 5225,        Income Avg: 0.01823713, Income Total: 0.16413419
Day 313,        TxCount: 29,    WCQ Avg: 702,   WCQ Total: 20358,       Income Avg: 0.02079054, Income Total: 0.60292594
Day 314,        TxCount: 17,    WCQ Avg: 716,   WCQ Total: 12188,       Income Avg: 0.02160999, Income Total: 0.36736993
Day 315,        TxCount: 19,    WCQ Avg: 856,   WCQ Total: 16272,       Income Avg: 0.02509971, Income Total: 0.47689467
Day 316,        TxCount: 10,    WCQ Avg: 810,   WCQ Total: 8107,        Income Avg: 0.02280544, Income Total: 0.22805449
Day 317,        TxCount: 28,    WCQ Avg: 639,   WCQ Total: 17901,       Income Avg: 0.01905816, Income Total: 0.53362874
Day 318,        TxCount: 17,    WCQ Avg: 562,   WCQ Total: 9556,        Income Avg: 0.01795279, Income Total: 0.30519756
Day 319,        TxCount: 16,    WCQ Avg: 615,   WCQ Total: 9855,        Income Avg: 0.01938405, Income Total: 0.31014486
Day 320,        TxCount: 20,    WCQ Avg: 592,   WCQ Total: 11853,       Income Avg: 0.01801073, Income Total: 0.36021468
Day 321,        TxCount: 18,    WCQ Avg: 516,   WCQ Total: 9303,        Income Avg: 0.01581469, Income Total: 0.28466449
Day 322,        TxCount: 11,    WCQ Avg: 578,   WCQ Total: 6360,        Income Avg: 0.01740133, Income Total: 0.19141469
Day 323,        TxCount: 23,    WCQ Avg: 839,   WCQ Total: 19312,       Income Avg: 0.02389361, Income Total: 0.54955314
Day 324,        TxCount: 20,    WCQ Avg: 637,   WCQ Total: 12747,       Income Avg: 0.01895871, Income Total: 0.37917432
Day 325,        TxCount: 15,    WCQ Avg: 640,   WCQ Total: 9613,        Income Avg: 0.01770143, Income Total: 0.26552151
Day 326,        TxCount: 16,    WCQ Avg: 595,   WCQ Total: 9527,        Income Avg: 0.01733694, Income Total: 0.27739106
Day 327,        TxCount: 16,    WCQ Avg: 646,   WCQ Total: 10336,       Income Avg: 0.01903792, Income Total: 0.30460675
Day 328,        TxCount: 17,    WCQ Avg: 579,   WCQ Total: 9849,        Income Avg: 0.01699089, Income Total: 0.28884524
Day 329,        TxCount: 9,     WCQ Avg: 601,   WCQ Total: 5413,        Income Avg: 0.01679172, Income Total: 0.15112551
Day 330,        TxCount: 24,    WCQ Avg: 615,   WCQ Total: 14775,       Income Avg: 0.01757951, Income Total: 0.42190826
Day 331,        TxCount: 20,    WCQ Avg: 929,   WCQ Total: 18597,       Income Avg: 0.02597049, Income Total: 0.51940981
Day 332,        TxCount: 20,    WCQ Avg: 632,   WCQ Total: 12649,       Income Avg: 0.0179863,  Income Total: 0.35972613
Day 333,        TxCount: 17,    WCQ Avg: 503,   WCQ Total: 8565,        Income Avg: 0.01424396, Income Total: 0.24214737
Day 334,        TxCount: 21,    WCQ Avg: 567,   WCQ Total: 11916,       Income Avg: 0.01610759, Income Total: 0.33825955
Day 335,        TxCount: 17,    WCQ Avg: 668,   WCQ Total: 11368,       Income Avg: 0.01937136, Income Total: 0.32931323
Day 336,        TxCount: 17,    WCQ Avg: 830,   WCQ Total: 14120,       Income Avg: 0.02277862, Income Total: 0.38723655
Day 337,        TxCount: 18,    WCQ Avg: 864,   WCQ Total: 15554,       Income Avg: 0.02401043, Income Total: 0.43218788
Day 338,        TxCount: 18,    WCQ Avg: 897,   WCQ Total: 16157,       Income Avg: 0.0248321,  Income Total: 0.44697797
Day 339,        TxCount: 17,    WCQ Avg: 767,   WCQ Total: 13039,       Income Avg: 0.02110874, Income Total: 0.35884868
Day 340,        TxCount: 15,    WCQ Avg: 757,   WCQ Total: 11366,       Income Avg: 0.02036936, Income Total: 0.30554051
Day 341,        TxCount: 18,    WCQ Avg: 652,   WCQ Total: 11749,       Income Avg: 0.01682814, Income Total: 0.30290659
Day 342,        TxCount: 20,    WCQ Avg: 577,   WCQ Total: 11551,       Income Avg: 0.01453756, Income Total: 0.29075121
Day 343,        TxCount: 18,    WCQ Avg: 693,   WCQ Total: 12490,       Income Avg: 0.0181163,  Income Total: 0.32609351
Day 344,        TxCount: 21,    WCQ Avg: 818,   WCQ Total: 17191,       Income Avg: 0.02162869, Income Total: 0.45420264
Day 345,        TxCount: 16,    WCQ Avg: 687,   WCQ Total: 11006,       Income Avg: 0.01801876, Income Total: 0.28830021
Day 346,        TxCount: 19,    WCQ Avg: 705,   WCQ Total: 13410,       Income Avg: 0.01828093, Income Total: 0.3473377
Day 347,        TxCount: 17,    WCQ Avg: 721,   WCQ Total: 12260,       Income Avg: 0.01944295, Income Total: 0.33053021
Day 348,        TxCount: 15,    WCQ Avg: 645,   WCQ Total: 9686,        Income Avg: 0.01736835, Income Total: 0.26052529
Day 349,        TxCount: 13,    WCQ Avg: 608,   WCQ Total: 7907,        Income Avg: 0.01568042, Income Total: 0.20384547
Day 350,        TxCount: 23,    WCQ Avg: 782,   WCQ Total: 17987,       Income Avg: 0.02039525, Income Total: 0.46909089
Day 351,        TxCount: 23,    WCQ Avg: 658,   WCQ Total: 15146,       Income Avg: 0.01728664, Income Total: 0.39759283
Day 352,        TxCount: 19,    WCQ Avg: 757,   WCQ Total: 14398,       Income Avg: 0.02084322, Income Total: 0.39602118
Day 353,        TxCount: 17,    WCQ Avg: 869,   WCQ Total: 14778,       Income Avg: 0.02333221, Income Total: 0.39664761
Day 354,        TxCount: 15,    WCQ Avg: 855,   WCQ Total: 12825,       Income Avg: 0.02392702, Income Total: 0.35890531
Day 355,        TxCount: 16,    WCQ Avg: 521,   WCQ Total: 8339,        Income Avg: 0.01436124, Income Total: 0.22977996
Day 356,        TxCount: 18,    WCQ Avg: 691,   WCQ Total: 12451,       Income Avg: 0.01892831, Income Total: 0.34070963
Day 357,        TxCount: 17,    WCQ Avg: 539,   WCQ Total: 9167,        Income Avg: 0.01416637, Income Total: 0.2408283
Day 358,        TxCount: 21,    WCQ Avg: 568,   WCQ Total: 11934,       Income Avg: 0.01504666, Income Total: 0.31597993
Day 359,        TxCount: 21,    WCQ Avg: 353,   WCQ Total: 7417,        Income Avg: 0.00983621, Income Total: 0.20656043
Day 360,        TxCount: 18,    WCQ Avg: 575,   WCQ Total: 10357,       Income Avg: 0.01568545, Income Total: 0.28233826
Day 361,        TxCount: 21,    WCQ Avg: 624,   WCQ Total: 13116,       Income Avg: 0.01730529, Income Total: 0.36341122
Day 362,        TxCount: 18,    WCQ Avg: 606,   WCQ Total: 10920,       Income Avg: 0.01608415, Income Total: 0.28951481
Day 363,        TxCount: 23,    WCQ Avg: 481,   WCQ Total: 11064,       Income Avg: 0.01301796, Income Total: 0.29941317
Day 364,        TxCount: 18,    WCQ Avg: 678,   WCQ Total: 12207,       Income Avg: 0.01801706, Income Total: 0.32430712
Day 365,        TxCount: 20,    WCQ Avg: 638,   WCQ Total: 12765,       Income Avg: 0.01803379, Income Total: 0.36067585
Day 1,          TxCount: 20,    WCQ Avg: 598,   WCQ Total: 11963,       Income Avg: 0.0171469,  Income Total: 0.3429381
Day 2,          TxCount: 22,    WCQ Avg: 575,   WCQ Total: 12657,       Income Avg: 0.01583459, Income Total: 0.34836114
Day 3,          TxCount: 18,    WCQ Avg: 709,   WCQ Total: 12779,       Income Avg: 0.0190894,  Income Total: 0.34360934
Day 4,          TxCount: 20,    WCQ Avg: 685,   WCQ Total: 13707,       Income Avg: 0.01877776, Income Total: 0.37555536
Day 5,          TxCount: 18,    WCQ Avg: 685,   WCQ Total: 12343,       Income Avg: 0.01848049, Income Total: 0.33264889
Day 6,          TxCount: 21,    WCQ Avg: 524,   WCQ Total: 11019,       Income Avg: 0.01391941, Income Total: 0.29230762
Day 7,          TxCount: 18,    WCQ Avg: 743,   WCQ Total: 13386,       Income Avg: 0.02097988, Income Total: 0.37763789
------------------------------------------------------------------------------------------------------------------------
Day 8,          TxCount: 27,    WCQ Avg: 619,   WCQ Total: 16738,       Income Avg: 0.01676519, Income Total: 0.4526603
------------------------------------------------------------------------------------------------------------------------
Day 9,          TxCount: 37,    WCQ Avg: 412,   WCQ Total: 15255,       Income Avg: 0.01113924, Income Total: 0.41215224
Day 10,         TxCount: 39,    WCQ Avg: 403,   WCQ Total: 15729,       Income Avg: 0.01117022, Income Total: 0.43563858
Day 11,         TxCount: 41,    WCQ Avg: 282,   WCQ Total: 11573,       Income Avg: 0.00786254, Income Total: 0.32236444
Day 12,         TxCount: 40,    WCQ Avg: 312,   WCQ Total: 12510,       Income Avg: 0.00880085, Income Total: 0.35203404
Day 13,         TxCount: 34,    WCQ Avg: 228,   WCQ Total: 7776,        Income Avg: 0.00676652, Income Total: 0.23006198
Day 14,         TxCount: 48,    WCQ Avg: 342,   WCQ Total: 16456,       Income Avg: 0.01030176, Income Total: 0.49448484
Day 15,         TxCount: 40,    WCQ Avg: 400,   WCQ Total: 16014,       Income Avg: 0.01329587, Income Total: 0.53183509
Day 16,         TxCount: 43,    WCQ Avg: 347,   WCQ Total: 14956,       Income Avg: 0.01085831, Income Total: 0.46690746
Day 17,         TxCount: 39,    WCQ Avg: 284,   WCQ Total: 11087,       Income Avg: 0.0091189,  Income Total: 0.35563744
Day 18,         TxCount: 36,    WCQ Avg: 352,   WCQ Total: 12696,       Income Avg: 0.01103607, Income Total: 0.3972987
Day 19,         TxCount: 40,    WCQ Avg: 309,   WCQ Total: 12372,       Income Avg: 0.00951266, Income Total: 0.3805067
Day 20,         TxCount: 35,    WCQ Avg: 337,   WCQ Total: 11796,       Income Avg: 0.01000347, Income Total: 0.35012154
Day 21,         TxCount: 27,    WCQ Avg: 297,   WCQ Total: 8033,        Income Avg: 0.00965104, Income Total: 0.26057811
Day 22,         TxCount: 48,    WCQ Avg: 422,   WCQ Total: 20302,       Income Avg: 0.01238315, Income Total: 0.59439165
Day 23,         TxCount: 39,    WCQ Avg: 358,   WCQ Total: 13964,       Income Avg: 0.01017054, Income Total: 0.39665134
Day 24,         TxCount: 38,    WCQ Avg: 320,   WCQ Total: 12172,       Income Avg: 0.00888375, Income Total: 0.33758278
Day 25,         TxCount: 43,    WCQ Avg: 271,   WCQ Total: 11669,       Income Avg: 0.00709074, Income Total: 0.3049022

Sure, we set 27th of January. I’m just leaving some partial reports here.

IMO as we discussed earlier we need to give it some longer timescale to have better statistics.

Automatic timeout proved to be incorrect, as there’s no drastic jump or drop caused by cutting the timeout in half, so however we would mess with the timeouts it would be just noise (see @lontivero’s argument on control theory (https://github.com/zkSNACKs/WalletWasabi/issues/2940#issuecomment-571727036))

Day 1,  TxCount: 20,    WCQ Avg: 598,   WCQ Total: 11963,       Income Avg: 0.0171469,  Income Total: 0.3429381
Day 2,  TxCount: 22,    WCQ Avg: 575,   WCQ Total: 12657,       Income Avg: 0.01583459, Income Total: 0.34836114
Day 3,  TxCount: 18,    WCQ Avg: 709,   WCQ Total: 12779,       Income Avg: 0.0190894,  Income Total: 0.34360934
Day 4,  TxCount: 20,    WCQ Avg: 685,   WCQ Total: 13707,       Income Avg: 0.01877776, Income Total: 0.37555536
Day 5,  TxCount: 18,    WCQ Avg: 685,   WCQ Total: 12343,       Income Avg: 0.01848049, Income Total: 0.33264889
Day 6,  TxCount: 21,    WCQ Avg: 524,   WCQ Total: 11019,       Income Avg: 0.01391941, Income Total: 0.29230762
Day 7,  TxCount: 18,    WCQ Avg: 743,   WCQ Total: 13386,       Income Avg: 0.02097988, Income Total: 0.37763789
----
Day 8,  TxCount: 27,    WCQ Avg: 619,   WCQ Total: 16738,       Income Avg: 0.01676519, Income Total: 0.4526603
----
Day 9,  TxCount: 37,    WCQ Avg: 412,   WCQ Total: 15255,       Income Avg: 0.01113924, Income Total: 0.41215224
Day 10, TxCount: 39,    WCQ Avg: 403,   WCQ Total: 15729,       Income Avg: 0.01117022, Income Total: 0.43563858
Day 11, TxCount: 41,    WCQ Avg: 282,   WCQ Total: 11573,       Income Avg: 0.00786254, Income Total: 0.32236444
Day 12, TxCount: 40,    WCQ Avg: 312,   WCQ Total: 12510,       Income Avg: 0.00880085, Income Total: 0.35203404
Day 13, TxCount: 34,    WCQ Avg: 228,   WCQ Total: 7776,        Income Avg: 0.00676652, Income Total: 0.23006198

A bit longer timeframe into the past.

BEFORE
Day 362, TxCount: 18,    WCQ Avg: 606,   WCQ Total: 10920,       Income Avg: 0.01608415, Income Total: 0.28951481
Day 363, TxCount: 23,    WCQ Avg: 481,   WCQ Total: 11064,       Income Avg: 0.01301796, Income Total: 0.29941317
Day 364, TxCount: 18,    WCQ Avg: 678,   WCQ Total: 12207,       Income Avg: 0.01801706, Income Total: 0.32430712
Day 365, TxCount: 20,    WCQ Avg: 638,   WCQ Total: 12765,       Income Avg: 0.01803379, Income Total: 0.36067585
Day 1,   TxCount: 20,    WCQ Avg: 598,   WCQ Total: 11963,       Income Avg: 0.0171469,  Income Total: 0.3429381
Day 2,   TxCount: 22,    WCQ Avg: 575,   WCQ Total: 12657,       Income Avg: 0.01583459, Income Total: 0.34836114
Day 3,   TxCount: 18,    WCQ Avg: 709,   WCQ Total: 12779,       Income Avg: 0.0190894,  Income Total: 0.34360934
Day 4,   TxCount: 20,    WCQ Avg: 685,   WCQ Total: 13707,       Income Avg: 0.01877776, Income Total: 0.37555536
Day 5,   TxCount: 18,    WCQ Avg: 685,   WCQ Total: 12343,       Income Avg: 0.01848049, Income Total: 0.33264889
Day 6,   TxCount: 21,    WCQ Avg: 524,   WCQ Total: 11019,       Income Avg: 0.01391941, Income Total: 0.29230762
Day 7,   TxCount: 18,    WCQ Avg: 743,   WCQ Total: 13386,       Income Avg: 0.02097988, Income Total: 0.37763789
----
Day 8,   TxCount: 27,    WCQ Avg: 619,   WCQ Total: 16738,       Income Avg: 0.01676519, Income Total: 0.4526603
----
AFTER
Day 9,   TxCount: 37,    WCQ Avg: 412,   WCQ Total: 15255,       Income Avg: 0.01113924, Income Total: 0.41215224
Day 10,  TxCount: 39,    WCQ Avg: 403,   WCQ Total: 15729,       Income Avg: 0.01117022, Income Total: 0.43563858
Day 11,  TxCount: 41,    WCQ Avg: 282,   WCQ Total: 11573,       Income Avg: 0.00786254, Income Total: 0.32236444
BEFORE
Day 2,  TxCount: 2,     WCQ Avg: 633,   WCQ Total: 1266,        Income Avg: 0.01603843, Income Total: 0.03207687
Day 3,  TxCount: 18,    WCQ Avg: 709,   WCQ Total: 12779,       Income Avg: 0.0190894,  Income Total: 0.34360934
Day 4,  TxCount: 20,    WCQ Avg: 685,   WCQ Total: 13707,       Income Avg: 0.01877776, Income Total: 0.37555536
Day 5,  TxCount: 18,    WCQ Avg: 685,   WCQ Total: 12343,       Income Avg: 0.01848049, Income Total: 0.33264889
Day 6,  TxCount: 21,    WCQ Avg: 524,   WCQ Total: 11019,       Income Avg: 0.01391941, Income Total: 0.29230762
Day 7,  TxCount: 18,    WCQ Avg: 743,   WCQ Total: 13386,       Income Avg: 0.02097988, Income Total: 0.37763789
----
Day 8,  TxCount: 27,    WCQ Avg: 619,   WCQ Total: 16738,       Income Avg: 0.01676519, Income Total: 0.4526603
----
AFTER
Day 9,  TxCount: 37,    WCQ Avg: 412,   WCQ Total: 15255,       Income Avg: 0.01113924, Income Total: 0.41215224
Day 10, TxCount: 39,    WCQ Avg: 403,   WCQ Total: 15729,       Income Avg: 0.01117022, Income Total: 0.43563858
Day 11, TxCount: 41,    WCQ Avg: 282,   WCQ Total: 11573,       Income Avg: 0.00786254, Income Total: 0.32236444

So far, here are the 24h WCQ stats since we took down the timeout to 1h from 2h:

Note, the only thing that matters here is the WCQ Sum, the rest of the stats are just interesting.

BEFORE
Day 3,  TxCount: 18,    WCQ Avg: 709,   WCQ Sum: 12779
Day 4,  TxCount: 19,    WCQ Avg: 678,   WCQ Sum: 12882
Day 5,  TxCount: 18,    WCQ Avg: 685,   WCQ Sum: 12343
Day 6,  TxCount: 21,    WCQ Avg: 524,   WCQ Sum: 11019
Day 7,  TxCount: 18,    WCQ Avg: 743,   WCQ Sum: 13386
----
Day 8,  TxCount: 27,    WCQ Avg: 619,   WCQ Sum: 16738
----
AFTER
Day 9,  TxCount: 37,    WCQ Avg: 412,   WCQ Sum: 15255
Day 10, TxCount: 39,    WCQ Avg: 403,   WCQ Sum: 15729
Day 11, TxCount: 41,    WCQ Avg: 282,   WCQ Sum: 11573

Why?

Because it is a function of two variables where you have a multiplication in the numerator (wqc) and a divisor (t). Then there are two ways to maximize it (get and infinite number):

  1. Letting the time constant, increase the number of participants as much as possible (making wqc bigger) or,
  2. Letting the wqc constant, decrease the interval as much as possible.

Given it is easier to make this wqc/t to grow by decreasing the t close to zero than making the number of participants close to infinite (we control the interval but not the number of participants) is that I said that.

Of course we don’t need to keep one variable constant and the optimal value would be to decrease the interval as close to zero while the number of participants also increases (a dream).

What we don’t know is if those two variables are really independent, i mean, we don’t know if a reduction in the interval can cause a drop in users’ participation, because in that case we should discover the optimal combination of time and wqc.

IMO it doesn’t matter how long we wait for 100 participants, 10 minutes ago there were 79 waiting users and now there are 72 so, two hours, three hours or more hours allow us to increase the “probability” of joining 100 people but decreases the real wqc that Wasabi provides at the end of the day.

This is why I think that if this algorithm works as expected we will see a reduction in the timeouts.


Notes:

What you want to do is known as control theory and your suggested implementation is a variant of the proportional control. In proportional control the next value of the variable (in this case, timeout) is multiplied by a factor, for example: next_time_out = current_time_out * factor. The problem with this is that the algorithm has no memory and then generates vibrations, meaning that the algorithm doesn’t converge in an smooth way to the optimal value. That’s why the bitcoin adjustment algorithm uses the expected number of blocks after two weeks and not simply based on how long it took to mine the latest block.

That’s right - the optimal solution will likely not have the t -> 0. But I have a different concerns.

  1. How do you know you are quantifying the value of a CoinJoin accurately? You could simplify it by simply considering the number of participants, or the sheer volume of the mix. Or you could simplify it to be the fees earned by the coordinator (which is closest to what Adam has right now).

  2. Why do you think you should lower the timeout by 1 minute if the WQC goes up and vice versa? How are these things at all related? This doesn’t seem to have a clear reasoning behind it.

Let me offer another idea entirely - you have 120 minute countdown. Assuming there are 40 participants registered or less, this countdown continues. For every person over 40 that registers, the server subtracts 1 minute from the countdown.

If we have 100 participants, the Coinjoin will happen 1 hour earlier. If we have 70 participants, it will happen 30 minutes earlier and so forth.

I am not sure to understand the last comment so, probably I will say the same that you. I think the idea should be to optimize the anonymity/time (wqc/t). What would be something good because we could provide more anonymity to users by day so, those that keep mixing would speed up the process.

The problem is that easiest way to increase the number is by reducing the timeout closer to zero and that can be done only if we agree on having more coinjoins with less participants.