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

Increase the default makercount to more than 8~10 #1047

Closed
BitcoinWukong opened this issue Oct 16, 2021 · 20 comments
Closed

Increase the default makercount to more than 8~10 #1047

BitcoinWukong opened this issue Oct 16, 2021 · 20 comments

Comments

@BitcoinWukong
Copy link
Contributor

BitcoinWukong commented Oct 16, 2021

The current default maker count is a random number between 8~10, this doesn't provide very good privacy protection as the anonymity set is very small, especially when we comparing this number to what other CoinJoin wallet does: Samurai, Wasabi, etc., they all have a much higher CoinJoin counter party count.

To mitigate this problem, JoinMarket had introduced the Tumbler mechanism, which is confusing to the new comers and makes it much harder for them to understand how to effectively make use of JoinMarket.

IIRC, the reason we had only 8~10 as the default number of coinjoin at JoinMarket, was because that there wasn't enough makers to provide the liquidity. But from what I can see, the situation is very different today.

At this moment, I can see 437 orders provided by 305 counterparties on the JoinMarket Orderbook, and there are 53 fidelity bonds found with 415.62868225 BTC total locked up. And the majority of these orders are only asking for 0.001% ~ 0.003% of maker fee for CoinJoin.

Base on these stats, I think it makes sense to increase the default maker count:

  1. It saves on-chain space by reducing the number of transactions you need in your Tumbler script. Maybe 2~3 tumbler transactions would be good enough instead of 5.
  2. It provides a much broader anonymity set, especially that with the introduction of Fidelity Bond, there is a good chance that even if you use the Tumbler to CoinJoin 5 times, you may end up Coin Join with the same top 8~10 counter parties.
  3. The user can immediately spend their Bitcoin without waiting for the Tumbler script, which can take hours if they want to maximize their privacy.

The ideal situation IMHO would be that we increase it to a number that is high enough where the Tumbler mechanism is no longer needed, like 50~100. But that number may still be too high to be used right now as there are only 53 fidelity bonds locked up.

My suggestion is that we can increase the default maker count to something like a random number between 20~30. In this case, even if a user only did a single CoinJoin when they need to spent their Bitcoin sooner, they would still get a pretty decent anonymity set to protect their privacy.

Any thoughts please?

Thanks!

@PulpCattel
Copy link
Member

The current default maker count is a random number between 8~10, this doesn't provide very good privacy protection as the anonymity set is very small, especially when we comparing this number to what other CoinJoin wallet does: Samurai, Wasabi, etc., they all have a much higher CoinJoin counter party count.

Samourai coinjoin implementation has 5 equal outputs.

To mitigate this problem, JoinMarket had introduced the Tumbler mechanism

I'm not sure this is true, in the sense that remixing is simply the only way to have strong privacy guarantees with CoinJoin, even Wasabi that has an average # of participants around 60-70 heavily uses and encourage remixes. I.e, the tumbler will be needed regardless, especially by average users that most likely cannot outperform it.

IIRC, the reason we had only 8~10 as the default number of coinjoin at JoinMarket, was because that there wasn't enough makers to provide the liquidity. But from what I can see, the situation is very different today.

The main reason is IRC servers limitation.

The user can immediately spend their Bitcoin without waiting for the Tumbler script, which can take hours if they want to maximize their privacy.

If he wants strong privacy, he'll have to wait, and it can take days, not just hours. The same happens in any other CoinJoin implementation. This is, I think, important to note, because it's important not to be misleading in what is being proposed to users.

The ideal situation IMHO would be that we increase it to a number that is high enough where the Tumbler mechanism is no longer needed, like 50~100. But that number may still be too high to be used right now as there are only 53 fidelity bonds locked up.

