Welcome to Lightning This Week — 5 minutes of quick updates on the Lightning ecosystem from the past week(ish). Let’s get right to it.
Liquidity management is a top concern for any Lightning node operator. Maintaining good channel health and capacity/liquidity balances can at times be a very time-consuming task. It is technically possible to create a circular payment to yourself in LND in order to rebalance your channels, but up to this point the task was quite involved and required the operator to construct their own route each time. And while there are tools to facilitate the rebalancing of channels for LND, these have been external to the LND node itself, and are usually built by other members of the open source developer community.
Two PRs addressing this concern were merged to the LND codebase this week. Specifically 3739 and 3736. These PRs enable node operators to specify which node should be the last hop on a payment route before the payment is delivered to the intended recipient. This makes possible for operators to rebalance their channels using tooling core to LND, instead of relying on external third-parties. You can now easily pay your own invoices with LND!
If you use the master version of LND you can run the following to pay yourself from Channel 1 to Channel 2, thus allowing for trivial rebalancing of channel capacity.
lncli payinvoice --allow_self_payment --outgoing_chan_id <chan1Id> --last_hop <chan2Id> lnbc1234567...
Note: This is only available if you are using LND on master branch at this time.
PR 3736: https://github.com/lightningnetwork/lnd/pull/3736
PR 3739: https://github.com/lightningnetwork/lnd/pull/3739