Token Swaps and Atomic Swaps Explained
This post teaches you about token swaps and atomic swaps.
What is a token swap?
Token swaps are when a cryptocurrency moves from a host blockchain to their own blockchain and convert their host blockchain tokens into their own coins. An example would be an Ethereum ERC20 token like the Icon Token (ICX) moving to its own blockchain, and converting their ERC20 tokens into ICX blockchain coins.
To accomplish this, Icon users must send their ICX ERC20 tokens to a certain address and in return are expected to receive a 1:1 ratio of ICX coins for their ICX ERC20 tokens. Big exchanges like Binance will usually administer this conversion so users do not have to worry. However, If you keep your cryptocurrencies on independent wallets, you will have to follow (easy) instructions given out by the respective cryptocurrency team that is having a token swap.
Because they use the same word, some people may confuse token swaps with atomic swaps. The definition of atomic swaps can be broken down into two parts. Swap – an act of exchanging one thing for another and Atomic – an operation that consists of a series of actions that either all or none occur. Together, you have an all or nothing exchange, or an atomic swap.
In relation to cryptocurrency, peers can now exchange two different cryptocurrencies without worrying that another peer isn’t going to fulfill their end of the exchange. If the other peer does not fulfill their share of the trade, the exchange will not occur, and all cryptocurrencies will be refunded to users. Before atomic swaps, one user and to send their cryptocurrency first, and trust that the other user was going to pay them back in the agreed amount of a different cryptocurrency. With atomic swaps, no trust is involved and users can exchange different cryptocurrencies.
How does it work?
Atomic swaps use Hash Time-Locked Contracts that ensure that if both parties do not fulfill their end of the contract given a certain amount of time, the contract will expire and refund users. For example, if Adam and Bill want to trade Bitcoin for Litecoin, Adam could send 1 Bitcoin with a time and password protected contract, and Bill could use that password to send Adam 100 Litecoin. If Adam sends the 1 Bitcoin but Bill never sends the 100 Litecoin, the contract would expire and refund Adam the 1 Bitcoin. The transaction is atomic in the sense that either both parties receive their ends of the transaction or nothing happens at all.
Atomic Swap Implications
The main implication with decentralized atomic swaps is that if a vendor accepts a certain cryptocurrency that enables atomic swaps, they could therefor indirectly accept other cryptocurrencies. For example, if a vendor accepted Litecoin, and Litecoin adopted atomic swapping with Bitcoin, that vendor would indirectly be able to accept Bitcoin without a middle man.
Problem with Atomic Swaps
The problem with atomic swaps is that users must have their cryptocurrency networks synchronized, which means that both users would have to download the entirety of each other’s blockchain. For bigger cryptocurrencies, this could be a problem. Additionally, the average user may not have the technical prowess to set up the code behind an atomic swap. We expect future innovation to ease the synchronization and user experience process.