Balance Of Satoshis: Batch Open Channels

One of the greatest tools of Balance of Satoshis (BOS) is the ability to batch open lightning channels from an exterior wallet. Any wallet that is capable of producing a signed Partially Signed Bitcoin Transaction (PSBT) or a signed raw transaction will be able to work for BOS, but I’d recommend using Electrum.

[paywall price=”1337″]

[Just a quick note: by using this technique, you don't need to leave any on-chain balance on your lightning node; you can keep your non-lightning funds safely behind the protection of your hardware wallet's security instead of an internet-connected hot wallet that isn't producing any routing income. ]

WHY DO BATCH CHANNEL OPENS

One of the primary costs of running a lightning node is on chain transaction fees. By batching together channel opens, you can reduce costs massively. As an example, check out BOS developer Alex Bosworth’s incredible batched channel open deploying 2.69 BTC of liquidity in 13 channels on the lightning network in a measly 669 vbytes transaction. That’s a 1338 sat fee overall or a 0.00049% chain fee.

Using the bos open command may be one of the highest value bitcoin transactions that you will ever do and there is a ten minute time limit. So, take your time understanding the steps before launching into this power-user tool with high value channels.

Setting Up Electrum (4.0.2) for BOS

Let’s get Electrum ready so your can execute your batched channel open smoothly (and quickly).

  1. Go to Tools > Preferences.

  2. Under the Transactions tab, Activate Advanced preview. This will allow you to copy the signed transaction into BOS later.
  3. Open the Pay to many dialog in Electrum.

Running like a BOS

First, install Balance of Satoshis or use this guide if you’re running a Raspiblitz.

Get to the command line interface and switch to the bos user (sudo su - bos on Raspiblitz).

Then, run the following command with the node public keys that you want to open channels to, followed by the amount flag and the capacity that you would like that channel to have. You can enter several public keys and their respective amounts at this stage. BOS will prepare bitcoin addresses to pay to in the following step.

STOP – READ AHEAD BEFORE ENTERING THIS COMMAND – you will be starting a ten minute timer for yourself, so best be familiar with the next steps before starting. If at any point, you want to stop the timer and start over, press enter in the command line interface (don’t use Ctrl-C here).

bos open <node pubkey 1> --amount <channel size in sats 1> <node pubkey 2> --amount <channel size in sats 2> ...

The output of this command will be an instruction to pay several bitcoin addresses that will resolve to the channels that you’ll be opening. DO NOT BROADCAST THIS TRANSACTION YOURSELF. Only BOS should be broadcasting this transaction.

Use electrum’s pay to many function to copy/paste the output from bos open to electrum using the format already provided as part of BOS that matches with electrum’s format.

Copy the comma-separated addresses and amounts to Electrum’s Pay-to-many function.
Save the transaction.
Right-click and select the pay option.
Finalize the transaction by signing without broadcasting.
(Personal data omitted, but check out that transaction size…beautiful).

Sign the transaction in electrum with appropriate chain fee rate (DON’T SELF BROADCAST) (next block fee rate is best). Then, copy the signed raw transaction into BOS where BOS will broadcast the transaction for you.

When you see the transaction ID shown in BOS, you can check on the status of your transaction using a personal or public block explorer.

If you mess up

Either you didn’t set a high enough chain fee or your transaction didn’t broadcast. Whatever you do, DON’T TRY TO BUMP THE FEE USING ELECTRUM. If you’re absolutely desperate and the transaction hasn’t yet confirmed, you can double spend the coins that you used for the channel opens with a higher fee by using Electrum’s coin control features. You can also use ‘Enter’ to cancel the procedure; Don’t use Ctrl-C.

If nothing else, this link may be helpful. Or, consider joining the Balance of Satoshis chat on Telegram for additional assistance.

[/paywall]


Want to support more content like this? Please consider donating to satbase.org so this can become a full-time endeavor. I’m still working on getting btcpay set up, but you can navigate to the contact us page and send a lightning keysend payment if you are so inclined. Thank you.

One thought on “Balance Of Satoshis: Batch Open Channels

Comments are closed.