Matchpool Adds Atomic Swap to its ArsenalWhat exactly is an atomic swap?Atomic swaps, or atomic cross-chain trading, is the exchange of one cryptocurrency for another cryptocurrency, without the need to trust a third-party.
A relatively new technology, atomic cross-chain trading aims to revolutionize the way in which users transact with each other. For example, let’s say Alice owns 1 Qtum but would like 1 Guppy instead. She’ll have to make an exchange, right? Well, with atomic swap, if Bob owned 1 Guppy but wanted 1 Qtum instead, he and Alice would be able to simply make a trade!
And in order to create trust and prevent all sorts of problems like one-way trades (Alice accepting Bob’s 1 Guppy but then failing to send over her 1 Qtum), atomic swap utilizes what is known as hash time-locked contracts (HTLCs) — genius really.
What’s this useful for?Over the last few years we’ve seen a large number of decentralized exchanges (DEX). The main purpose of these exchanges was to exclude the third party from the trading (p2p trading without a broker), a purpose that wasn’t really achieved mainly because of the inability to quickly execute trades outside of the blockchain it was built upon.
The recent blockchain hype has led to a surge in currency prices. The overall market for cryptographic currencies this week surpassed $700 billion. Such an increase in market cap is always accompanied by the high volatility of the currencies, and such volatility requires traders to be able to execute cross-chain transactions immediately, which is not fully possible on DEX today.Those limitations have resulted in very poor adoption and limited trading volume on DEX platforms.
Atomic swaps are the future P2P exchanges fieldThe main advantage of the atomic swap in the P2P exchanges field is that from now on, traders in DEX can trade coins from other chains and actually “lock” the price of a currency traded on another network immediately, thereby being less exposed to the risk of coin volatility, making them a real P2P exchange. By providing P2P exchanges to users and traders, liquidity is guaranteed and never relies upon a central exchange . We remove the middleman and begin exchanging P2P, decentralized, just as it should be with cryptocurrencies.
The last few months have been very exciting for atomic swap and its impact on the blockchain community. Companies like Komodo, Litecoin, Vertcoin and Decred have all successfully implemented atomic swaps, and many of us can say that Charlie Lee’s announcement of the Litecoin/Bitcoin atomic swap is one of the most important developments in the cryptocurrency world.
Matchpool has developed the implementation of GenericSwap, which will be the first contract to offer an exchange of Qtum, Ethereum and ERC20-based tokens across Ethereum and Qtum chains. This is a a groundbreaking step on the way to P2P exchange and this step may lead to another huge win if we can influence other companies to make an effort and develop open source solutions for the community.
Now for some Technicalities.Atomic swaps involve each party paying into a contract transaction, one contract for each blockchain. The contracts contain an output that is spendable by either party, but the rules required for redemption are different for each party involved.
Hash time-locked contracts (HTLC)Hash time-locked contracts (HTLC) ensure that the atomic swap process is completely trustworthy by ensuring both parties fulfill the requirements of the trade.
HTLCs require the recipient to acknowledge receiving the payment ahead of a predefined deadline by generating cryptographic proof of payment. By failing to do so, the recipient risks losing the right to claim the payment and the sender is entitled to receive back the funds.
To implement a HTLC on a transaction to occur between two different blockchains, it is necessary for both blockchains to share the same cryptographic hash function, such as SHA-256.
Now, let’s go back to Alice and BobAlice owns 1 Qtum and she just heard about Matchpool and Guppy so she wants to sell her 1 Qtum in exchange for 1 Guppy. We also have Bob who owns 1 Guppy and wants 1 Qtum instead.
https://blog.matchpool.com/matchpool-adds-atomic-swap-to-its-arsenal-6b5e06128b2c