As said above, I don't think there's a reason to remove the tumbler, nor I think remixing with it become unneeded just because we have a lot of counterparties.
Also, 50-100 seems pretty tough to achieve, remember that in JoinMarket the taker pays it all, it's not like the other implementations where the cost is shared across multiple participants. With a default like that, average user will pay enough miner fee to have nothing left to mix.
There may still be scenario where we resurrect the tx fee contribution by makers, which on their side should be happy if taker wants to pick many of them, and could therefore be incentivized to help the taker with a little bit of fee. Though, it seems kinda pie in the sky to me at the moment.
Even a lower number, like 20-30, still exposes the same problem, takers will have to pay huge amount of fee to have such transactions mined.

I'd love to see big CoinJoin becoming viable, hopefully by moving away from IRC, but I'm not sure we can make such the default. It may be better keeping the default at e.g., 10-12 and having the possibilities for whoever wants to to make much bigger CoinJoin.

@kristapsk
Copy link
Member

As @PulpCattel said, we are limited by IRC servers limitations, how much data we can send beween peers in limited amount of time.

See also - #415.

@AdamISZ
Copy link
Member

AdamISZ commented Oct 16, 2021

I also agree with the general flow of @PulpCattel 's response. If we get something following from #415 then we can discuss how/to what extent to move to larger single tx anon sets; as it is even 10-15 is pretty hard.

I hope this motivates people to either help out with #1000 or make serious efforts towards another alternative :)

@BitcoinWukong
Copy link
Contributor Author

BitcoinWukong commented Oct 16, 2021

Got it, thank you all so much for your inputs, I did not aware that IRC server limitation was the root cause.
Looks like #1000 is a prerequisite for increasing the default maker count.

Even a lower number, like 20-30, still exposes the same problem, takers will have to pay huge amount of fee to have such transactions mined.

So each input would increase the transaction size by 67 vBytes, and each output would increase the transaction size by 31 vBytes. If adding one maker would introduce 2 inputs and 2 outputs on average, we're talking about 67*2 + 31 * 2 = 196 bytes. When the mempool is empty and that 1sat/vB can be mined, having 20~30 makers instead of 10 would increase the fee by 2000 ~ 4000 sats, still acceptable.

If the mempool is full, when you need to pay 5 ~ 8 sat/vB, the additional fee cost would increase to 10k sats ~ 32k sats. It would be too high to coinjoin 100k sats with such a high fee. But if I'm trying to mix 100M sats, I wouldn't mind paying 10k~30k sats more to double / triple the anonymity set.

We can also prioritize the tx_fee_contribution and the cj_fee over fidelity bond when the amount to be mixed is small, but less focus on the fee but mostly on the fidelity bond value when the amount to be mixed is large, as usually the more coin you're trying to mix, the more protection you'd want.

@AdamISZ
Copy link
Member

AdamISZ commented Oct 16, 2021

On that aspect, the idea that we could end with too large a fee burden on takers, a couple of points to note:

  • txfee contrib is already folded in to overall fee; it's kind of a leftover from the first versions of the protocol and so doesn't matter too much. Takers are always judging on cjfee minus txfee contrib.
  • I don't think this will end up too relevant, but, bear in mind, there is a kind of 'hack' in which makers can offer at negative fee (don't try this at home, but i did try it on a 2018ish version of JM and it worked .. it may not, still, work and anyway i wouldn't recommend trying).

All this just brings up the fact that our fundamentally 1-to-many asymmetric design makes very large anon sets be quite different from other cj protocols.

Edit: but otoh I do totally agree that for large-ish coinjoin amounts, even with a completely unchanged model, anon sets much larger than 10 are perfectly viable. In particular, note that a tumbler of 10 txs is just like having say 80-100 size single join, more or less, from the cost point of view. What's much more open to discussion is whether it's better. Consider amount correlation for example.

@BitcoinWukong
Copy link
Contributor Author

If he wants strong privacy, he'll have to wait, and it can take days, not just hours. The same happens in any other CoinJoin implementation. This is, I think, important to note, because it's important not to be misleading in what is being proposed to users.

Could you elaborate a bit more on this point, why this is the case? Say I'm trying to pay Jack 100k sats, I CoinJoin 100k sats and let one of the output arrive in his wallet directly in that CoinJoin tx, what would be the problem here?

