Qtum has recently completed its first atomic swap with Bitcoin on mainnet. Qtum is a blockchain platform that combines the power of Bitcoin’s blockchain with the Ethereum Virtual Machine to produce decentralized applications.
The completion is a major first step for atomic swaps. This is also a huge leap forward for Bitcoin as it enables interoperability between other Blockchains and itself, executed in a trustless fashion. Atomic swap is functionality that lets on-chain exchanges (or transactions), between digital currencies on two different Blockchains without having to depend on a third party.
Atomic swaps are not exactly a new feature since a Lightning Network ERC-20 swap with Bitcoin has already been completed just a few months ago.
In a blog post, Qtum states that Hash Time-Locked Contracts (HTLC) is the primary solution that allows atomic cross-chain swaps. Basically, HTLC locks up funds in a transaction giving both Blockchains enough time to confirm the fund transfer on their own (through block confirmations), at the same time providing both parties time to claim their respective funds. In the event that enough time is provided and one party is still not able to claim their funds, everything is restored to the original parties.
The blog post also outlines the whole atomic swap process, describing:
- Alice initiates a transaction on Qtum which contains a time-locked contract and transfers QTUM to Bob.
- Bob audits the transaction.
- If the transaction is approved, Bob participates in a similar transaction on Bitcoin which pays BTC to Alice.
- Alice audits the transaction.
- If the transaction is approved, Alice redeems BTC from it.
- Bob extracts a secret from the redeeming transaction.
- Bob redeems QTUM from the initial transaction.
- If the time specified in the time lock is reached and Bob has not redeemed the token, Alice can refund the token.
Qtum has accomplished remarkable progress in terms of Blockchain development meant for wider adoption and interoperability during the last year. And atomic swaps are merely the next phase. In addition, they are also an important, next-step feature for interoperability with the Lightning Network.
Atomic swaps have the capacity to solve a major issue in digital currencies. This is the inability to directly exchange two different types of cryptocurrencies with each other without the help of a trusted third party such as an exchange or company.
For instance, user A wants to purchase a digital collectible from user B. However, both users have no chance to trade in person. If user A wants to send funds to user B for a collectible, user B can easily receive the funds but not send user A the collectible. At the same time, the opposite can happen, where user B sends user A the collectible first, but user A never sends the money in return.
The issue in this example is the element of trust. When trust is an issue in exchanging things online, it poses more risks. As previously described in this article, atomic swaps are a solution to this issue because they allow money to be exchanged between parties without the need to rely on anything other than mathematics in ensuring the smooth completion of the process.