The Bitcoin protocol consists of transactions which are all public on the blockchain. This means that anyone can easily see which addresses sent bitcoins to which addresses. It is all transparent in the Bitcoin world. This was threating to the privacy of users. So, CoinJoin was introduced. Now, what is CoinJoin?
CoinJoin was proposed in 2013 by Bitcoin core and Blockstream developer Gregory Maxwell. It is a privacy solution for Bitcoins. It merges different Bitcoin payments from different payors into a single transaction. This makes it tough for the outside parties to find out with payor paid which receipt or recipient. The CoinJoin transactions don’t require any adjustment to the Bitcoin protocol. It protects the privacy of Bitcoin users. This is also known as Coin Mixing.
Doing transactions with Bitcoin is secure but not anonymous. Every Bitcoin transaction is recorded in a ledger known as blockchain. The blockchain records information like addresses of the user and their balances. This blockchain is publicly available. CoinJoin complicates the trail of Bitcoins by breaking the assumption that all input addresses belong to the same user. It allows different users to merge all inputs and outputs from different transactions into a single, big transaction. This big, single transaction sends Bitcoins from different addresses to different addresses. As none of the sending address sends none of the receiving address, no link is formed between any of the transaction.
If a user wants to use CoinJoin for his Bitcoin transaction, he will have to find out another user who wants to mix coins. They both will have to start a joint transaction together. This allows multiple users to combine inputs and outputs from different transactions into one transaction. There is no definite way to match the inputs with the outputs. The key feature of CoinJoin is that once the transaction is broadcasted on to the blockchain, there is no method to determine which Bitcoin went where. Even the recipient doesn’t know from which address they are being paid.
The simplest method to initiate a CoinJoin transaction is through a dedicated server. Any user willing to use CoinJoin will have to connect to the server to specify which inputs and outputs the transaction should include. Then, the server will create a big, combined transaction and send it back to all the users to sign. The problem with the server-based model is that whoever controls the server will have access to all the data provided by the individual user. There are chances of single-point failure.
Moreover, there are decentralized CoinJoin solutions available too. This allows users to create a CoinJoin transaction peer-to-peer, without any central intermediary. Nowadays, many different digital tools, such as JoinMarket, Dark Wallet, and SharedCoins, use CoinJoin to allow anonymous transactions. They allow an extra level of data masking for users making transactions through Bitcoins.