LN+ asked about 3 years ago

Can I open multiple Lightning Network channels with one transaction?

If I want to open let's say 10 channels at the same time, is there a way to batch these into one transaction? If yes, what are the disadvantages? An advantage being lower on-chain fees of course.

1 Comment

nodl-vin [LND] wrote about 3 years ago

From Jameson Lopp's Blog:

Saving On-Chain Channel Open Fees via Batch Opens

If you're starting up a fresh node for which you need to open many channels, and you're comfortable on the command line, consider batching your channel opens with the following method.

Batch open transaction with balanceofsatoshi and Electrum Desktop. Below is a quick description of the process, but this step involves an onchain transaction and therefore possible loss of funds if you make a mistake. There is a detailed tutorial on Jestopher's website:
http://satbase.org/bos-open/
  1. In Electrum Desktop, go to Tools > Preferences, under the 'Transactions' tab, activate 'Advance preview'. Then in Tools, open the 'Pay to many' dialog box.
  2. On your node, as a bos user, in the command line interface, enter this command: bos open <node pubkey 1> --amount <channel size in sats 1> <pubkey 2> --amount <channel size 2> <pubkey 3> --amount <channel size 3> <pubkey 4> --amount <channel size 4> <pubkey 5> --amount <channel size 5> <pubkey 6> --amount <channel size 6> After pressing enter, a 10 min counter will start, and you will need to do steps 3 to 5 within the 10 mins. Make sure to not use Ctrl+C once the timer has started! If you want to cancel the process and timer, just press Enter in the command line interface.
  3. Do not enter any other command in the CLI, but just copy the output of the 'bos open' command, which will be a list of onchain addresses and amount in bitcoin separated by a comma. This is a format compatible with Electrum 'pay to many' option.
  4. In Electrum, paste this list in the pay-to-many dialog box, save the transaction, click 'Pay', set a fixed fee as low as possible based upon the current conditions of the mempool. Make sure that RBF is NOT checked. Then click 'Finalize' and 'Sign' it using your hardware wallet (or Electrum wallet if not using a hardware wallet) but DO NOT broadcast it! This will be done by balanceofsatoshi.
  5. Once finalized and signed, copy the signed raw transaction and paste it in the command line interface and press 'Enter'. After a few seconds or minutes, bos will display a transaction ID. You can then use your node's own block explorer to check the status of your batch transaction.

Please login to post comments.