An Atomic Swap is a cross-chain trade.

This basically means that it is the exchanging of one currency to another without the use of a third party.

Why do we need this?

At the moment we need to trust a third party to handle this kind of an exchange. Some examples of companies that provide this service are Shapeshift and Changelly. Changelly requires verification for exchanges while Shapeshift does not.

Often though, these exchanges can get expensive. I recall helping out a Reddit user in January to Exchange Bitcoin for XRP, and the fees charged were astronomical. This is not entirely the fault of Shapeshift, as fees, in general, were quite high, however, the added markup percentage on that really took the fee to a ridiculous level.

The other issue with using a third-party is the fact that it’s a third-party. If you are unaware as to why we don’t really like to involve third parties to the world of cryptocurrency, I would recommend you read the Bitcoin Whitepaper by Satoshi Nakamoto. This will give you a better understanding as to why we are here today, discussing cryptocurrencies in the first place. Essentially, we do not want to trust a third-party because a third party can be dishonest and using a third-party always adds to the cost of a transaction.

What is an Atomic Swap?

An Atomic Swap is an exchange of one currency to another without the need to trust a third-party. This fairly new technology allows users to exchange currencies with each other by using an HTLC. An HTLC is a Hash TIme Locked Contract.

To give an example, If I had 0.5 BTC but wanted to exchange it for 5 LTC, and a user, let’s call him Jeff, had 5 LTC and was in the market to exchange it for BTC, we could trade our coins by using an Atomic Swap.

The HTLC ensures that the whole process is totally trustless by requiring the recipient of a payment to acknowledge receiving the payment by a predetermined deadline by generating a cryptographic proof of payment. If this is not done, the funds are returned to the sender.

So for a transaction to take place between myself and Jeff, we must each submit our payment to our blockchains. In order for me to claim the LTC, I need to produce a number that only I know, which was used to generate a cryptographic hash, which therefore provides a proof of payment, and Jeff must also provide the same number to claim his BTC.

What is required to perform an Atomic Swap?

Two of the most important requirements, which some may consider limitations are currently that the Lightning Network needs to be implemented on both blockchains involved, and the second is that both blockchains are required to share the same cryptographic hash function, for example, SHA-256.

The lightning network allows the linking of payment channels and the need for both blockchains to share the same cryptographic basis is a requirement to ensure that the HTLC functions properly.

When can we all do Atomic Swaps?

Well, this is perhaps a more difficult question to answer, so let’s look at whats currently happening.

Charlie Lee has successfully used Atomic Swaps to exchange Litecoin to Bitcoin, Decred, and Vertcoin.

There is, however, one issue which makes it quite impractical for the average user. To perform an Atomic Swap, each user needs to download an entire copy of their blockchain. This is hardly ideal for a quick exchange that needs to be performed in a hurry!

There is hope though, Komodo who are building a decentralized exchange managed to complete an atomic swap using an Electrum server.  This is a great solution as an Electrum server allows users to interact with a currency without having to download the entire blockchain, saving time, data and making Atomic Swaps far more practical.

Conclusion

We aren’t quite there yet, but Atomic Swaps are poised to take the crypto-world by storm once they can be easily implemented and used by novice users. Until then, however, we’ll just have to keep paying the fees and trusting others with our money and data.

This is an incredibly exciting area of interest for me and is definitely something to keep watching as the technology and ideas around it develops!

 

What do you think about Atomic Swaps? Do you think they present a great future or is it over-hyped?
Comment your thoughts below or via the social media buttons!