How to Exchange Bitcoin for Monero with Atomic Swaps
Nov 10, 2021
While Monero is facing more and more regulations and thus is being removed by many exchanges, the COMIT team is working on cross chain atomic swaps. Their xmr-btc-swap project allows for a trustless, peer to peer exchange of Bitcoin for Monero (send BTC, receive XMR). This technology, which implements atomic swaps is fairly new and thus hasn't been audited yet. So make sure to test it with small amounts only and report any issues to the developers!
How atomic swaps work
Atomicity is a concept coined in computer science. It refers to multiple processes having only two possible outcomes:
- (1) Either all processes succeed,
- (2) or none of the processes succeeds.
In other words, atomicity can be described as: "All or nothing". For the context of a swap it means, that:
- (1) Either the seller receives your Bitcoin and you receive the sellers Monero,
- (2) or both parties keep their funds.
- Monero wallet address
- Access to your Bitcoin wallet
- Basic command line interface (CLI) knowledge
1. Install swap
Download and unzip the latest stable
swap release for your operation system from the official xmr-btc-swap repository. In my case that's
Inside the archive is a binary called
swap. You can run
./swap --help to see a list of all available commands.
2. Find a seller
Obviously a swap needs two sides: A buyer (you) and a seller. But finding a seller isn't easy. Especially because not many people are using this technology yet.
Sellers can be found by querying so-called rendezvous points. To do this you need to run the following command:
./swap list-sellers --rendezvous-point <endpoint>
<endpoint> needs to be replaced. Here are a few websites on which you can find such endpoints:
I will also provide you with a list of rendezvous points that were online at the time of writing this blog post:
list-sellers command will return a table with 5 columns:
PRICEHow much 1 XMR costs in BTC (compare here)
MIN_QUANTITYMinimum amount of BTC to sell
MAX_QUANTITYMaximum amount of BTC to sell
STATUSNetwork status of peer
ADDRESSAddress of peer
There is also a bash script to find the best seller of a specific rendezvous point. It is located in
If you want to become a seller yourself, you can read this article.
3. Swap Bitcoin for Monero
Once you have found an appropriate seller you can start a swap:
./swap buy-xmr \
--change-address <btc_refund_address> \
--receive-address <xmr_address> \
xmr_addressYour Monero wallet address
btc_refund_addressBitcoin refund address (in case the swap fails)
seller_addressAddress of the seller (from step #2)
buy-xmr command might look like this:
./swap buy-xmr \
--change-address 1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa \
--receive-address 862mLrhM6jQJDXPJ5pQHm9cYQXLESg4zXTFnRcvQeKAdXBJZBkTkajSQW3MXmeacCR9GZ3iNXXsn9jiTz5XNRe8C3fi3RmZ \
Running this command can take a while, but after some time you should be prompted with a Bitcoin
deposit_address. Send the amount you want to swap to that Bitcoin address. Make sure to keep minimum and maximum in mind! Once the funds have been transacted the seller will automatically send the exchanged Monero. In case anything goes wrong you will be refunded.
The Monero community is already working on a GUI implementation for atomic swaps. Until then we have to rely on the proceess I've outlined in this post. Happy swapping!