<oembed><type>rich</type><version>1.0</version><author_name>npub1zlxd3xlzjhq2ue03e5m5p2w6mp8v3dkhq5r39flsftjjsje04wvsdd2k4w</author_name><author_url>https://nostr.ae/npub1zlxd3xlzjhq2ue03e5m5p2w6mp8v3dkhq5r39flsftjjsje04wvsdd2k4w</author_url><provider_name>njump</provider_name><provider_url>https://nostr.ae</provider_url><html>📅 Original date posted:2022-09-23&#xA;📝 Original message:&#xA;Dear Matt and Lightning developers,&#xA;&#xA;those are excellent and important questions that I should probably have&#xA;addressed more explicitly in the article / ml-post! Let me add what I&#xA;currently know and begin with your second question as I think I think the&#xA;answer will be more objective / verifiable while my response to the gossip&#xA;question is a bit more speculative at this point:&#xA;&#xA;On Fri, Sep 23, 2022 at 10:43 AM Matt Corallo &lt;lf-lists at mattcorallo.com&gt;&#xA;wrote:&#xA;&#xA;b) What are the privacy implications of the naive &#34;update on drained&#xA;&gt; channel&#34;, and have you done any&#xA;&gt; analysis of the value of this type of gossip update at different levels of&#xA;&gt; privacy?&#xA;&gt;&#xA;&#xA;We know from information theory that the distribution with the highest&#xA;entropy is the uniform distribution [1] which in the context of a channel&#xA;with capacity of `c` means `log(c+1)` bits as shown in [2].&#xA;&#xA;Now if a given drain leads to a pair of `htlc_maximum_msat` one could in&#xA;deed also go the other way around and look at the pair of&#xA;`htlc_maximum_msat` and estimate the *past* drain. And of course also the&#xA;(the non uniform) liquidity distribution from the past. Note that now with&#xA;the better `htlc_maximum_msat` pair the distribution should be closer to&#xA;uniform again which is actually best from an information theoretic point of&#xA;view as this maximizes the entropy in the channel.&#xA;&#xA;I have just created and uploaded a small python script / notebook [3]  from&#xA;which we can see for example how much information about the shape of the&#xA;past liquidity distribution we would learn if we could induce from the&#xA;`htlc_maximum_msat` pair that the drain was 0.75. So from the notebook I&#xA;quote:&#xA;&#xA;Assume we learnt a drain of 0.75&#xA;=================================&#xA;Entropy of uniform: 20.00 bits.&#xA;Entropy of the channel with drain: 19.17 bits&#xA;Information gain: 0.83 bits&#xA;&#xA;&#xA;Yes we learnt less than 1 bit of information by knowing the shape of the&#xA;distribution from the last payments. This much is learnt by a single probe.&#xA;Given that we expect our payment failure rates to drop by an order of&#xA;magnitude and the fact that I could probably learn the drain from the on&#xA;chain signal or gossip anyway I personally would consider this information&#xA;leakage to be acceptable. But of course people may not agree with me and&#xA;just not set their `htlc_maximum_msat` flag in the proposed manner. Also it&#xA;is obvious that higher drain values produce a more heavily depleted channel&#xA;and we might learn more bits (in case of a 0.95 drain we learnt about 3&#xA;bits.)&#xA;&#xA;a) How much gossip overhead do you expect this type of protocol to&#xA;&gt; generate/is there a useful&#xA;&gt; outcome for this type of update even if you limit gossip updates to&#xA;&gt; once/twice/thrice per day?&#xA;&gt;&#xA;&#xA;As written in the article I expect the setting of the valves as throtteling&#xA;devices to be rather stable as I would assume the drain on channels should&#xA;not be impacted too heavily by installing valves. This assumption is&#xA;certainly more reasonable if nodes already used min cost flow solvers to&#xA;send out payments and less reasonable if nodes still use ad-hoc splitting&#xA;heuristics and restrict their path finding on channels with sufficiently&#xA;large `htlc_maximum_msat` values for the amount of the partial payment.&#xA;&#xA;In any case I expect that once the valve is in a good setting for a&#xA;particular channel / drain the setting can stay as long as the drain won&#39;t&#xA;change significantly. In general I would not expect drain on channels to&#xA;change heavily over time (though I certainly would not expect it to be&#xA;static / stable either). Certainly fee changes in the network (and other&#xA;factors) may eventually produce changes in drain on channels which would&#xA;also have to eventually be reflected in new settings for the valve.&#xA;&#xA;The experimental algorithm idea that I presented in cell 12 of the original&#xA;notebook (which I also used in the privacy consideration code from above)&#xA;computes the histogram of liquidity of the last N routing requests (failed&#xA;and successful ones) that a node saw on the channel and then makes a&#xA;decision weather to open or close the valve a bit more. Using this greedy&#xA;strategy we saw in the notebook that a node could find decent values in&#xA;logarithmic many steps . So while the setup of the valve may trigger a few&#xA;gossip messages (but each one only after a sufficient amount of routing&#xA;requests have been processed) and while I expect dynamics in drain on the&#xA;channel I don&#39;t expect such adoptions should have to happen in real time or&#xA;even several times per day and put unnecessary load / spam to gossip. But I&#xA;guess we can only see this by operating nodes and probably there are some&#xA;nodes where updates occure more frequently than with other nodes.&#xA;&#xA;That being said of course if the peers of a channel work together and both&#xA;exchange information / collaborate in finding a good `htlc_maximum_msat`&#xA;pair (similalry as our protocol for finding fees in a mutual close) they&#xA;will probably need less gossip messages than in the case where both nodes&#xA;independently try to find decent settings.&#xA;&#xA;I am happy if people have more insights into this and challenge my&#xA;expectation (because it actually really is only an expectation / intuition&#xA;at this point). That being said: Yes even with only a few gossip messages&#xA;per day I expect for the given reasons the setup of valves to be possible&#xA;and useful!&#xA;&#xA;with kind regards Rene&#xA;&#xA;[1]:&#xA;https://en.wikipedia.org/wiki/Maximum_entropy_probability_distribution#Uniform_and_piecewise_uniform_distributions&#xA;[2]: https://arxiv.org/abs/2103.08576&#xA;[3]:&#xA;https://github.com/lnresearch/Flow-Control-on-Lightning-Network-Channels-with-Drain-via-Control-Valves/blob/main/Privacy%20Considerations%20of%20signaling%20past%20drain%20via%20%60htlc_maximum_msat%60%20pairs.ipynb&#xA;&#xA;&gt;&#xA;&gt; Thanks,&#xA;&gt; Matt&#xA;&gt;&#xA;&gt; On 9/22/22 2:40 AM, René Pickhardt via Lightning-dev wrote:&#xA;&gt; &gt; Good morning fellow Lightning Developers,&#xA;&gt; &gt;&#xA;&gt; &gt; I am pleased to share my most recent research results [1] with you. They&#xA;&gt; may (if at all) only have a&#xA;&gt; &gt; small impact on protocol development / specification but are actually&#xA;&gt; mainly of concern to node&#xA;&gt; &gt; operators and LSPs. I still thought they may be relevant for the list.&#xA;&gt; &gt;&#xA;&gt; &gt; While trying to estimate the expected liquidity distribution in depleted&#xA;&gt; channels due to drain via&#xA;&gt; &gt; Markov Models I realized that we can exploit the `htlc_maxium_msat`&#xA;&gt; setting to act as a control&#xA;&gt; &gt; valve and regulate the &#34;pressure&#34; coming from the drain and mitigate the&#xA;&gt; depletion of channels. Such&#xA;&gt; &gt; ideas are btw not novel at all and heavily used in fluid networks [2].&#xA;&gt; Thus it seems very natural&#xA;&gt; &gt; that we do the same on the Lightning Network.&#xA;&gt; &gt;&#xA;&gt; &gt; In the article we show within a theoretic model how expected payment&#xA;&gt; failure rates per channel may&#xA;&gt; &gt; drop significantly by up to an order of magnitude if channels set up&#xA;&gt; proper asymmetric&#xA;&gt; &gt; `htlc_maximum_msat` pairs.&#xA;&gt; &gt;&#xA;&gt; &gt; We furthermore provide in our iPython notebook [3] two experimental&#xA;&gt; algorithmic ideas with which&#xA;&gt; &gt; node operators can find decent `htlc_maximum_msat` values in a greedy&#xA;&gt; fashion. One of the algorithms&#xA;&gt; &gt; does not even require to know the drain or payment size distribution or&#xA;&gt; build the Markov model but&#xA;&gt; &gt; just looks at the liquidity distribution in the channel at the last x&#xA;&gt; routing attempts and adjusts&#xA;&gt; &gt; the `htlc_maximum_msat` value if the distribution is to far away from a&#xA;&gt; uniform distribution.&#xA;&gt; &gt;&#xA;&gt; &gt; Looking forwards for your thoughts and feedback.&#xA;&gt; &gt;&#xA;&gt; &gt; with kind regards Rene&#xA;&gt; &gt;&#xA;&gt; &gt;&#xA;&gt; &gt; [1]:&#xA;&gt; &gt;&#xA;&gt; https://blog.bitmex.com/the-power-of-htlc_maximum_msat-as-a-control-valve-for-better-flow-control-improved-reliability-and-lower-expected-payment-failure-rates-on-the-lightning-network/&#xA;&gt; &lt;&#xA;&gt; https://blog.bitmex.com/the-power-of-htlc_maximum_msat-as-a-control-valve-for-better-flow-control-improved-reliability-and-lower-expected-payment-failure-rates-on-the-lightning-network/&#xA;&gt; &gt;&#xA;&gt; &gt; [2]: https://en.wikipedia.org/wiki/Control_valve &lt;&#xA;&gt; https://en.wikipedia.org/wiki/Control_valve&gt;&#xA;&gt; &gt; [3]:&#xA;&gt; &gt;&#xA;&gt; https://github.com/lnresearch/Flow-Control-on-Lightning-Network-Channels-with-Drain-via-Control-Valves/blob/main/htlc_maximum_msat%20as%20a%20valve%20for%20flow%20control%20on%20the%20Lightnig%20network.ipynb&#xA;&gt; &lt;&#xA;&gt; https://github.com/lnresearch/Flow-Control-on-Lightning-Network-Channels-with-Drain-via-Control-Valves/blob/main/htlc_maximum_msat%20as%20a%20valve%20for%20flow%20control%20on%20the%20Lightnig%20network.ipynb&#xA;&gt; &gt;&#xA;&gt; &gt;&#xA;&gt; &gt; --&#xA;&gt; &gt; https://ln.rene-pickhardt.de &lt;https://ln.rene-pickhardt.de&gt;&#xA;&gt; &gt;&#xA;&gt; &gt; _______________________________________________&#xA;&gt; &gt; Lightning-dev mailing list&#xA;&gt; &gt; Lightning-dev at lists.linuxfoundation.org&#xA;&gt; &gt; https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&#xA;&gt;&#xA;&#xA;&#xA;-- &#xA;https://www.rene-pickhardt.de&#xA;-------------- next part --------------&#xA;An HTML attachment was scrubbed...&#xA;URL: &lt;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20220923/b0791f3f/attachment-0001.html&gt;</html></oembed>