There is great competition in the cryptocurrency space. What used to mainly be dominated by Bitcoin is now challenged by a range of other cryptocurrencies and ecosystems. Although they differ in a range of ways, one thing that they share is a difficulty to interact with another blockchain.
How does one swap one cryptocurrency for another?
That is where cross chain atomic swaps come in. This would greatly improve the health of the entire ecosystem as people are able to easily swap their tokens and coins for other coins. This feature will be rolled out by the much anticipated lightning network.
A Closer Look at Atomic Swaps
Atomic swaps are also called Atomic cross-chain trading and will allow the exchange of coins without the need for a centralised third party. Currently, the only way for someone to exchange their coins for another is through a centralised exchange.
Cryptocurrency exchanges can be risky as one has to rely on the trust of that centralised third party. There have been examples of exchanges that have gone bust and the tokens on them have vanished too. Things would be much simpler if you were able to transact in a decentralised manner across blockchains.
This is where the atomic swaps come in. If you would like to swap your Ethereum for Bitcoin, you could merely do it directly with a Bitcoin owner. They are also not a new concept and have been around from at least 2013. Yet, development of the functionality is only now beginning to show actual results with the lightning network.
You may be asking how one can trust that the exchange will take place?
This is through something called a Hashed Time Locked Contracts (HTLCs). These are essentially a form of smart contract where the recipient of a payment will have to acknowledge receipt of the funds before a certain deadline. This will be done through a cryptographic proof of payment.
If the recipient does not acknowledge that the payment has gone through then they could forego the opportunity to receive it. HTLCs can also be used for a number of other purposes as it could act as a certain “trigger” for certain coded conditions. They could, for example, be used to make conditional Bitcoin payments for a certain transaction.
In the case of the Atomic Swap, each party to the swap will submit transactions to their individual blockchains. In our example, the ETH user will submit the transaction to the Ethereum blockchain and the BTC user will do the same on the Bitcoin blockchain. Once implemented, the recipient can only claim their tokens if they reveal a cryptographic hash.
Atomic swaps will effectively allow a user to open up a payment channel between two chains that acts as a transaction processor. This would mean that they could effectively swap coins that they do not actually own yet as long as they have means to be able to purchase them
Where are We Now?
Atomic swaps are only now becoming a realistic proposal as a number of different blockchains have implemented the lightning network. This acts as a cross chain payment channel that links the two chains. This has taken some time because the lightning network does indeed require complicated coding from the ground up.
Apart from both having the lightning network set up on, both chains have to have the same hashing functions. This could be SHA 256 in the case of Bitcoin. This is a requirement for the HTLCs to be able to effectively “communicate”.
Currently, there are a number of Altcoins that are able to make use of Atomic swaps. In theory, any coin that is forked from the Bitcoin code base is capable of this. For example, we recently saw the first swap between Litecoin and Bitcoin. This was also done with Vertcoin and Decred.
There was also the news that a Bitcoin cash developer had also completed a similar Atomic swap with Bitcoin. This will allow people to make trust less Bitcoin cash payments. Yet, the developer noted that the commands and compilation of the software may be a bit advanced for average users. He aims to develop a more user friendly interface.
Looking to the Future
There is no doubt that as cryptocurrency adoption increases, so will the demand for cross chain transactions. Particular crypotcurrencies will be incentivised to implement atomic swap functionality or face the possibility of being left behind by competing coins.
One of the main motivations behind crytpocurrencies was the decentralised nature of blockchains. Centralized Altcoin exchanges has indeed been an antithesis to that. With Atomic swaps, decentralised trading will become a reality.
Images via Fotolia