Personally, when I CoinJoin as a taker myself, 8~10 counter parties doesn't make me feel safe enough, and that's the main reason I use Tumbler to CoinJoin multiple times. I would feel much safer if the anonymity set is much larger.

I'm not saying that we should get rid of the Tumbler, but I'd prefer to reserve the Tumbler mechanism as a more advanced mechanism that maybe hidden in some advanced settings and only present that to users who knows a lot more about JoinMarket. When I first opened up JoinMarket, the whole thing about Tumbler feels very daunting as I had no idea what that is and why I would need it.

@BitcoinWukong
Copy link
Contributor Author

In particular, note that a tumbler of 10 txs is just like having say 80-100 size single join, more or less, from the cost point of view.

Yes! That's what I was trying to say. And especially with the introduction of Fidelity Bond, there is a higher chance that the taker would re-mix with the same makers multiple times in the following CoinJoin transactions, that might not necessarily be better than having one CoinJoin tx with like 50 other counter parties.

@chris-belcher
Copy link
Contributor

Note that with just a single coinjoin it can be pretty easy to unmix a join based on what the coinjoin outputs later do. The maker's coinjoin outputs will almost certainly be spent as inputs into other coinjoins, but the taker's output will be spent in some other non-coinjoin way (perhaps consolidated and then batched if it was sent to a merchant, or remain unspent for years if sent to cold storage). Repeated coinjoins are also very important to break this effect.

@PulpCattel
Copy link
Member

PulpCattel commented Oct 16, 2021

When the mempool is empty and that 1sat/vB can be mined, having 20~30 makers instead of 10 would increase the fee by 2000 ~ 4000 sats, still acceptable.
If the mempool is full, when you need to pay 5 ~ 8 sat/vB, the additional fee cost would increase to 10k sats ~ 32k sats. It would be too high to coinjoin 100k sats with such a high fee.

5-8 sat/vB is an empty mempool :), in your calc I'd substitute 5-8 sat/vb as the empty case and 50-80 sat/vb as the full case (not that 80 is a ceiling at all, we have seen much more than that ofc).

It would be too high to coinjoin 100k sats with such a high fee. But if I'm trying to mix 100M sats, I wouldn't mind paying 10k~30k sats more to double / triple the anonymity set.

I'm curious, why do you consider 5-8 sat/vb "such an high fee"? If Bitcoin and its incentive structure work, we should assume much higher fee rate going forward.
It's 10-30k extra sats per CoinJoin in the best case scenario, this is a significant overhead for a big range of amounts.
It's a fine personal choice, but I personally wouldn't dare making it the default, it seems too easy for a user to shoot himself in the foot and pay hundreds of dollar equivalent for a single CoinJoin only in miner fee. It would be a great RTFM lesson though, so maybe not so bad.

as usually the more coin you're trying to mix, the more protection you'd want.

The Edward Snowden of the situation may not have a lot of money to hide, but he may still want as good of a privacy/security as he can get. The more coin, the more possibilities, that's for sure, but not necessarily wanting more privacy.

In particular, note that a tumbler of 10 txs is just like having say 80-100 size single join, more or less, from the cost point of view. What's much more open to discussion is whether it's better. Consider amount correlation for example.

@AdamISZ Yeah, that's the crux, I'm on the camp of 10 txs with 10 people each over time, we can see it as a kinda defense in depth concept, where we want no single point of failures and multiple layers of defense.

Could you elaborate a bit more on this point, why this is the case? Say I'm trying to pay Jack 100k sats, I CoinJoin 100k sats and let one of the output arrive in his wallet directly in that CoinJoin tx, what would be the problem here?

There have been a lot of previous discussion on this topic, the more recent are in e.g., #864, #948
One simple example is, in the worst case you have no privacy against Jack. Because he knows that you are doing a JoinMarket transaction and he can figure out which inputs belongs to the taker by doing math, now Jack knows your inputs and he can follow your history back, maybe leveraging his own metadata (maybe you gave him a physical delivery address, or you email, etc.), all that would be defeated by remixing, because he would then only see inputs coming from previous mixes.

