Atomic Swaps: What you need to know about decentralized trading


In 2008 the world witness a global financial crisis, considered by many economists as the worst financial crisis since the Great Depression of the 1930s. As people lost their faith in the banking and financial institutions, one person in particular saw this disastrous event as a golden opportunity. That person was Satoshi Nakamoto, the creator of Bitcoin. Beloved by many, Bitcoin was the first decentralized cryptocurrency and allowed people to send and save money without having to rely on centralized institutions.

So far so good. The only thing is that people seem to have forgotten, or never really understood, the principle behind Bitcoin. Bitcoin was meant to cut the middlemen, to give people control over their own money. So it’s perplexing how so many of us go against the original intention of Bitcoin and entrust our decentralized money to exchanges and other third party services. In order to keep the decentralization movement going, let’s look at some of the ways we can keep our trading decentralized.

Decentralized Exchanges

In decentralized exchanges trading occurs directly between users (peer-to-peer), eliminating the need to hold funds for the customers. Decentralized exchanges also do not require identifying information from users, providing a greater level of privacy and anonymity (transactions are harder to track and collect taxes from). In order to achieve this, decentralized exchanges servers have no central location but are instead comprised of a network of nodes similar to Bitcoin. Having no central server, problems like server downtime or hacks are avoided. Although they offer many advantages, they are are not as easy to use as centralized exchanges.

Atomic Swaps

Atomic swaps, or atomic cross-chain trading, is a relatively new technology that allows instant trades between cryptocurrencies without requiring third party involvement. First described by Tier Nolan in 2013, atomic swaps utilizes what is known as hash time-locked contracts (HTLCs). But how does it work?

Let’s picture the following scenario. I am a proud holder of 1 Bitcoin but wish to acquire 100 Litecoins and am willing to trade my Bitcoin for them. You, on the other hand, want the exact opposite and have 100 Litecoins in your possession. We would like to trade but we don’t really know each other that well so, we use atomic swaps. We both send each other coins in their respective blockchains, I send you my Bitcoin and you send me your Litecoins. But for you to be able to claim the Bitcoin as yours, you have to reveal a secret number on the blockchain that only you know. Only then will you receive the Bitcoin, and with that number you revealed, I am able to claim my Litecoins.

However, as good as it sounds, atomic swaps require linked payment channels between the blockchains of the currencies that are being traded. This is done through the Lightning Network, a scaling solution originally intended for Bitcoin. As atomic swaps effectively link blockchains, the lightning network links payment channels. However, in order for the blockchains to be linked through the lightning network,  they must share the same hashing algorithm. So Bitcoin, for example, can only be linked with altcoins that have the SHA-256 algorithm, such as Litecoin or Zcash.

The technology looks promising but it is still in its early stages of implementation. Charlie Lee, the founder of Litecoin, seems to be on the forefront of atomic swap technology and recently claimed to have successfully traded Litecoin for Bitcoin through atomic swaps. Just a few days after this claim, the Komodo team seem to have been able to complete an atomic swap using only an Electrum server. This is important because before this atomic swaps required the download of both blockchains of the cryptocurrencies being traded.

As more and more projects are looking for ways to implement and perfect atomic swap technology, we can expect decentralized exchanges to also adopt it. Let’s hope we can bring everyone in and take back control of our own money, just like the missing Bitcoin creator intended to.