What are Atomic Swaps?
Atomic Swaps is the process of exchanging Peer-to-Peer cryptocurrencies (P2P) from party to party without going through a third party, which means you are allowed to exchange a currency for someone else without using the exchange. The most special point is that the user will have full control and ownership over their Private Key during the entire swap process. Atomic Swaps can be made directly between separate blockchains with different original currencies or through off-chain channels.
In 2012, EOS and Steemit’s Dan Larimer launched a P2P network called P2PTradeX, also known as the precursor to atomic swapping. The successful Atomic Swap was first made between Bitcoin (BTC) and Litecoin in September 2017, prompting public interest in the cryptocurrency of this new type of technology. Several cryptocurrency-focused startups that have adopted atomic swap technology include Komodo and Lightning Labs.
How does an Atomic Swap solve a trader’s problem?
Atomic swapping has completely eliminated major obstacles, such as the lack of security when trading cryptocurrencies on exchanges. The current method of trading cryptocurrencies requires us to transfer money to centralized exchanges, where there is a lack of economic efficiency, susceptibility to price manipulation, and sometimes human negligence that leads to the loss of money. Atomic swapping is the direct path from the seller to buyer, helping to remove these obstacles and bringing absolute security to the transaction.
Those who doubt this technology will likely talk about decentralized exchanges as a solution. One of them is bisque. While such services also solve some problems, the problem is the need to use intermediary software like this. Such products need to do more to improve the current situation of fewer people using them.
There is another option called “trading right on the Blockchain”, i.e. using several tokens on the same chain or sidechain, etc. such as BitUSD or wBTC but that is still complicated.
Therefore, while the above solutions provide a certain peace of mind for trading, they are still not as effective as atomic swaps. Atomic swapping makes trading simple, direct, and distributed. While the technology is not yet available to mainstream users, the advances introduced by Segwit, Charlie Lee, and others including Komodo show that the technology is getting very close.
How does Atomic Swaps work?
The design of the atomic swap does not allow any party to engage in fraudulent transactions. To understand how they work, try for example Alice wants to exchange her Litecoin (LTC) for Bob’s Bitcoin (BTC).
“First, Alice deposits her LTC money into a contract address, which acts as a safe. When Alice created this safe, she also created a key to open the safe. She then shares a cryptographic hash function of this key with Bob. Note that Bob can’t get the money with LTC yet because he’s only got the hash of the key, not the key itself.
swapping Bob then uses the hash that Alice gives him to create another secure contract address and deposits his BTC-denominated money into it. To get the BTC money from this safe, Alice must use the very key she created, and when she uses this key, it is also simultaneously revealed to Bob (thanks to a special function called the hash lock). This means that as soon as Alice receives the BTC, Bob also receives the LTC and the swap is complete.”
The term “atom” means that these transactions occur in whole or do not occur. If either party gives up or does not perform its part of the work, the contract will be canceled and the money will automatically be returned to the owner.
Atomic swapping can occur on the chain and off-chain. Atomic swaps on the chain are made on one of the two blockchains involved in the transaction (in the example above is the Bitcoin or Litecoin Blockchain). Meanwhile, off-chain atomic swapping is performed on a secondary layer. This type of atomic swap transaction is usually based on two-way payment channels, similar to the channels used in the Lightning Network.
Technically, most trading systems that don’t need to trust each other are based on Smart Contracts using multi-signature and Hash Time Lock Contracts (HTLC).
Advantages of Atomic Swaps
- The main advantages of atomic swapping revolve around its distributed nature. For example, it allows interaction between chains without the need for third parties such as centralized cryptocurrency exchanges.
- Moreover, the distrust of third parties with the right to monitor money, Atomic Swap enhances security for users during transactions.
- P2P trading eliminates or significantly reduces the cost of trading compared to coin trading on the exchange.
- In some cases, an exchange lacks the coin of the trader’s choice, forcing them to make intermediary transactions in order to get the right cryptocurrency. Atomic swapping allows for quick trading of lesser-known altcoins with added interactive features.
Disadvantages of Atomic Swaps
- To perform atomic swaps requires meeting a number of conditions – possibly obstacles that make this technique impossible to apply widely. For example, in order to perform an atomic swap between two cryptocurrencies, these two currencies need to be on a blockchain that shares a hash algorithm (e.g., SHA-256 for Bitcoin). In addition, they also need to be compatible with HTLC and other programming functions.
- From hash compatibility to HTLC, In addition, atomic swaps bring concerns about user privacy. This is because it is possible to quickly track swaps and transactions on the chain, making it possible for followers to link addresses. This problem can be temporarily fixed by using cryptocurrencies that raise privacy issues as a way to reduce the likelihood of disclosure of information. However, many developers are testing a more reliable solution, which is to use digital signatures in atomic swaps.
- Current atomic swaps have not yet been tested with large volumes of data.