Atomic Swaps offer a simple solution to the following problem: two parties (Alice and Bob) want to trade their coins without using an exchange. Beam has integrated an Atomic Swap marketplace directly into your Beam wallet (desktop version only) and a simplified process to link additional cryptocurrencies from your wallet settings.
The Non-Atomic way to Swap Cryptocurrency
The non-atomic approach to swapping cryptocurrencies consists of many arduous steps:
Alice wants to trade her Litecoin for Bob's Bitcoin.
Alice and Bob find an exchange that supports both currencies. Alice and Bob each sign up and go through the verification process.
The verification process completes. Alice and Bob can deposit their crypto to the exchange, paying network and mining fees to do so.
Alice and Bob's can exchange their crypto. They pay additional fees.
Alice now has some of Bob's bitcoin, and Bob has some of Alice's Litecoin.
Alice and Bob transfer their shiny new crypto coins back to their wallets, but not before paying more network and mining fees.
Wait some more.
Alice and Bob's coins have arrived in their wallets. Alice and Bob have now diversified their cryptocurrency portfolios.
This scenario is unnecessarily complex and creates lots of room for error.
With Atomic Swaps, Alice can exchange her Litecoin for Bob's BitcoinBeam coins directly from their respective wallets!
No verification process. No depositing to cryptocurrency exchanges. Minimal fees and wait time.
Atomic Swaps, Simplified
Alice creates an offer for 200 of her Dogecoins for 10 of Bob's Beam coins, securing it with her secret passphrase before broadcasting the request to Bob over the Beam network.
Bob receives Alice's offer for 200 of her Dogecoins for 10 of his Beam coins. Bob accepts, verifying the exchange with his secret passphrase.
Alice receives a notification that Bob has accepted her offer.
Alice receives 10 Beam coins, and Bob gets 200 Dogecoin. Alice and Bob have now diversified their cryptocurrency portfolios.
Atomic Swaps, Not-So-Simplified
Atomic swaps are essentially three smart contracts stacked on top of each other.
Each atomic swap creates three transactions between Alice and Bob: Lock transaction, Redeem transaction, and Refund transaction.
Both parties lock their coins on the respective chain using the Lock Transaction. In this state, the coins belong to both parties and can not be spent.
Once the lock is confirmed, the parties exchange secrets used to lock funds and send the Redeem transaction to the chain, effectively getting the swapped coins.
If the swap fails for any reason, a Refund transaction can be sent to the network after some significant period of time to get the locked coin back for each party.