Blockchain 101: Cross-Chain Atomic Swaps

People have been working on the concept of peer-to-peer cryptocurrency exchange or a trustless exchange since the beginning of blockchain and cryptocurrency. Sergio Demian Lerner first created the first draft of the trustless exchange protocol back in 2012.

At the time, though, the concept did not gain much popularity. The real turning point was when Tier Nolan launched a first detailed description of atomic swaps in May 2013 and explained how it works. That’s why, even when Lerner was the first draft, Nolan is known as the Atomic Swaps creator.

Keep that in mind, until September 2017, all this was a theory. It was the time between Litecoin and Decred that the first Atomic Swap took place. Today, a number of startups and decentralized exchanges allow their users to use Atomic swaps to exchange cryptocurrencies, including Lighting Labs, Altcoin.io, Komodo, and 0x.

Why Do We Need Atomic Swap?

It’s a question a lot of crypto traders ask: Why do we need Atomic Swap when a centralized exchange system is working perfectly fine.

Well, here is the reason.

Security

No one wants to lose their money, do they?

The problem with centralized exchanges or even centralized systems is that they can be hacked. Which means, the uninsured parties become vulnerable to losing their money.

Amongst the most popular hacking cases in the crypto world is when Bitfloor, an old-time Bitcoin exchange was hacked in 2012 when cybercriminals were able to get hold of the unencrypted keys that were kept online for backup systems. At that time, the amount stolen was “small,” i.e. a total loss of BTC 24,000.

Atomic Swaps give you the chance to exchange coins and cryptocurrencies in a decentralized setting that is cheaper and trustless.

And the best part about it: Unlike in crypto exchanges, you don’t provide any your private information or go through an authentication process so you can keep your identity confidential.Hackers will not be able to access your private information and steal your Bitcoin.

Unregulated System

Regulations are a bummer. Right?

One of cryptocurrency’s most key features is its decentralized, unregulated nature: the advantages of holding the value that is beyond control and regulation by the government.

In the world where governments are trying to control the flow of blockchains, one of the most vital issues which Atomic Swaps addresses directly influences the friction to the regulation of the cryptocurrency industry.

In addition to that, Atomic Swap provides an efficient solution to the integration issue between different currencies and digital assets. Atomic Swap is the very first step in connecting distinct coins and cryptocurrencies and allowing autonomous trading.

Seems great, right?

There’s more.

Fast Transactions

Everyone wants blockchain systems and crypto trades to be fast.

But here’s a bad thing about crypto exchanges. For a transaction to be cleared for trading, centralized exchanges involve up to 50 confirmations.

You simply trade out of your wallet instantly with Atomic Swaps. While getting your fresh exchanged token straight from them, no transferring your assets anywhere else but the real recipient. Incredibly fast buying and selling with wallet-to-wallet.

Understanding the concept of Atomic Swap

You may be wondering right now, how does an exchange system work without centralization? How does atomic swap keep the transaction secure between the parties?

Don’t worry we have answers for you right here.

In order to secure the exchange and the process, both parties share a secret that they must provide throughout the process whenever necessary. Since the secret is known only to the parties involved, no third party can access the cryptocurrency or become part of the exchange.

It’s like an old spy intelligence system. Both of the parties know a single code. Unless the secret codes both these parties share are not same, the access to the cryptocurrencies are not granted.

The actual process is much more complicated. Bear with me while I briefly take you through it.

How does Atomic Swap Work?

Atomic swaps work as a transaction from Lightning Network using a Hashed Timelock Contract (HTLC) that protects both parties ‘ interests in the transaction. This special smart contract uses a multi-signature transaction system which holds funds from both parties until the swap succeeds.

The hashlock uses a cryptographic algorithm that allows access to its digital asset only once both sign off their transactions. You can compare the timelock with an insurance policy that ensures that both traders are returning their funds if the trade fails within a given timeframe.

Types of Atomic Swaps

Ok, I know you might have heard of On-chain, Off-chain atomic swap concepts over the industry.

Here’s everything explained about it.

On-Chain Atomic Swap

As the name suggests, the On-Chain atomic swaps inside either currency’s blockchain and is much similar to regular transactions, without, of course, a centralized authority controlling your transactions.

However, there are some requirements for an On-chain Atomic Swap.

  • Both digital currencies should always support HTLC system.
  • Both digital currencies should share a similar hashing algorithm.

There are currently a number of cryptocurrency coins capable of using Atomic swaps. In theory, this can be done by any coin forked from the Bitcoin code base.

Off-Chain Atomic Swaps

In contrast, Off-Chain atomic swaps direct the crypto exchanges and trades outside the domains of blockchain.

This type of transactions is conducted on Lightning Network and are instantaneously completed. The process involves the two parties to deposit their funds in a multi-signature address which can only be accessed once both parties agree.

While transactions, the record of the deposited funds is distributed between the parties that guarantees the payments once the exchange channel closes.

In fact, the first Atomic Swap between Bitcoin and Litecoin was conducted on an Off-Chain channel.

Which One is Better – On-chain Atomic Swaps vs Off-chain Atomic Swaps?

There are certain perks of both approaches in swapping. Let me go through all of them briefly.

Since On-Chain Atomic Swaps take place over the blockchain, they acquire normal transaction fees speed of a blockchain. But the biggest perk about this approach is a bit of transparency in a completely trustless system. This, essentially, deems the approach well-suited for trades with bigger crypto volume.

On the other hand, Off-Chain Atomic Swaps are instantaneous and cheap. As explained before, the entire process takes place on Lightning Network. Once activated, the network immediately transfers the assets between the parties and costs extremely low as compared to centralized organizations.

So, it all comes down to personal preference when choosing what kind of atomic swap to use for your cryptocurrency transactions.

Leave a Reply