Unot of the main objectives of the cryptocurrencies is to offer tools that protect our privacy, and in the midst of pursuing that goal, CoinSwap stands as a useful tool to achieve it.
And is that CoinSwap, is a protocol that seeks to provide the ability to obfuscate and hide information about cryptocurrency transactions that are carried out in your chain of blocks. And with this it seeks to offer a level of privacy and anonymity that exceeds that of tools such as the coinjo.
CoinSwap, a protocol designed to facilitate decentralized exchanges
CoinSwap is a cryptocurrency exchange protocol designed with the aim of creating a cryptocurrency exchange platform in a decentralized way. The idea behind CoinSwap closely resembles the atomic swap or atomic swaps that allow on-chain exchanges quickly and without custody. However, CoinSwap is much simpler and more flexible than swap atomics and therefore emerges as a much easier working solution to develop.
The design and initial idea of CoinSwap was born in 2013, when Greg Maxwell, recognized Bitcoin Developer presents on the Bitcointalk forum his topic: CoinSwap: Transaction graph disjoint trustless trading (CoinSwap: disjoint transaction graph for trustless trading).
At that time, Maxwell's idea was to create a cryptocurrency exchange protocol that could be applied to Bitcoin without the need to alter its current protocol. In this sense, Maxwell took ideas from coin mixers and P2PTradeX by Sergio Dan Larimer, to create a new secure, non-custodial and above all private exchange system, CoinSwap was born.
As a result of Maxwell's work, CoinSwap was transformed into a protocol that enabled decentralized cross-coin P2P trading. This means for example that someone can use CoinSwap to exchange their Bitcoin by Bitcoin Cash, without any intermediary, without using a DEX, using only their wallets with CoinSwap support.
However, despite the enormous usefulness of this idea, there is still no working implementation of CoinSwap at present. In fact, it was only in 2020 when Chris Belcher, presented what would be the first complete technical implementation of this system.
How does CoinSwap work?
CoinSwap basically works around two users looking to exchange their cryptocurrencies, performing cryptocurrency operations within their respective blockchains. To make this exchange a reality, CoinSwap makes use of schemes multi-signatures of the 2-of-2 type. This means that the exchange participants must cryptographically sign the transaction for it to take place, and once this is done, neither party can manipulate the transaction alone.
Additionally, during the transaction process CoinSwap allows the two users to exchange their cryptocurrencies, without a third party being able to establish a relationship between the parties involved in the exchange. And the best, without this meriting changes in the Bitcoin protocol for this process to take place.
For example, María and Luis can exchange their cryptocurrencies using CoinSwap. Maria wants to mix 10 BTC and Luis wants to mix the equivalent in BTC as well. When Maria and Luis create a CoinSwap operation, they must both create a 2-of-2 multi-signature address where the funds in question will be arranged.
However, in the interest of improving anonymity, CoinSwap transactions will be done in several stages. So the following would happen:
As we can see, the exchange of the 10 BTC between María and Luis has been carried out in 6 total operations. In these operations, it can be seen that Maria sent 10 BTC to an address, and from there 10 BTC reached Luis. On the other hand, Luis's 10 BTC reaches María in 5 different operations that add up to the exchange's 10 BTC, complicating the way of establishing a relationship between María and Luis, due to the participation of the intermediate CoinSwap address.
However What tools make all this possible? Well, let's get to know the basic elements, which make the operation of CoinSwap possible.
ECDSA-2P, a signature algorithm with privacy in mind
An important point in the operation of CoinSwap is given by the multi-signature addresses that are created by the parties involved in the exchange. Two things depend on these addresses:
- The security and decentralization of the process, to prevent a bad actor from seeking to misappropriate the funds.
- The privacy of the process, by showing that the address in question is any address.
This is where ECDSA-2P or two-part ECDSA comes into play. This signature algorithm is used to create 2 out of 2 multiple signature addresses that look the same as regular single signature addresses. In fact, ECDSA-2P allows musig addresses to be even legacy or P2PKH addresses (those that start with 1). This has a great impact on privacy since the bulk of Bitcoin addresses are under this format, which would make its analysis much more complex.
ECDSA-2P qualifies in what we know as threshold signatures (Threshold Signature) of the bipartite type, which is closely related to the Shamir scheme of secrets (SSS). This system was proposed by Yehuda Lindell from Bar-Ilan University, and was proposed thanks to a powerful characteristics of the same: the resulting signatures are verifiable using the original algorithm and without modifications of ECDSA, and all this, because an ECDSA-2P signature is identical and just as valid as an ECDSA signature.
This feature is what allows CoinSwap multisig addresses to be unique: they can perfectly pass through any address and transaction, without any heuristic or cryptographic relationship between the parties involved in their creation. Simply put, a CoinSwap ECDSA-2P address cannot be related in any way to any of its creators, being perfectly private.
Another important point in the operation of CoinSwap, according to Belcher's implementation, is that it seeks to exploit the best of one of its creations: JoinMarket. The idea is simple, create a liquidity market for CoinSwap and that said market serves to add a greater layer of usability, privacy and anonymity to the final result of operations.
With this, anyone can start a CoinSwap without having to previously enter into an agreement with another person. It only makes the request for the CoinSwap and this liquidity market responds to the request by offering an exchange or exchanges in favor of the amount that the applicant wishes to exchange.