# Does coinjoin provide better privacy than coinswap?

In July 2020 one Twitter user shared a zcash transaction id which had shielded addresses however another user was able to get the transparent address from it. This was possible because t-z conversion was mentioned in tweet and user found one such transaction in last few blocks

Later user suggested a solution about gap in such transactions.

Zooko considers all swaps bad for privacy. Assuming this is true, how does it affect Bitcoin in different swaps and does it make coinjoin better than coinswap in terms of privacy?

What Zooko meant is that, if you have X coins in transparent, use a shielded address, and then convert them back to transparent, it's easy to link those two transactions because the amount of both is X.

However both Coinjoins and Coinswaps try to make amount correlation hard to effectively break input-output linkage.

In Coinjoins usually input and output amounts are equal, or the number of inputs and outputs would need to be sufficiently large so that there are different possible interpretations. In Coinswaps several unrelated transactions are used, which makes it hard to link them all together.

``````CoinJoin (3 participants)      CoinSwap (2 participants)

A(0.5) -|-> B(0.5)             Tx1 A(0.2) --> B(0.2) | B receives 0.5
|                      Tx2 A(0.3) --> B(0.3) |
B(0.5) -|-> C(0.5)             -----------------------
|                      Tx3 B(0.1) --> A(0.1) | A receives 0.5
C(0.5) -|-> A(0.5)             Tx4 B(0.4) --> A(0.4) |

``````

The biggest difference between them is that Coinjoins are easy to identify, especially if they are equal amount, while Coinswap transactions may look like usual unrelated transactions. The anonymity set of a Coinjoin is all the users of it, while the anonymity set of a Coinswap is all regular transactions (at least the ones using the same address type). It's easier to target Coinjoin users because of this, and some exchanges have already rejected coinjoined coins.

In summary, Coinjoin effectively breaks the transaction graph and has been tested. Coinswap could allow to break such graph while also being hard to detect, but it's a relatively new technique.