What Are Atomic Swaps and Why They Matter
What is an Atomic Swap?
Atomic swaps are smart contract technology which uses cryptography to enable two parties to exchange different cryptocurrencies/tokens without the risk of one party backing out on the trade. These cross-chain swaps or trades are a nearly instantaneous exchange of one cryptocurrency to another which does not need a middleman or third party to mediate or supervise the transaction.
There are few popular atomic swaps that have occurred so far. On September 20, 2017, Decred completed an atomic swap between Decred and Litecoin. A few days later, the world’s first atomic swap had successfully been completed between Bitcoin and Litecoin.
— Charlie Lee [LTC⚡] (@SatoshiLite) September 20, 2017
In computer programming, an atomic swap represents a unitary action or object that cannot be divided, changed or reduced in any way. What this means is that either the trade will be finished in full or canceled both parties will have their coins restituted.
The initial concept of the swap was first proposed in May of 2013 by community member TierNolan, in a Bitcontalk thread. Seeing as blockchain technologies increased both in terms of adoption and popularity, there is a growing need for such a technological innovation.
There have been many discussion regarding the implementation of atomic swaps with the Lightning Network, which would greatly improve the speed of the Bitcoin network and lower network costs.
What Use Do Atomic Swaps Have?
Cryptocurrency transactions cannot be reversed, meaning that the only way currently available to safely transfer one coin to another is by using a third party provider that can ensure that both parties get the desired coin.
That’s why currently most traders use centralized exchanges that have a solid reputation to convert their coins. However, this creates further issues. Exchanges get their bread and butter by subtracting fees for their offered services. Depending on the exchange, the fees can be quite small (or none), but the larger and more established ones, charge for higher fees and 4% for a credit card on top the coin’s price. These fees add up over time and can take a large portion out of what you should have got for your coin.
Also, exchanges are centralized. Even though there are many decentralized exchanges gaining popularity, none of them have actually achieved mainstream status yet. These centralized exchanges are ironically the opposite of what cryptos were actually created for in the first place: to remove centralization. Anything that is centralized is susceptible to attack.
How It Works
The exact mechanism of this technology has not yet been explicitly made available, but it is known that in theory it can be made possible. By generating a hash time-locked-contract, multi-signature address and time lock safely seal the transaction at a decided price.
The link between two coins that are to be transacted would be a secret code. The transaction will only follow through once the same code has been inputted and the correct number of respective coins have been sent.
If one party does not send the exact amount of currency or does not enter the code, the transaction will not execute, and each party will have their coins returned. This will essentially eliminate the need for an intermediary party.
What’s the Current Status?
Additionally Litecoin’s swap with Bitcoin, there have been several other coins which have announced they too have successfully carried out atomic swaps between Vertcoin and Komodo and Decred to Bitcoin. Litecoin seems to be the most dedicated of coins when it comes to adopting atomic swaps, but for now, the technology is still in its early development stages.
There are also certain limits of on-chain atomic swaps such as:
- Both coins must use the same hash algorithm.
- Both coins should support time lock contracts.
- A degree of programming knowledge is needed.
As atomic swaps currently require to have both networks completely synced, this can be quite a problem for the average user. In the case of bigger blockchains such as Bitcoin, this is a major issue. The Komodo team has been trying to resolve this issue by using the Electrum server. This could possibly enable users to interact with the blockchain without having to download the full chain.
That is why solutions like off-chain atomic swaps which run on Lightning networks are also being tested and developed for mainstream implementation. The off-chain atomic swaps will hopefully overcome all the trials and restrictions that are posed by on-chain atomic swaps.
That being said, most projects have been very secretive regarding how they actually expect atomic swaps to become common.
But in spite of these impediments, the future is looking bright for this technology with many exciting developments. It will be interesting to see how the mainstream will adopt atomic swaps and what services it will change or generate.