El protocol CoinJoin, is a protocol implemented for improve the privacy and anonymity of the users of Bitcoin. This method consists of being able to unify in a same set all the transactions that will be carried out by different users of the system. Thus, once all these transactions were unified, no user could determine where the funds come from; since the entrances and exits of said transactions cannot be seen or associated. Thus, even the recipient of a transaction cannot tell where he received the transferred funds.
The implementation of this method is particularly useful to avoid tracking the funds received or payments made in the Bitcoin system. Especially if we take care of our privacy and remember that Although Bitcoin is private, it is not anonymous.. This means that it is possible to trace Bitcoin transactions to the point of finding your identity. It is certainly not an easy task, but transaction analysis and digital profiles allow this type of construction, however difficult it may seem. It's getting easier and easier to do, and Bitcoin transactions never disappear, nor will they disappear, with all their bindings done.
For that reason, and to increase privacy, CoinJoin was designed. Now let's know how CoinJoin works, what options it offers us and its capabilities and limitations (which it also has).
The concept was introduced by the developer Gregory Maxwell, who in August 2013 made a publication in your account BitcoinTalk, where he explained in detail the development and operation of his idea, also highlighting that it does not imply a modification in the Bitcoin protocol.
The need for these types of solutions stemmed from the search for a more protected privacy within Bitcoin. Let's remember that Bitcoin is not a truly anonymous cryptocurrency, but a pseudo anonymous. This means that each of the transactions we carry out appears completely transparent on the blockchain.
But not only that, but it is also possible to create a complete profile of the addresses we use. Including from which addresses we receive money or to which addresses we send, specifying amounts in each of them. Of course, in each of these transactions there is never data such as names or that directly identifies us as users.
But if hackers and analysts like something, it's the challenges. Bitcoin's privacy challenge led these groups to create specialized tools to study this data and relate it to any other online activity we have. As a result, they collect our data on the blockchain and on the Internet, create a profile and if we are not careful enough, they can very safely find our real identities.
This is how several blockchain analysis companies manage to find the identity of many cryptocurrency users, and this is how privacy and the pseudo-anonymity of Bitcoin are reduced to nothing.
Against this background, the creation of CoinJoin was shown as a satisfactory response. This is because if used correctly this tool makes it practically impossible to track Bitcoin users. In addition, the creation of CoinJoin was technically superior to that of the mixer coin, another option that was already used at the time. The reason is that CoinJoin acted as a P2P protocol while mixer coins were centralized, given to scams and other looting.
How does CoinJoin work?
Firstly, to carry out a CoinJoin transaction it is necessary for several network users to make the decision to use this method. That is, everyone agrees on merge transactions to make a single grouped and joint transaction. That is, without other people (or rather, addresses with funds) wanting to mix with you, you cannot use CoinJoin.
However, this does not mean that by grouping all transactions into one, you are in some way giving up control over the transactions to a specific party. No, rather it is the opposite. In Bitcoin CoinJoin transactions the signatures of each transaction remain independent of each other. This regardless of the number of transactions that are grouped within a CoinJoin transaction.
Then, each user will have particular control over their inputs and outputs and will sign an operation only if they agree with the transaction and if it is correct. And until all participating users within a CoinJoin transaction sign, the transaction will not take place.
Now, once all users sign each particular transaction, they will be grouped into the same CoinJoin transaction, which will be processed and validated by the miners to include it within the blockchain. Where it will be reflected as a single and joint transaction, which does not clearly show where the funds came from or where they were sent.
Understanding how CoinJoin works
Now to understand exactly how CoinJoin works it is best to see it through an example. So we have the following case:
Suppose Maria wants to transfer 1 BTC from address A to address B. While Juan wants to transfer 1 BTC from address C to address D. To make this transaction private, they both decide to use CoinJoin for the purposes of combining their transfers in a single transaction that has two inputs (A and C) and two outputs (B and D).
What CoinJoin does in all this is to take the inputs of Maria and Juan, combine them in the same transaction, and from them, mix these currencies to generate the transactions that will go to their destination. If the operation requires the refund of an exchange, the CoinJoin transaction will also create this transaction and send it to an exchange address under the control of the person to whom those currencies belong. The CoinJoin payment operation will only be carried out when María and Pedro cryptographically sign their respective transactions.
However, the trick CoinJoin does shows all its power on the blockchain. Normally, Maria and Juan's transactions would show a clear pattern of sending coins. That is, the coins go from their address to the destination address. But in CoinJoin we can see a single transaction where multiple inputs are joined and there are several outputs.
This makes it more difficult for a third party to determine which recipient received which output. Even, the receiver of the transaction could not determine from which address the funds received come, because the UTXOs are not directly related to an address itself, but to a transaction of multiple entries, all of them independent.
From this example we can deduce the following:
- CoinJoin uses the scheme of the UTXO or unspent Bitcoin coins, to generate with them a massive scheme of entries for the same transaction. Of course, these UTXOs come from the balance available to each of the people who participate in the CoinJoin scheme, so the more people participate the greater the level of anonymity achieved.
- By taking all the UTXOs of the people in the CoinJoin as inputs, a mixing of coins from these UTXOs is generated.
- The payment of the CoinJoin will be carried out once all the people sign the joint transaction and agree with the balances that it presents.
- Finally CoinJoin will make the payment. Depending on the implementation, CoinJoin can make various payments to other intermediate addresses that will also create an additional CoinJoin. A measure that seeks to increase the level of security of the transaction. But eventually, the CoinJoin will bring Maria and Juan's payment balance to their recipients. In the blockchain we will see a single transaction, multiple outputs and nothing that relates them to each other. We have made an anonymous transaction.
Why is CoinJoin important in Bitcoin?
Bitcoin is a system decentralized and autonomous that offers a certain degree of privacy in transactions. Since instead of requesting personal data as in traditional systems, Bitcoin uses only addresses, which work as a type of bank account where you can receive money without any risk. However, Bitcoin is also a system transparent and auditable, which means that in a blockchain explorer You can freely observe the transactions carried out in this system from its beginnings in 2009 to the present.
Thus, even if personal data is not disclosed, any third party could follow certain addresses to see how the funds move or are managed in it. Determining the transactional activity of a user within the network. Remember that, although Bitcoin does not use personal data of a user, it is possible to associate a particular address with a person or company.
For example, if that person or company has openly published that it is the owner of a particular address, or if the IP addresses from where various transactions have been made are monitored and followed up. This is why Bitcoin is known as a pseudo anonymous systemIn other words, it offers partial anonymity to its users.
This feature makes it possible, in Bitcoin, to mark / label certain currencies as “corrupt or contaminated”. If, by following up, they are found to have been involved in fraudulent money laundering or financing of illegal activities. What also subtracts the quality of fungibility to cryptocurrency; that is, its ability to be consumable and expendable. Since many users of the network will not want to use those cryptocurrencies that have been branded as “contaminated” because they are linked to illegal activities. So one bitcoin is no longer the same as another bitcoin.
That is why the implementation of the CoinJoin method offers a viable solution alternative for these privacy problems of the Bitcoin system. By preventing transactions made on the network from being tracked by third parties or linked to certain activities.
As we mentioned at the beginning, CoinJoin was initially implemented on the Bitcoin blockchain in order to improve your privacy and anonymity. However, to date there are several implementations of this method, the most common and widely used being Samourai Wallet, Wasabi wallet y JoinMarket.
La Samourai Wallet It is oriented towards the protection and guarantee of privacy of users. So it implements the CoinJoin method through the interface of Whirlpool to mix and match the inputs and outputs of transactions from the same user, to make them appear to come from a CoinJoin transaction. This wallet is available for both computers and smartphones that operate with the Android system. Additional, we have a complete guide on how to use Samurai Wallet and its Whirlpool so you can get the most out of CoinJoin.
For its part, Wasabi wallet use the service of Chaumian CoinJoin and the network protocol Tor to mix transactions and guarantee maximum privacy to its users. Making transactions virtually impossible to track, as well as the public IPs used. Both wallets handle commission rates for using these privacy and anonymity services.
Likewise, the implementation of the software JoinMarket de CoinJoin also seeks to improve privacy and anonymity in Bitcoin transactions. Allowing users to buy, at a very low fee, a place within a CoinJoin transaction, as if it were a market. In fact, JoinMarket It operates as a market for Bitcoin transactions.
In summary, the implementation of CoinJoin has turned out to be a very effective and efficient method to ensure privacy and anonymity in the Bitcoin network. But like any method, it requires massive use to guarantee anonymity in all existing bitcoin coins to date. The greater the number of users that implement CoinJoin, the greater the number of private bitcoins.
Curiosities about CoinJoin
At this point it is important to highlight some curiosities about CoinJoin born from questions and concerns of Bitcoin users. Among them we can mention:
CoinJoin and the myth of absolute anonymity
CoinJoin does not guarantee 100% anonymity. This is because data analysis, blockchain behavior, even network data interception can still be done for the analysis of a target under investigation that uses Bitcoin. So the myth that CoinJoin guarantees 100% privacy is false. It certainly improves it on a level not seen in Bitcoin without this protocol, but complete anonymity is not guaranteed in any way.
The cost of a CoinJoin transaction is much higher than that of a common Bitcoin transaction. This is because CoinJoin performs “mix jumps” that are nothing more than additional cryptocurrency transactions between CoinJoin participants. Each of these jumps generates a new transaction that in turn has an associated mining fee. In total, the more mining jumps the greater the anonymity achieved but the higher the cost of the final CoinJoin transaction will have.