How to batch open multiple channels from a hardware wallet?
60
avatar for sloppy-weasel-of-politeness
6 months ago by
avatar for sloppy-weasel-of-politeness sloppy-weasel-of-politeness1.2k sats wrote:

When fees are expensive it may be more economical to open multiple channels with one transaction. Also to avoid extra transaction for transferring funds to lightning node I want to open the channels directly from the hardware wallet.

ADD INCENTIVE   ADD COMMENTlink written 6 months ago by sloppy-weasel-of-politeness1.2k sats
141
avatar for magic-loon-of-beauty (not signed)
6 months ago by

This is currently possible using PSBT and HWW supporting it, like Coldcard. You can use LND directly or with a wrapper which makes it easier, for example bos or maybe own simple script to handle funding automatically. Directly in LND, use --psbt flag to start funding transaction or channel opening, for example: lncli openchannel --psbt --node-key <id> --local_amt <sats>. Output of this gives you PSBT which you have to feed to another round of command as --base_psbt parameter.

ADD COMMENTlink written 6 months ago by magic-loon-of-beauty (not signed)55k sats
110

So next command would look like lncli openchannel --psbt --node-key <id> --local_amt <sats> --base_psbt <previous_psbt>. Repeat for how many channels you want. It always gives you PSBT (with multiple addresses) you need to fund with externally. Prepare transaction with correct outputs in external wallet like Electrum, sign it with Coldcard and past PSBT from Coldcard to terminal, lnd is asking for it.

ADD REPLYlink written 6 months ago by greedy-hog-from-jupiter120 sats
30
avatar for magic-loon-of-beauty (not signed)
6 months ago by

That's the short version for how to do it with lnd. For more docs, check for example https://github.com/guggero/lnd/blob/84dfed3fe2d28ceda343944874ab47fb57b73515/docs/psbt.md and https://blog.lightningconductors.net/channels/2020/12/10/opening-psbt.html. With Balance of Satoshi, it might be even easier but I didn't test personally. http://satbase.org/bos-open/

ADD COMMENTlink written 6 months ago by magic-loon-of-beauty (not signed)55k sats
10
avatar for greedy-hog-from-jupiter
5 months ago by
avatar for greedy-hog-from-jupiter greedy-hog-from-jupiter120 sats wrote:

Is this considered as resolved? Could I get the bounty? I wasn't able to sign all of the comments because of some issue with website, I managed to sign only second comment.

ADD COMMENTlink written 5 months ago by greedy-hog-from-jupiter120 sats

Thank you for the detailed answer! Looks like the bounty was awarded to you.

ADD REPLYlink written 5 months ago by sloppy-weasel-of-politeness1.2k sats

The site has a bug where posts containing single quotes (') cannot be signed on the CLI - maybe this is what you ran into. I should be able to fix the bug quickly (add single quote escaping).

ADD REPLYlink written 5 months ago by magic-loon-of-beauty (not signed)55k sats

Add your answer

Note:

  • Answers should ONLY be used to respond to the original question at the top of this page! Use the ADD COMMENT or ADD REPLY buttons above to respond to someone, ask for clarifications, request more details, etc.
  • Maximum answer length is 500 characters due to limits on Lightning invoice size. After posting you can use comments to expand.
  • Incentive is awarded to signed answers only

Help

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by ln-central open soruce Q&A software running code change a5ae7af8 which was committed 8 months ago