I have at least two open channels, one of which has inbound capacity and the other has outbound capacity. How can I find a route and construct a payment to rebalance my channels against each other just using the LND commandline?

As in, what steps are necessary to stitch two routes together to form a cycle?

  • Just to make sure: the lnd commandline means any commandline using a chain of lnd commands? Because if it was just about command line you could use lndmanage ( github.com/bitromortac/lndmanage ) I would post this as an answer if you are happy with this. Commented Apr 26, 2019 at 4:56
  • I've seen multiple third-party tools that would construct these transactions automatically for me, but I don't want to introduce more review/trust. We've succeeded at sending a two-hop by manually editing route information, and I was hoping that there would be a better way to do it without quite as much manual intervention but without third party tools.
    – Murch
    Commented Apr 26, 2019 at 20:13

1 Answer 1

  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!

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