When I first opened up JoinMarket, the whole thing about Tumbler feels very daunting as I had no idea what that is and why I would need it.

That's what the documentation is for, but also, can't we fix that with a better and cleaner UI? I mean, do you think it's inherent to the tumbler being too complex?

@BitcoinWukong
Copy link
Contributor Author

BitcoinWukong commented Oct 16, 2021

@AdamISZ Yeah, that's the crux, I'm on the camp of 10 txs with 10 people each over time, we can see it as a kinda defense in depth concept, where we want no single point of failures and multiple layers of defense.

I guess my other question is, when a user is doing a Tumbler schedule, should we consider avoiding taking the offer from the same maker in the subsequent CoinJoin mixes?

The Edward Snowden of the situation may not have a lot of money to hide, but he may still want as good of a privacy/security as he can get.

Yes, that's true. But for smaller amount of Bitcoin, I think it makes much more sense to use Lightning to protect your privacy. And when you have a large enough amount, that you want to save it to your cold storage; or when you want to pay a big amount to someone else, where the amount is too large to use your Lightning wallet, that's when CoinJoin shines.

If we want everybody to CoinJoin to improve their privacy, there is no way for everybody to CoinJoin their every small transaction on-chain due to limited block space. The way I see it, is that everybody has to batch their transactions via lightning (or Liquid, or whatever), and occasionally do a large on-chain transaction with CoinJoin to protect their on-chain privacy. When the transaction amount is large enough, the on-chain fee would be much smaller percentage-wise and can easily be justified.

If Bitcoin and its incentive structure work, we should assume much higher fee rate going forward.

If the fee is 50 ~ 80 sats/vB, even if you only CoinJoin with 8 other makers, the total transaction would be 196vb / maker * 8 maker * 80sats / vB = 125440 sats. You still wouldn't be able to CoinJoin 100k sats, and that'll be 12% of a 1M sats coinjoin. And if the fee is 5~8 sats / vB, the difference between 8 other makers and 24 other makers, is 196 vb / maker * (24 - 8)makers * 8 sats / vB = 25088 sats, which is only 2.5% of a 1M sats coinjoin.

My point is, when the on-chain fee is very high, lowering the number of counter parties would still incur a very high on-chain fee and may only worth doing it when you CoinJoin a large amount anyway. But when the on-chain fee is low, increasing the number of counter parties doesn't increase the on-chain fee that much comparing to the benefit of doubling / tripling / quadrupling the anonymity set.

It's a fine personal choice, but I personally wouldn't dare making it the default, it seems too easy for a user to shoot himself in the foot and pay hundreds of dollar equivalent for a single CoinJoin only in miner fee.

Yes, regarding that, I think a more fine approach here is to take into the account of both the amount of BTC being CoinJoined, as well as the on-chain fee you're paying as a taker. I think having a default cap fee of say 0.5% ~ 1% could be considered to protect the user from shooting himself in the foot.

For example, if the default settings of target makers is 25, and the default cap fee is 0.5%, and I'm trying to CoinJoin 10M sats (which is very common on JoinMarket), if the fee is lower than 50k, it'll be acceptable.

Otherwise, we give the user a warning and asking the user double check and confirm if they wants to proceed forward, and also provide the option of lowering the counterparties as a way to lower the fee.

Or, if we find that by having 25 makers, the fee would be over 0.5%, we could lower the default value of counter parties to maybe 8 ~ 10 as it is today?

Nevertheless, if the CoinJoin amount is too small, and the on-chain fee is very high, like 50 ~ 80 sats / vB as you mentioned above, even with 8 ~ 10 makers the fee would still be too high to justify CoinJoin 100k or sometimes even 1M sats.

That's what the documentation is for, but also, can't we fix that with a better and cleaner UI? I mean, do you think it's inherent to the tumbler being too complex?

Yes. That's my point.

It's already not so easy to understand the concept of CoinJoin, adding Tumbler on top of that makes the whole thing much more difficult to understand. For sure, Tumbler would increase your privacy, and may be more effective than simply increasing the counter parties count. But if the user is only doing one CoinJoin, either due to not having the time to wait, or due to not understanding the concept of Tumbling, having more counter parties is still a net positive from the privacy's perspective.

