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