Lightning Network Submarine Swaps
How to swap sats between LN channels and onchain wallets
Nowadays, we have many Lightning Nodes, but still their operators don’t know how to use at fully potential.
So I will try to explain in this guide, how you can use the submarine swaps in LN.
Here we have a nice explanation of what are submarine swaps, so read first this article, to have a knowledge base about what you are going to use.
So basically, with submarine swaps, we can move liquidity in/from a HODL/cache onchain wallet into/from a LN node/wallet. Also could be used very well as a method of coinjoin, to lose trace of your KYC coins.
Case: You have a LN node and you want to move liquidity (when is needed) from/to your LN channels. Let’s take the example of a simple merchant, with an online or physical shop, where is taking payments through LN.
So, as having more incoming payments, his LN channels will be every end of the day filled at maximum, so will have to “empty” them, in order to make more space for next day of taking payments. That means, you will have to move out of LN channels those received sats, into an onchain wallet. This operation is named “LOOP OUT”.
The “LOOP IN” is the same process, only that is in reverse mode, from any of your onchain wallets, towards your LN node/ wallet.
In this case we some simple methods:
1 - RTL and/or Thunderhub - node management apps
Both have integrated the “loop out” feature, using Boltz and Loop services.
In Thunderhub, you can choose, from which channel you want to loop out or let Thunderhub to calculate the best option. You can choose an internal node onchain address or an external one.
RTL sometimes works better and you can use bigger amounts. You can also go to LN channels, select one you where you have more liquidity on your side and on the right side action buttons you have “loop out” option.
Done, once you set the terms, it will take a while until the loop out is approved and the funds are sent to your indicated onchain address. You can monitor the status in the same page.
Another mention: If you run a node with a LNbits instance, you have integrated also the Boltz Swap extension right into LNBits, for easy swaps. As a merchant that use LNbits for its business this is a very handy tool to “empty” your filled channels from payments, with swaps into onchain address.
2 - CoinOS.io - web wallet, with onchain and LN functionalities
This app also could be used as main charging wallet (if you do not have your own node) for a small merchant, as described in another guide here.
CoinOS have integrated swaps and could be used anonymously, inclusing swaps with Liquid Network.
Simple swap process with CoinOS will be:
Open an account in CoinOS (save the login details, if you want to reuse it)
Create a LN invoice, or use the LN address provided by CoinOS, that will be email@example.com. Also you can use the LNURL-pay address provided and you can pay any amount you want.
Pay to that LN invoice / LN address / LNURL-p address from your node (using Thunderhub is much easier for LN address/ LNURL, also you can use Zeus wallet connected to your node).
Once you have the funds in CoinOS LN, make a payment to any of your onchain BTC addresses, of your node (for future new LN channels) or any other HODL onchain wallet, or you can split.
Done, you’ve just moved out from LN to onchain your funds, with minimal fees and hassle, total private.
3 - Boltz | ZigZag.io | FixedFloat | Deezy | DiamondHands | Submarine
These are online exchanges dedicated for swaps and using a simple procedure in 3-4 steps, you get your sats swap from LN into any onchain address.
Yes, they are charging a fee, but all is very transparent and displayed before you click “swap”.
The same process, you are paying a LN invoice from your node and indicate an onchain address where you want to receive.
4 - Ghetto Swap - The friendly swap with your peers
This is a special type of swap, recommended to be done only with your trusted peers.
Practically is an exchange of sats from LN to onchain, using keysend feature of your node, most used is Thunderhub for this procedure.
You push the sats through a common channel to your peer, he will pay you back onto an onchain address you indicate. This transaction is known ONLY by you two. The keysend tx is not a LN invoice and if you have a common channel, you will not pay fees and also will not pass through any other hop node. You can do it also if you do not have a common channel, but that will cost you more because it will pass through some hops, as a regular LN payment.
5 - Bluewallet LNDHUB
If your node (Umbrel, MyNode, RaspiBlitz, Embassy) have already installed and configured the BW LNDHUB, this could be an easy method to get quick liquidity from an external onchain wallet.
Steps to do:
Connect BW mobile app to your node BW LNDHUB
Create a new LN wallet (will be created on your node, not on BW servers)
This LN wallet will be “empty” as balance, but will use your node liquidity.
Save this wallet backup! Go to wallet details and select export backup, will be a URL to your LNDHUB wallet.
In BW, open this LN wallet and click on the button “refill - from external source”. It will bring up a QR code with an onchain address from your node.
Once you pay to that address (don’t use small amounts like 100, 10k sats), your LN wallet will have a balance with those sats and your LN node also will have an increased liquidity with that amount.
The tx will be reflected on your node onchain txs but will be always to a “dedicated” onchain address for that LNDHUB wallet. And the funds will be also in your LN channels (see your LN node txs list).
Done, in one simple step you moved from onchain to LN, using your node.
Case: You are a regular user, that only want more privacy and lose trace of some BTC bought from a KYC exchange or you received some BTC from an unknown source and don’t want to be linked in any way with it.
In this case is not necessary to have a LN node, but you can do it from a node or a simple LN wallet.
For this process we have the following methods:
1 - RoboSats - totally anonymous exchange, over Tor and LN only
Go to RoboSats page, using Tor browser
generate a Robot identity (save the key if you want to re-use)
make an offer or pick up an existing one, specifying in swap destination where do you want to receive the sats (onchain or LN)
Done, receive the sats in whatever LN/onchain wallet. Pick one from this list.
2 - Buy BTC with fiat and withdraw into LN wallet/node channels
This method is good for small amounts, or you do not want to deal with onchain addresses, you get more privacy and also you can use it as “loop in” method for your LN channels or LN wallets.
Here you have a comparison guide about all LN wallets with their features.
Tools that you can use:
RoboSats, previously mentioned
Telegram bot https://t.me/lnp2pBot P2P exchange
3 - Onchain KYC exchanges to LN wallet / channels
You should consider not using them and instead using the ones from KYCnot.me.
This is the case, when you bought from a KYC exchange and they do not support withdraw through LN. This part is a bit tricky, because many of them will delay the withdrawal, is not instant, to avoid sending those coins to a swap service or simply for draconian KYC measures.
So you will need a “cache wallet” as described in this another guide I wrote, where you will do the coin control, organizing the swaps, distribution by category etc. You withdraw from exchange to this cache wallet and from there in smaller chunks, swap them through LN, using the indicated swap exchanges: Boltz, ZigZag, FixedFloat, CoinOS etc (are many more).
If your exchange is supporting instant withdraw, that is fine, you can just skip the “cache wallet” part and just send smaller chunks to swap exchanges and from there to your LN wallet as your choice.
For this process I suggest to use an external wallet, not form your node. As I described in this another guide about liquidity between nodes. Blixt, OBW, Breeze, Phoenix are good choices for this process.
From that LN wallet, you can also send to your own node (if you need more liquidity) and or to any other HODL wallet onchain (using another swap).
4 - Electrum Desktop Lightning
This is quite powerful LN wallet with integrated swaps too.
Steps to do for this process:
Download and install on your desktop PC Electrum wallet app. Is available for all platforms.
Create a segwit native wallet (bech32) to be fully compatible with LN
Save all the details, seed, password etc in your password manager
Go to wallet options and activate “Lightning” (is not by default)
You can use trampoline channels (managed by ACINQ and other servers) or your own channels (private) with nodes as you wish.
You would need to open some channels first. Also save them as backup.
To make more “space” in these channels, you would need to move out some sats, by sending them to another LN wallet of yours, or if you open a channel with your own node, just push them using keysend towards your node or just a simple LN invoice to yourself.
So you are ready to receive new sats into these Electrum LN channels.
Once you buy from other sources and receive into Electrum, you can do an internal swap, in Electrum. Funds will be moved to one of your Electrum adresses.
Using LNTXBOT (LN Telegram bot) is one of the simplest way to receive and swap sats into onchain. This bot is using Deezy.io API for swaps in and out sats from LN.
Here you have a full user manual about how to use this amazing telegram bot.
A simple scenario using this bot to swap will be:
create an account in Telegram and add a nickname “@username”.
receive some sats directly using your already created “donation page” at https://lntxbot.com/@username that shows a LNURL. Or using already created Lightning Address firstname.lastname@example.org. Or simply using the lntxbot account imported as lndhub acocunt into Zeus or Bluewallet mobile apps, as any other LN wallet.
you can fund from an onchain wallet with the command:
/fundbtcand follow the instructions.
you can swap out sats from LN into any onchain address with the command: /send <sats> <bc1... bitcoin address>
Use all these tips for more scenarios for loop in, loop out, you can do more combinations using different LN wallets, exchanges, nodes etc.
on one LN channel, let’s say of 1M sats, you can pass through 21 BTC or more, back and forth. When you close this channel, on the blockchain will be “visible” only those 1M sats that were “used” in the tx. All the other 20.09 BTC are not reflected, there’s no trace of them (if you do it well).
you could use also Inbound Liquidity Providers, that will open towards your node channels and you are ready to receive sats from those swap services and/or LN exchanges. That means the UTXO used to open the channel is not yours. This is another aspect that increase your privacy.
passing through more hops a payment, also increase the anonymity.
use MPP (multi part payment) if you can and your wallet apps support it.
If you want to a LN node quick, for anonymity and don’t bother with running a full node, just for buying some sats anonymously, I recommend to use Blixt LN node wallet (this is a very powerful tool, if you know how to use it), SBW, Breez, Electrum. With these you can manage easily channels and liquidity as you wish. Also you can any time, just drain them and start a new instance anonymously.
The future of transacting is on Lightning Network. Soon onchain txs will be used only for opening / closing LN channels. So be prepared from now, start learning how to use all these LN tools, wallets, run your own node, build your own network of peers, build your own liquidity over LN. Will come that day when will be VERY EXPENSIVE TO DO IT! You have been warned.
MAY THE ₿ITCOIN BE WITH YOU!
If you appreciate DarthCoin work, you can send some satoshis through LN:
or using Lightning Address to email@example.com or firstname.lastname@example.org
If you do not want to subscribe on substack, all DarthCoin Bitcoin guides are also announced on this dedicated Telegram Channel, for easy search and keep track.
To subscribe on substack, click here: