Tuesday 18 February 2020

How Atomic Swap Technology Is Revolutionizing Cryptocurrency Exchanges


Owing to increasing awareness and changing government perception, the cryptocurrency ecosystem is expanding rapidly. It now boasts hundreds of white-label crypto exchanges with more than 2000 digital coins and a market cap of $142 billion. Most exchanges, however, use a centralized cryptocurrency trading software or system.
Although the number of centralized exchanges (CEXs) far exceeds decentralized (DEX) ones, they are not safe. Centralized crypto exchanges face a constant threat of cyber hacks, unexpected shutdowns, and government seizures. In the first half of 2018 alone, cybercriminals managed to steal $1.1 billion worth of cryptocurrency.
So, is there a better alternative to CEXs?
Enter Atomic Swaps.
This blockchain-based technology has the potential to offer an efficient, secure, and fast peer-to-peer alternative to exchange crypto assets. It promises to provide a fully self-governing cryptosphere that hardcore crypto users have been dreaming of from the beginning.
Read on to know more about Atomic Swaps and their impact on centralized crypto exchanges.

1. How Do Atomic Swaps Work?

Atomic swap involves a peer-to-peer exchange of cryptocurrencies without the need of a crypto exchange. Users have complete control over their digital assets throughout the transfer as there is no third party involved.
There are two types of Atomic Swaps.

a. On-Chain Atomic Swap

It is processed on the respective blockchains of each digital coin. However, both cryptocurrencies need to support HTLC and should have the same cryptographic hashing algorithm.

b. Off-Chain (Cross-Chain) Swap

It takes place off the blockchain via off-chain payment channels that are offshoots of the main blockchain. The two cryptocurrencies also need the Lightning Network, a second layer payment protocol, to complete an off-chain atomic swap. One of the first off-chain atomic swaps took place in September 2017 between Decred and Litecoin.
Here’s how it works –
Atomic Swap uses a smart contract called Hash Time-locked Contract (HTLC) to facilitate the crypto asset transfer. For example, A wants to sell 5 Bitcoins for 10 Ethereum coins from B, who in turn, wants to buy 5 Bitcoins in exchange for 10 Ethereum coins. Both will need to open up a payment channel based on Lightning Network to complete the trade.
Let’s say, person A generates a number only they know to create a cryptographic hash using a HTLC and deposits 5 Bitcoins in it. Here, the cryptographic hash acts as a lock while the number is the key. When B receives the hash created by A, they send the 10 Ethereum coins back using the same cryptographic hash. Now, A unlocks this hash as they already have the key.
Upon receiving the 10 Ethereum coins, A reveals the key to B so that they can obtain the 5 Bitcoins and complete the trade. However, this is a time-bound smart contract. If A fails to provide the key to B, the 10 Ethereum coins will go back to B’s account and the trade will be automatically cancelled.

No comments:

Post a Comment