Moving cryptocurrencies between blockchains
As the realm of cryptocurrencies and blockchain technology is rapidly evolving with ever-increasing numbers of tokens, real-life use cases and functionalities, the actual interoperability between blockchains is still a cumbersome endeavour.
Limitations of many blockchains extend past the issue of scalability. Different use cases for blockchains mean different needs and standards in terms of network architecture and technology in a fractured blockchain space. This fragmentation prevents streamlining and hinders further development, while exposing blockchains to security vulnerabilities and ultimately slowing down adoption and the industry as a whole.
The case for swapping cryptocurrencies
All things considered, if you currently want to swap cryptocurrencies, it is a cumbersome endeavor. In any case, you need to log in to a cryptocurrency exchange, where the first issue may arise regarding the two cryptocurrencies you want to swap. Cryptocurrencies have fixed trading pairs which means that the pair of cryptocurrencies you want to trade against each other may not be available. Exchanges only have limited offers available. Preset combinations provided by the exchange of your choice mean that you, as a user, either have to live with the situation or opt for inconvenience through swapping across multiple currencies on various exchanges. There is also the potential for exchange downtimes and volume loss on top of barriers. This is where atomic swaps come in.
The basics of atomic swaps
Atomic swaps, also known as atomic cross-chain trading, offer a way to swap cryptocurrencies peer-to-peer from different blockchains directly without the requirement for a third party, such as an exchange.
Obviously such a swap has to take place in a set time frame, which - in Bitcoin - is ensured by a special type of smart contract called Hashed Timelock Contract (HTLC). A HTLC has an inbuilt timer ensures that the transaction is completed within the set timeframe. If the transaction is not executed within this time frame, it is automatically cancelled.
There are two types of atomic swaps: on-chain swaps between two different cryptocurrencies on two seperate blockchains, and off-chain swaps on second-layer channels off a main blockchain, such as the Lightning Network.
Since payments on the Lightning Network don’t require block confirmations or compete for space within blocks, they are convenient to use in environments where instant transaction speed is a high priority, such as in retail. They also help to pave the way of instant micropayments in the expanding space of internet-connected devices.