Skip to the content.
| Español ES | Français FR | Dutch NL |

Methods of how to use swap services to move sats between LN channels and onchain wallets

Updated October 17, 2024

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.

What are the Lightning Submarine swaps?

Submarine swaps are atomic on-chain to off-chain swaps (and vice-versa) of Bitcoin. They are designed to facilitate the transfer from on-chain BTC to an off-chain Lightning Network (LN) channel. Currently, this is not directly possible without submarine swaps and requires an additional step where a user has to transfer LN funds to their on-chain Bitcoin wallet.

Here is more documentation, explaining in more details what are Lightning Submarine swaps:

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.

We will consider two possible use case scenarios:


SCENARIO A #

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.

Thunderhub swap feature, using Boltz

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.

Ride The Lightning swap page service (you can choose between Loop and Boltz)

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 method: If you run a node with a LNbits instance, you have integrated also the Boltz Swap extension or Deezy 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 - web wallet, with onchain and LN functionalities

This app also could be used as first level of income 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, including swaps with Liquid Network.

Simple swap process with CoinOS will be:

3 - Using various external swap services

Boltz | SwapMarket | ZigZag | FixedFloat| Deezy | DiamondHands | Submarine Swaps

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:

BE AWARE: Sometimes ZigZag.io could have serious liquidity issues and cannot fulfill your swaps. I notice many other users complaining about it.

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.

Boltz swap screen LN to onchain

Here are some more detailed guides about swaps using these services:

4 - Ghetto Swap or PeerSwap- The friendly swap with your direct peers #

A - The "Ghetto Swap" method

WARNING: Do not do this with unknown random people on internet!

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.

Ok, we have a use case scenario like this:

SCENARIO A: Pushing tokens to peer and pay later back

  1. Establish the amount of the channel, usually is better to start with 1M or 2M sats.
  2. Establish how will be transferred half of the amount of the channel to the other peer, onchain or LN. Each one preference is related with what will want to do with the funds after that (opening another channel - onchain, or just re-using them for payments - LN).
  3. One of the peers will use Thunderhub app to open a 2M sats channel, for example. If you use as node software Umbrel/myNode/RaspiBlitz, you can find Thunderhub in your AppStore of the bundle. TH is a powerful app to manage your node.
  4. Go to main TH page - quick action buttons - Open. It will open a small action box with another Open button.

    Being a new peer, just paste in the box the nodeID of the peer. Put the amount in sats, 2 000 000 in channel size.

    In fee amount put a lower fee, based on the mempool, like 2-3-4-5 sat/vByte

    In advanced tab (you will need to click it to open the dialog), leave "public channel" and select "push tokens to partner" as "half".

    Click "Open channel" and done, wait that the tx will be fully confirmed (3 confirmations)

  5. As an open channel initiator you role is done. Now give to the other peer your BTC address onchain or LN invoice where to send your half amount of sats you pushed on his side, making them "his" sats.
  6. The other peer will just pay you the invoice and done.

SCENARIO B: Open channel and balance it with keysend

  1. Follow the same steps from "Scenario A" except the point where you push tokens in the opening procedure. Let's say you want first to receive those half sats in your wallet before you push the tokens to the other side.
  2. So you will have a channel of 2M sats with all liquidity on your side.
  3. After you receive the sats from the other peer, half of the channel amount, you go to the main page in Thunderhub - Accounts - Lightning and click on Send. Then select "Is keysend".
  4. Paste the nodeID/Public key of the other peer, click decode. Will appear another window with the name of the node (if is set). Put the amount of sats, in this case 1M sats (1 000 000) and click send. This operation will push 1M sats directly to your peer, with no invoice, no fees, directly through your common channel already opened and confirmed.
  5. Done! Now you will have a balanced channel with your peer.

If you want a more detailed explanation video how to use Thunderhub in a node, here is a great video tutorial by BTC Sessions

NOTE

Another aspect that should be taken in consideration is the size of the channel you open and the commit fee.

A small channel like 20k-50k-100k will be heavily affected by "commit fee". That means in time, if the miner fees goes high up, also the commit fee will "deduct" from your channel balance.

More to read about commit fees variations here and here

B - The Peer Swap method

Another method to swap between peers is to use the PeerSwap service.

PeerSwap enables Lightning Network nodes to balance their channels by facilitating atomic swaps with direct peers. PeerSwap enhances decentralization of the Lightning Network by enabling all nodes to be their own swap provider. No centralized coordinator, no 3rd party rent collector, and lowest cost channel balancing means small nodes can better compete with large nodes.

PeerSwap currently has a working implementation for both CLN and LND nodes.

At the moment PeerSwap is suitable for power node operators with Linux command line skills. Implementations of control panel GUI interfaces are currently underway which will make PeerSwap easier to use for ordinary end users.

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:

More about how to use Bluewallet LNDHUB with Umbrel node here, dedicated guide.


SCENARIO B #

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

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.

Optionally you could ask (put an order) for LN <-->onchain swaps as trade method

Here you have a comparison guide about all LN wallets with their features.

Tools that you can use:

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, Zeus, 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 a quite powerful (but underated) LN wallet with integrated swaps too. I personally find it very useful.

Steps to do for this process:

Here you have a demo how to use Electrum with Lightning (5 min video).


CONCLUSION

Use all these tips for more scenarios for loop in, loop out, you can do more combinations using different LN wallets, exchanges, nodes etc.

TO REMEMBER: