Qtum, a blockchain platform that merges the strength of Bitcoin’s blockchain with the Ethereum Virtual Machine to build decentralized applications, has completed its first atomic swap with Bitcoin on mainnet.
This is a big, first step for atomic swaps, a feature that allows for on-chain exchanges, or transactions, between cryptocurrencies on two separate blockchains without the need to rely on a third party. For Bitcoin, this is a big step forward in allowing interoperability between other blockchains and itself in a trustless manner.
Atomic swaps are not an entirely new feature, as Bitcoin Magazine has reported on a Lightning Network ERC-20 swap with bitcoin just a few months ago.
According to Qtum’s blog post, the main solution that makes atomic cross-chain swaps possible is Hash Time-Locked Contracts, or HTLC. In a brief summary, HTLC essentially locks up the funds in a transaction for enough time so that both blockchains are able to confirm the transfer of funds on their own (via block confirmations) and gives both parties time to claim their funds. If enough time passes where one side has not claimed their funds, everything is returned back to the original parties.
The entire process of the atomic swap is described in the blog post as follows:
- 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.