Centralized crypto exchanges (CEXs) are a crucial aspect of the current crypto market. Although there are other ways to swap digital assets, CEXs have the highest liquidity in the industry. Big crypto exchanges such as Coinbase and Binance even have intuitive UI/UX (user interface/user experience), making it easier to trade between fiat and crypto.
Although CEXs make crypto trading simple, they come with a few drawbacks. Most notably, CEXs have complete ownership over the crypto on their trading platforms. Unless users take their crypto off a CEX, there’s a risk of the exchange going bankrupt or abruptly freezing their accounts. Also, CEXs charge transaction fees and ask for users’ personal information.
And to reduce overreliance on CEXs, some developers have begun using blockchain technology to “decentralize” crypto transfers. One recent innovation in this field is an “atomic swap.” By using encoded smart contracts, atomic swaps promise to eliminate the need for a third-party custodian when trading cryptocurrencies on separate blockchains. Atomic swaps are highly experimental, but they could soon revolutionize crypto trading.
An atomic swap is a crypto transfer that relies on smart contract technology. First introduced on Ethereum (ETH), smart contracts are pre-programmed commands that fulfill their tasks once certain conditions are met. Web3 developers use smart contracts to remove the need for central authorities in their dApps (decentralized applications), as a reduced number of intermediaries makes the process smoother.
In an atomic swap, two parties agree to create a smart contract where they place the crypto they want to transfer. This smart contract generates special “passcodes” both parties can use to deposit and unlock the crypto. These interactions take place on the blockchain without the aid of order books or a third-party custodian. People with a compatible crypto wallet or who use an atomic swap exchange such as Komodo can take advantage of these trustless peer-to-peer (P2P) crypto swaps without sharing KYC info.
The word “atomic” refers to the “atomic state” in computer programming, wherein programs execute or fail—there’s no third option. So when people enter into an atomic swap, there are only two possibilities: the transaction will work, or they’ll get a full refund.
Atomic swaps first gained prominence in 2017 when Litecoin’s founder, Charlie Lee, announced he used this technology to exchange LTC for the altcoin Decred (DCR). Shortly after this first recorded atomic swap, Lee announced another successful transfer between LTC and Bitcoin (BTC).
Hashed Timelock Contracts (HTLCs) are a type of smart contract people use to make an atomic swap. These specialized contracts hold all deposited digital assets and transfer coins to each individual’s associated wallet address.
HTLCs also generate two “keys” for each swap participant to unlock crypto. The “HashLock Key” lets users deposit and redeem crypto in the HTLC, while the “TimeLock Key” provides extra security. If one person doesn’t meet the requirements of their atomic swap contract within a pre-set amount of time, the TimeLock Key will redistribute any crypto put into the HTLC.
Suppose Alice and Joe want to use a crypto atomic swap to exchange 1 BTC for an equivalent amount of ETH. At the time of writing, the exchange rate between BTC and ETH is 1 BTC for every 13.75 ETH. To make this trade happen, Alice and Joe need crypto wallets that support atomic swap functions. Once they’ve set up their wallets, the process of an atomic swap typically follows the same pattern:
Atomic swaps are an attractive option for those who don’t feel comfortable entrusting their crypto to CEXs. However, since atomic swaps are relatively new, there are a few concerns crypto traders should know before using them.
Atomic swaps aren’t the only way crypto users can exchange tokens without relying on a centralized platform. The rise of DeFi (decentralized finance) in 2020 has unleashed a few alternative ways of sending tokens throughout Web3.
Atomic swaps may become a central feature in crypto’s future. While this technology has yet to go mainstream, it could reduce the influence of centralized trading sites. The more accessible atomic swaps become, the more opportunities crypto traders will have to exchange tokens without the risks and fees associated with CEXs.
At Worldcoin, we aim to preserve anonymity and increase safety while using DeFi services such as atomic swaps. For instance, we’re currently using our eye-scanning Orb device to prove each crypto wallet has a unique owner without collecting KYC data. Subscribe to our YouTube channel to learn more.