[Lightning-dev] Research on proactive fee free channel rebalancing in the friend of a friend network / and roadmap for a protocol extension

ZmnSCPxj ZmnSCPxj at protonmail.com
Tue Jan 7 15:26:42 UTC 2020


Good morning Rene,

I am glad my question has triggered such interest from you!

I will confess that I do not yet understand the math you demonstrated and have not seen your program at all yet.
It is a good thing as well that it can be used to derive routehints for invoices.

I do have a follow-up thought.

-----

I would like to point out that:

* A JIT Routing is really just a rebalancing while you have a forwarding.
* A rebalance is just a self-payment.
* A self-payment is a payment, and as such can be split via multipath.
* The multipath algorithm you derived here can still be reused for this case.

Suppose a node wishes to forward via some channel that sadly has insufficient capacity.
Then we can use your MPP algorithm, removing that target channel from our computations, and with the target amount being the difference between the available capacity on that channel and the value to be forwarded.
Then we can determine how much amount we can pull from our *other* channels, and then generate an MPP self-payment / rebalance.

Further, the algorithm you described, appears to me to be most useful if the payer is not currently very well-balanced.
That is, the algorithm you described strives to move the payer from unbalanced to balanced.
If the payer is already perfectly balanced then the algorithm will strive to split the payment to all channels the payer has.

Thus, it seems to me that we may be better off with a "lazy" balancing scheme, aka JIT Routing.

* If we have to pay, use the MPP splitting algorithm to better move towards balance.
* If we have to forward but have insufficient funds in the forwarding, again use the MPP splitting algorithm to determine which other channels are best to source the money from to rebalance.

It may be useful to implement as a C-Lightning plugin with a `suggestsplit` that is given a target amount, plus an optional array of local channels to exclude, and outputs an array of channels plus how much it suggests to get from that channel.
Then the multipath payment algorithm could refer to this, and a putative JIT routing plugin can refer to this as well.

Regards,
ZmnSCPxj


More information about the Lightning-dev mailing list