An atomic swap or atomic exchange is a feature that allows two parties to trade tokens across two different blockchains via an automatic exchange contract.
Understanding the term
Traditionally, users required a centralized exchange to buy or sell cryptocurrencies, compromising their autonomy and privacy. Atomic swaps allow peer-to-peer trading of cryptocurrencies without a third party, facilitating trustless transactions that are devoid of counterparty risks. Some decentralized exchanges (DEX) can conduct atomic swaps, though people can opt for cross-chain swap providers which offer greater decentralization.
The term “atomic” denotes processes that finalize or are not initiated at all. In other words, atomic swaps are equipped with functionalities to verify that both sides of the trade meet all pre-defined requirements before the trade can be completed (guaranteed transaction integrity). A smart contract enforces the conditions for the success of the transaction and is self-initiating.
Atomic swaps utilize hash-lock time lock contracts (HTLC). The HTLC includes a HashLock, which allows depositors to lock and unlock deposited currency with a password, as well as a Time Lock, which returns funds to depositors if they cannot complete the transaction within a defined period.
An atomic wallet is an interface for sending, receiving, and storing cryptocurrencies. Users have full control and ownership over their assets, since the private keys are backed locally and inaccessible by the platform itself.