Atomic swaps enable trustless exchange of cryptocurrencies between two parties without requiring a trusted third party or escrow service.
Sellers create offers specifying BTC amount and discount/premium. Buyers browse the marketplace for suitable offers.
When a buyer accepts an offer, both parties digitally sign the swap terms, creating a binding agreement.
The seller locks their BTC in a Hash Time-Locked Contract (HTLC) with a secret hash. This BTC is now cryptographically committed.
After verifying the BTC lock, the buyer locks their USDT in a corresponding HTLC using the same secret hash.
The seller reveals the secret to claim the USDT. This revelation exposes the secret on-chain.
Using the revealed secret, the buyer can now claim the locked BTC. Swap complete!
HTLCs are smart contracts that lock funds until a cryptographic condition (revealing a secret) is met, with a time-based refund mechanism.
Each HTLC has an expiration time. If the swap isn't completed, funds automatically become refundable to the original owner.
"Atomic" means the swap either completes fully for both parties, or doesn't happen at all. No partial execution is possible.
If either party fails to complete their part, the timelock ensures both can recover their original funds after expiration.