Atomic Swaps CLI User Guide
The command line guide for Atomic Swaps, i.e., exchanging two different cryptocurrencies from separate blockchains in a trust-less and decentralized manner.
Atomic Swaps are a peer-to-peer marketplace built directly into your Beam wallet that allows users to swap Beam for another cryptocurrency. Trade your Beam for Bitcoin, Ehtereum, LiteCoin, DOGE, and more!
Atomic Swaps is in beta.
DO NOT USE THIS HIGHLY ADVANCED FEATURE FOR LARGE SUMS OF MONEY
For Electrum we support only Legacy type seeds and SSL connection
For Bitcoin use versionBitcoin_core_v0.17.1
.
For Litecoin use versionLitecoin_v0.17.1
.
Perform an Atomic Swap with LiteCoin
Using Alice and Bob as an example, we will go over how to perform an Atomic Swap of Alice's Beam for Bob's LiteCoin (LTC).
Run a full LTC node
Bob and Alice must configure their LTC node to allow RPC access either through the command line or edit theirconfig
file according to the LTC documentation (for this example, we will use standard node and RPC ports).
Alice and Bob can run a full LTC node by entering the following command:
Alice's LTC node
Bob's LTC node
The nodes must be synced to the current blockchain height before an Atomic Swap can occur.
Run a full Beam node
Please refer to this guide for setting up a full Beam node.
Users can check their LTC balance by entering the following command:
Alice's LTC balance
Bob's LTC balance
Initialize Atomic Swap settings
To configure the Atomic Swap settings, enter the following command:
Each cryptocurrency has its own transaction fees.
Avoid transaction jamming or failure by double-checking the--swap_feerate
for each currency before initiating an Atomic Swap.
LTC, for example, has a--swap_feerate
per 1KB of transaction size. LiteCoin's--swap_amount
is denominated in "photons." 1 LTC = 1000000 photons, which is denominated in Beams while also offering fixed fee rates, regardless of transaction size.
Configuring swap settings for Alice
Configuring swap settings for Bob
Swapping LTC for Beam
Both parties can initiate the Atomic Swap by entering the following command:
The parameter--swap_beam_side
is used when the other party (Alice) swaps Beam for a different cryptocurrency.
Bob enters the following command:
Bob must copy the swap token and forward it to Alice. After, Bob can enter the--wallet_listen
command:
Alice can accept the swap by entering the following command:
Accepting swap offer
If Alice accepts the swap, it will create a swap transaction, and the LTC and Beam will lock on Bob's blockchain.
Each blockchain has its own block generation time. Average block generation times (roughly):
LiteCoin: two and a half (2.5) minutes.
Beam: one minute.
Bitcoin: ten minutes.
After six blocks, Bob will redeem Alice's Beam coins, revealing a secret transaction code and completing Bob's portion of the Atomic Swap.
Alice will redeem Bob's LTCs using the secret transaction code revealed to her, completing the Atomic Swap.
Bob and Alice can return to their respective Beam and LTC wallets to confirm the details of the Atomic Swap.
Perform an Atomic Swap with Bitcoin
Using Alice and Bob as an example, we will go over how to perform an Atomic Swap of Alice's Beam coins for Bob's Bitcoin (BTC).
Run a full BTC node
Bob and Alice must configure their BTC node to allow RPC access either through the command line or edit their config files according to the BTC documentation (for this example, we will use standard node and RPC ports).
Alice and Bob can run a full BTC node by entering the following command:
Alice's BTC node
Bob's BTC node
The nodes must be synced to the current blockchain height before an Atomic Swap can occur.
Run a full Beam node
Please refer to this guide for setting up a full Beam node.
Alice and Bob can check their BTC balance by entering the following command
Alice's BTC balance
Bob's BTC balance
Initialize Atomic Swap settings
To configure the Atomic Swap settings, enter the following command:
Each cryptocurrency has its own transaction fees.
Avoid transaction jamming or failure by double-checking the--swap_feerate
for each currency before initiating an Atomic Swap.
BTC, for example, has a--swap_feerate
per 1KB of transaction size. Bitcoin's--swap_amount
is denominated in "satoshis." 1 BTC = 1000000 satoshis, compared to Beam, which is denominated in Beams while also offering fixed fee rates, regardless of transaction size.
Configuring swap settings for Alice
Configuring swap settings for Bob
Swapping BTC for Beam
Both parties can initiate the Atomic Swap by entering the following command:
The parameter--swap_beam_side
is used when the other party (Alice) swaps Beam for a different cryptocurrency.
Bob enters the following command:
Bob must copy the swap token and forward it to Alice. After, Bob can enter the--wallet_listen
command:
Alice can accept the swap by entering the following command:
Accepting swap offer
If Alice accepts the swap, it will create a swap transaction, and the BTC and Beam will lock on Bob's blockchain.
Each blockchain has its own block generation time. Average block generation times (roughly):
LiteCoin: two and a half (2.5) minutes.
Beam: one minute.
Bitcoin: ten minutes.
After six blocks, Bob will redeem Alice's Beam coins, revealing a secret transaction code and completing Bob's portion of the Atomic Swap.
Alice will redeem Bob's BTCs using the secret transaction code revealed to her, completing the Atomic Swap.
Bob and Alice can return to their respective Beam and BTC wallets to confirm the details of the Atomic Swap.
Last updated