<div dir="ltr"><div dir="auto"><div dir="ltr">Dear fellow Lightning Network developers, <div><br></div><div>I am very pleased to share with you some research progress [0] with respect to achieving better payment path finding and a better reliability of the payment process. </div><div><br></div><div>TL;DR summary: In payment (multi)path finding use the (multi)paths with the highest success probability instead of the shortest or cheapest ones. (multi)path success probability is the product of channel success probabilities. Given current data crawled on the Network the channel success probability grows with the capacity of the channel and with smaller amounts that are to be sent (which is both intuitively obvious). (Multi)path success probability thus declines exponentially the more uncertain channels are included.</div><div><br></div><div>I understand that the actual payment path finding is not part of the spec but I think my results should be relevant to the list since:</div><div><br></div><div>a) The payment pathfinding is currently based on trial and error approach which has consequences that have not been studied well in the context of the Lightning Network</div><div>b) All implementations will use some heuristics in order to achieve pathfinding. </div><div>c) Quick path finding is a crucial for a good user experience.</div><div>d) The uncertainty of payment paths is frequently quoted as a major criticism of the Lightning Network (c.f. [1]) and I believe the methodology of this paper can be used to address this.</div><div><br></div><div><div>The main breakthrough is that  a very simple model that puts the uncertainty of channel balances at its heart. We belief the uncertainty of channel balance values is the main reason why some payments take several attempts and thus take more time.  With the help of probability theory we are able to define the channel success and failure probabilities and similarly (multi)path success and failure probabilities. Other Failure reasons could also be included to the probability distributions.</div><div><div><div><br></div><div><div>With the help of crawling small samples of the network we observe that the probability distributions of the channel balances can be estimated well with a uniform distribution (which was a little bit surprising) but leads to surprisingly easy formulas.  We are able to quantify the uncertainty in the channels and use negative Bernoulli trials to compute the expected number of attempts that are necessary to deliver a payment of a particular amount from one node to another participant of the network. This can be used to abort the trial and error path finding if the probability becomes to low (expected number of attempts too high)</div></div><div><br></div><div></div></div><div></div></div><div>We can mathematically show what people already knew (and draw conclusions like the mentioned ones from it):</div><div><br></div><div>a) smaller amounts have higher success probabilities</div><div>b) the success probability declines exponentially with the number of uncertain channels in a (multi)path. </div><div>c) depending on the payment pair, amount and splitting strategy it can be decided into how many parts a payment should be split to achieve the highest success probability. </div><div>d) In particular for small amounts splitting almost never makes sense.</div><div><br></div><div>We demonstrate that sorting paths by their descending success probability during the trial and error payment process (instead of currently used heuristics like fees or route length) and updating the probabilities from current failures decreases the number of average attempts and produces a much faster delivery of payments.</div><div><br></div><div>Additionally we looked what happened if BOLT14 [2] was implemented or nodes otherwise would pro-actively rebalance their channels according to previous research [3] and realized that the observed prior distribution changes from uniform to normal. This is great as small payments become even more likely (as one would intuitively assume and as previously showed) Our results show that probabilisitic path finding on a rebalanced network works even better (as in fewer failed attempts) which is yet another hint why BOLT14 might be a good idea. However as mentioned the results can be implemented even without BOLT14 or without other protocol changes by any implementation. </div><div><br></div></div><div>One consequence from the paper that is not discussed heavily within the paper that I find pretty interesting is that if implementations follow the recommendation to use a probabilistic approach they will tend to route payments along high capacity channels. While the fee based routing can easily be gamed by dumping fees it is much harder to provide more liquidity. And if done this would actually provide a service to the network. This means that nodes which provide a lot of liquidity and thus utility might be able to charge higher fees (as long as they are small enough so that users are willing to pay them) which would probably allow the emergence of a real routing fee market. </div><div><br></div><div>One note on the question of MPP: In the last couple weeks I have been collaborating with Christian Decker. I belief (by using the methodology from this paper) to also have a definite solution to the question of:</div><div><br></div><div>How to split a payment into k parts and how many funds to allocate to each path to increase the (multi)path success probability. </div><div><br></div><div>While this is is not addressed in the attached paper as we still need to run evaluations I can already share that an equal sized split as used in the paper (and by some implementations) is not preferable as one can easily see from this example: </div><div>Imagine one is to deliver 100 satoshi and has to paths with 1 uncertain channel on each path. The first of capacity 101 and  the second of 51. Obviously trying to send 100 satoshi along the 101 capacity channel is bad. Similarly splitting 50/50 and sending 50 Satoshi along the 51 satoshi capacity channel is also bad. Thus a split that allocates for example 67 Satoshi to the 101 capacity and 33 to the 51 satoshi channel seems way more reasonable. Actually 75/25 would probably be the best solution for such a setting. And no it is only random coincident that a binary splitter would have arrived at that split eventually (after potential miss trials) </div><div>There is way more math theory of how to actually solve the optimization problem in the general case and how to find a split and paths that maximizes the probability of the attempts. I cannot share these results yet but I am pretty confident that there will be updates on that end very soon. </div><div><div><div><div></div></div></div><div></div></div><div><br></div><div>with kind regards Rene<br></div><div><br></div><div>[0]: <a href="https://arxiv.org/abs/2103.08576" rel="noreferrer" target="_blank">https://arxiv.org/abs/2103.08576</a> Security and Privacy of Lightning Network Payments with Uncertain Channel Balances</div><div><div>[1]: <a href="https://www.whatbitcoindid.com/podcast/peter-rizuns-lightning-critique-fud-or-fair" rel="noreferrer" target="_blank">https://www.whatbitcoindid.com/podcast/peter-rizuns-lightning-critique-fud-or-fair</a></div><div>[2]: <a href="https://github.com/lightningnetwork/lightning-rfc/pull/780" rel="noreferrer" target="_blank">https://github.com/lightningnetwork/lightning-rfc/pull/780</a></div><div>[3]: <a href="https://lists.linuxfoundation.org/pipermail/lightning-dev/2019-December/002406.html" rel="noreferrer" target="_blank">https://lists.linuxfoundation.org/pipermail/lightning-dev/2019-December/002406.html</a></div><div><br></div><div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div><a href="https://www.rene-pickhardt.de" target="_blank">https://www.rene-pickhardt.de</a></div><div><br></div><div>Skype: rene.pickhardt </div></div></div></div></div></div></div></div><div></div></div></div></div>
</div>