@PulpCattel
Copy link
Member

PulpCattel commented Oct 16, 2021

I guess we could summarize as: the default cost of JoinMarket can already be high, especially if someone is not a bit careful, and there are indeed warnings across the relevant doc files about miner fee and tumbler costs, so I think increasing it 3-4-5-etc times more, when not strictly needed, is not necessarily a win and quite a danger for user.
But I love big CoinJoin, so if this turns out not to be a problem, or to be solvable, that's great.

Yes. That's my point.

Interesting, it doesn't have to be a complex concept, no? Once one grasps what a CoinJoin is, the idea of chaining multiple ones in a row should be reasonable to follow.

But if the user is only doing one CoinJoin, either due to not having the time to wait, or due to not understanding the concept of Tumbling, having more counter parties is still a net positive from the privacy's perspective.

Yeah, the idea here would be that the user could choose a higher number of counter parties when desired, and by doing so we can assume it is a more conscious decision.
The idea of increasing counter parties whenever possible/feasible could clearly be promoted as a best practice.

@PulpCattel
Copy link
Member

the defaut maker fee dropped alot since previous versions by factor 10 at least.

Fidelity bonds should make those go right back up, at least in theory.
But anyway, the miner fee alone can be a lot, and they sum up.

that's affordable and worth it

Paying 0.002% of the CoinJoin amount per maker is definitely affordable/worth it, it's in fact ~ free. Bitcoin block space is not as generous as JM makers though, and, as said above, maybe we can't count on charitable makers either going forward.

@kristapsk
Copy link
Member

kristapsk commented Oct 19, 2021

Just idea - how about some kind of dynamic default maker count choosing, depending on cj amount and current fee environment? This is actually something I have done manually when sending small amount as a taker, I often reduce maker count on command line manually, so that transaction (using coinjoin) makes sense economically to me.

@kristapsk
Copy link
Member

the defaut maker fee dropped alot since previous versions by factor 10 at least.

I still think default maker fee is currently unfairly cheap, IMHO should be increased to 0.003%, which is Wasabi default per anonymity set.

@PulpCattel
Copy link
Member

how about some kind of dynamic default maker count choosing

That sounds cool, a few questions that come to mind related to implementation complexity:

  • How would we handle the tumbler? Its schedule is generally created ahead of time, when we don't know the mempool status yet. What default would we propose here?
  • How would we handle the QT? Currently in the single join page, we have the number of participants auto-filled with the default, if we constantly update this value, user will see it changing under his nose while/after typing his own, OTOH, if we don't update it, if the user let the QT run for a bit before doing CoinJoin, the fee may have spiked in the meanwhile. Maybe some warning/pop-up/user-input-detection/etc. could solve this easily, not sure about the details.

@AdamISZ
Copy link
Member

AdamISZ commented Oct 19, 2021

About unfairly cheap:

0.00002 x 10 counterparties x 10 transactions in a tumble is still only 0.2% so I think i agree. Only for very large coin amounts does that not get overwhelmed by network fees.

However I am not a fan of fussing over these defaults too much; the market will figure it out.

@BitcoinWukong
Copy link
Contributor Author

How would we handle the QT?

We add a new label next to the text field, provide a "suggested maker count", base on "the cj amount and current fee environment". Also a button next to that label, which is "use suggested maker count", if the user click that button, the text field will be replaced by the "suggested maker count".

This way, we dynamically update that "suggested maker count" without replacing what the user has already entered in the text field.

However I am not a fan of fussing over these defaults too much; the market will figure it out.

What do you think about this "suggested value" idea? That way we don't mess around with the default value, but also provide a better suggestion base on the cj amount and the fee environment.

For the cli interface, we can also provide a suggested value, but we may not continously update that value dynamically as we can do with the QT interface.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants
@AdamISZ @kristapsk @chris-belcher @PulpCattel @BitcoinWukong and others