Use an SMT solver to make better CoinJoins #5505
csH7KmCC9
started this conversation in
General & Publications
Replies: 1 comment 1 reply
-
Thank you very much for sharing this. We are currently working on the WabiSabi coinjoin protocol which needs to find the best way to break outputs and it could be good to take a look at this technology too. Ping: @nothingmuch |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
(this is a duplicate of the issue filed for JoinMarket, but reposted here because it is also relevant).
Please see this proof-of-concept. This sets up an example CoinJoin, encodes the CoinJoin constraints into a satisfiability modulo theories problem, and uses PySMT with an off-the-shelf SMT solver e.g. from Microsoft.
The key advantages of this approach are:
Consider the default CoinJoin example from my repo. We have four inputs from three parties, in amounts 1BTC (from the taker who is doing a sweep), 1.3BTC (from the second party), and two inputs totaling 1.4BTC (from the third party). In the current implementation, we might get CoinJoin outputs like (party, amount): [(1, 99997329), (2, 99997329), (3, 99997329), (2, 30002682), (3, 40002676)], which includes two outputs that are uniquely identifiable.
In contrast, here is the solution found by the SMT-based approach: [(1, 99997329), (2, 99997329), (3, 99997329), (2, 9999994), (3, 9999994), (3, 9999994), (2, 20002688), (3, 20002688)], which includes zero outputs that are uniquely identifiable. Of course, subsequent behavior of the maker could reveal the association between outputs, but a similar approach can be taken to use an SMT solver to choose the least-revealing set of UTXOs for a maker to use for a given offer.
Note that this is just a proof-of-concept, and the final implementation probably should not take the extreme of trying to minimize unique outputs at all costs, as the extra outputs primarily cost the taker but give privacy benefits to the makers. Of course there will need to be some protocol tweaks, too, to enable the communication to the taker of more than one change address per maker.
Beta Was this translation helpful? Give feedback.
All reactions