7

I'm running an LND node that has a few dozen channels open to various relevant vendors/routing nodes. There are a couple specific channels that are open with stores that are getting used with most of the balance being on the remote side. I'm unsure how to manually rebalance these specific channels without closing them.

Is it possible to manually rebalance the channels from within my own LND node using the command line or some other way?

2
  • related: bitcoin.stackexchange.com/q/87297/5406
    – Murch
    Jul 3 '19 at 5:22
  • @murch I tried my best to find a related question but I failed. Thanks! It's a bit disappointing that there's not a lot of responses.
    – Chaz
    Jul 3 '19 at 5:44
3

Lnd itself does as far as I remember not provide an api for rebalancing channels.

However there is the lndmanage repository that uses the lnd api to provide a pretty strong rebalancing tool

https://github.com/bitromortac/lndmanage

Such rebalancing will cost you routing fees as they are regular (circular) payments.

That being said it is not clear why you would want to rebalance your channels before an onion on them actually fails. There is currently the discussion about JIT routing (which rebalance just in time if a channel such should be used can't be used) and fee free rebalancing taking place on the lightning-dev Mailinglist.

2
  • Thanks for your response Rene. It doesn't appear I'm sophisticated enough to run this tool in the short run or really make real use out of the theoretical things you're talking on the Lightning-dev mailinglist. I'm just curious if there was anything that I could do as a relative newbie to be able to continue to make fees from these specific channels.
    – Chaz
    Aug 8 '19 at 3:44
  • Hey Rene, I was wondering if this answer is still up-to-date?
    – Murch
    Oct 2 '20 at 0:29
0

In addition to lndmanage you can also use this script (I'm the author):

https://github.com/C-Otto/rebalance-lnd

Using the -f parameter you can select a channel with more than 50% of the funds on the remote side. The script then sends funds to one of your channels (with at most 50% of the funds on the local side, after receiving the transaction), resulting in a 50-50 balance on the channel you specified.

There are some tweaks (channel selection, amount absolute/percentage, ...) that you may want to look into.

0
  1. Create an invoice for yourself: lncli addinvoice <amt>
  2. Pay the invoice specifying the outgoing channel and the last hop to take before paying you: lncli payinvoice --allow_self_payment --outgoing_chan_id <outgoing_chan> --last_hop <last_hop> <payreq_from_1>

To get the outgoing channel id use lncli listchannels --active_only. I usually have to grep for the remote_pubkey that I get from Zeus interface and then look for the chan_id string.

The last hop is the remote_pubkey of the node associated with the channel you want to increase the local balance on.

I learned this from this pull request documentation: https://github.com/lightningnetwork/lnd/pull/3736

Good luck rebalancing!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.