Atomic Swaps
Last updated
Was this helpful?
Last updated
Was this helpful?
An atomic swap allows for exchange of one cryptocurrency for another without the need for a trusted third party.
For example, Alice may send BTC to Bob, while Bob sends LUX to Alice. However, as both blockchains are heterogeneous and transactions can't be undone after block consolidation, this operation introduces the counterparty risk problem - i.e.: Alice or Bob fails to honor their end of the deal.
Atomic swaps between LUX and BTC involve each party paying into a locked account. In the case of LUX, it's a multi-signature account. In the case of BTC, it's an UTXO with a scripted lock.
The creator of Litecoin, Charlie Lee, successfully implemented and demonstrated atomic swaps using LTC in exchange for BTC, Vertcoin and Decred. However, this type of swap only works between the BTC-like chains with similar scripting systems, as well as support for Check Lock Time Verification (CLTV) functionality.
With CLTV support, lock time windows can be set for the refund operation. The initiator sets a 48 hour lock time for participator payment and withdrawal. The participator sets a 24 hour lock time for initiator withdrawal. This time-locked refund scheme guarantees the atomic integrity that any party can withdraw their funds completely when the other party quits the swap process.
Because LX and the Lux Protocol don't have the BTC-like scripting system, they use a multi-signature account to lock LUX the initiator pays to the participator, and CLTV scripting to lock the BTC the participator pays to the initiator.
One drawback of this mechanism is the fact that the multi-signature method cannot implement a recovery and refund process, and LX resolves this with a requested deposit to incentivize and guarantee the trade's integrity.
Atomic Swaps Atomic Liquidity