Powered by

 Gemini Logo

Sign in

Cryptopedia. Your trusted source for all things crypto.

Buy crypto

Topics

View all

Powered by

 Gemini Logo

Sign in

Buy crypto

Atomic Swaps: Permissionless Crypto Trades

Atomic swaps represent the peer-to-peer (P2P) process of swapping cryptocurrency across different blockchain networks without an intermediary like a crypto exchange.

By Cryptopedia Staff

Updated December 3, 20213 min read

Atomic Swaps- The Next Frontier of Decentralized CryptoTrading-100

Summary

Although centralized cryptocurrency exchanges continue to dominate the digital asset market, decentralized exchange alternatives are providing an increasingly wide array of utility for advanced crypto traders. The next step towards totally decentralized digital asset trading is atomic swaps, which eschew exchange intermediaries entirely.

Centralized Crypto Exchanges

Centralized crypto exchanges (CEXs) like Gemini, Huobi, or Kucoin are the core trading institutions of the digital asset class. CEXs deliver a trading experience that emulates and improves upon trading platforms for conventional assets like stocks and commodities. In the context of cryptocurrency and digital assets, these platforms are considered “centralized” because they are custodial, meaning they are responsible for managing deposited funds and wallets. Just as banks manage access to trading accounts, centralized crypto exchanges manage access to user private keys. These keys function similarly to debit card PINs, granting access to user accounts at all times.

On a CEX, it is the role of the exchange to provide asset liquidity, manage trading pairs and order books, ensure fair market prices, and connect buyers and sellers with instant trading. While centralized exchanges are crucial to adopting digital assets, many advanced crypto operators prefer to maintain a greater degree of autonomy in keeping with the hardline decentralized ethos of crypto. Decentralized exchanges (DEXs) seek to embody this perspective by integrating trading capabilities with non-custodial infrastructure.

Decentralized Crypto Exchanges

Decentralized exchanges allow investors to trade digital assets without utilizing an exchange-based wallet. Instead, users can trade crypto directly from their non-custodial wallet — which means only they hold the private keys. However, different DEX platforms utilize different trading mechanisms to achieve this overall dynamic. DEX structures and features are continually evolving. 

Order Books

Since the earliest DEX iterations, many emerging platforms have come to rely on order books, a staple of conventional markets long before the rise of decentralized finance (DeFi). These DEX platforms organize buy and sell orders to improve liquidity through order matching. As a result, practically anyone can trade a specific digital asset as long as there’s adequate demand and supply. Popular order book DEXs include IDEX, Radar Relay, and Bitfinex.

Automated Market Makers (AMM)

Although DEX platforms have experienced substantial growth, inadequate liquidity remains a challenge. Due to the fragmented nature of these markets, sufficient trading volume remains a hurdle to broader adoption — especially in comparison to centralized alternatives. This hurdle is what automated market makers (AMMs) aim to overcome. In contrast to order book DEXs, AMMs like UniSwap and SushiSwap operate via liquidity pools that utilize an algorithm to determine trading pair liquidity and resulting market prices. In short, market pricing via AMMs results from an algorithm, not an order book.

What Are Atomic Swaps?

Despite the improving functionality of DEX platforms, many experts contend that atomic swaps present a path towards even greater decentralization. First introduced in 2013, atomic swaps represent the peer-to-peer (P2P) process of swapping cryptocurrency across different blockchain networks without an intermediary like a crypto exchange. Since then, Litecoin founder Charlie Lee successfully exchanged litecoin (LTC) and bitcoin (BTC) via atomic swap in 2017, and platforms like Komodo have reportedly facilitated atomic swaps across 95% of all cryptocurrencies.

How Do Atomic Swaps Work?

Using atomic swap protocols, traders maintain control of their cryptocurrency at every step of the exchange process. Further, users pay only standard blockchain fees, like ETH gas fees for example, without a third-party provider or any fees associated with an exchange platform.

Hashed Timeclock Contracts (HTLCs)

In the simplest terms, an atomic swap occurs when two parties decide on what’s called a shared secret — the exchange of a specified amount of cryptocurrency. This exchange will only happen if their secrets match, which means no other party can interrupt the transaction. In technical terms, atomic swaps utilize specific smart contracts known as Hashed Timelock Contracts (HTCL). These smart contracts function as a "virtual lockbox" that requires two unique keys to unlock:

HashLock Key: This key will only distribute exchanged cryptocurrency when both parties have signed off on their respective transactions.

TimeLock Key: This key operates as a safety mechanism that returns exchanged cryptocurrency if a trade doesn't execute within a specified timeframe.

Step by Step: What Is an Atomic Swap?

We can break down the atomic swap process into distinct steps:

  1. The first party generates an HTCL address and deposits their cryptocurrency. Then, a secret passcode known as a preimage is generated and hashed — a process that subsequently "locks'' the preimage.

  2. The preimage is sent to the second party responsible for verifying that the cryptocurrency has been deposited.

  3. The second party then deposits their cryptocurrency into a new address, which the same hash has generated.

  4. The first party unlocks the cryptocurrency deposited by the second party with a secret passcode used to deposit the initial cryptocurrency.

  5. The second party unlocks the cryptocurrency deposited by the first party, which completes the atomic swap process.

The Evolution of Atomic Swaps

Although atomic swaps are highly decentralized and require no intermediary parties to facilitate a transaction, trades may remain limited by liquidity. Without the presence of an exchange platform, bringing traders together can be challenging. However, as atomic swap technology evolves, DEX integrations have resulted in order book matching that rivals CEX platforms. As such, those operating in the atomic swap ecosystem have begun to leverage the benefits of low fees, optimized security, and an increasing quality of experience overall.

Already, platforms like Rubix facilitate atomic swaps via a non-custodial wallet that also supports fiat-to-crypto debit and credit card purchases. As innovations like atomic swap protocols continually evolve and decentralized service offerings expand, traders will likely see greater utility in decentralized platforms that offer increasingly low fees, high autonomy, and comprehensive functionality.

Cryptopedia does not guarantee the reliability of the Site content and shall not be held liable for any errors, omissions, or inaccuracies. The opinions and views expressed in any Cryptopedia article are solely those of the author(s) and do not reflect the opinions of Gemini or its management. The information provided on the Site is for informational purposes only, and it does not constitute an endorsement of any of the products and services discussed or investment, financial, or trading advice. A qualified professional should be consulted prior to making financial decisions. Please visit our Cryptopedia Site Policy to learn more.

Is this article helpful?

Yes

No

Topics in article
Up Next