<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <updated></updated>
  <generator>https://nostr.ae</generator>

  <title>Nostr notes by </title>
  <author>
    <name></name>
  </author>
  <link rel="self" type="application/atom+xml" href="https://nostr.ae/npub1zlxd3xlzjhq2ue03e5m5p2w6mp8v3dkhq5r39flsftjjsje04wvsdd2k4w.rss" />
  <link href="https://nostr.ae/npub1zlxd3xlzjhq2ue03e5m5p2w6mp8v3dkhq5r39flsftjjsje04wvsdd2k4w" />
  <id>https://nostr.ae/npub1zlxd3xlzjhq2ue03e5m5p2w6mp8v3dkhq5r39flsftjjsje04wvsdd2k4w</id>
  <icon></icon>
  <logo></logo>




  <entry>
    <id>https://nostr.ae/nevent1qqsv2qkhhlcwdm4dnf04rwpp7zcx5y4rc03nadpnjktsk0v7l68avxszyqtuekymu22uptn978xnws9fmtvyaj9k6uzswy487p9w22zt974ej7lthu3</id>
    
      <title type="html">📅 Original date posted:2023-01-01 📝 Original message: Happy ...</title>
    
    <link rel="alternate" href="https://nostr.ae/nevent1qqsv2qkhhlcwdm4dnf04rwpp7zcx5y4rc03nadpnjktsk0v7l68avxszyqtuekymu22uptn978xnws9fmtvyaj9k6uzswy487p9w22zt974ej7lthu3" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqs85g3afv7x44h40raajkyy0wvx5gyfky83r43f5x9n8lhsxwjtyvccpx3el&#39;&gt;nevent1q…x3el&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2023-01-01&lt;br/&gt;📝 Original message:&lt;br/&gt;Happy new year dear fellow Lightning Network Developers,&lt;br/&gt;&lt;br/&gt;last month I have made a small observation why we probably should at most&lt;br/&gt;progress EITHER with `negative fees` [1] OR `upfront fees` [2] but not with&lt;br/&gt;BOTH as adding both features to the protocol would result in a potentially&lt;br/&gt;lucrative attack that I will describe here.&lt;br/&gt;&lt;br/&gt;Assumption:&lt;br/&gt;=========&lt;br/&gt;&lt;br/&gt;For simplicity of the argument please assume all nodes do payment delivery&lt;br/&gt;by optimizing purely for fees instead of probabilistic payment delivery or&lt;br/&gt;a combination of these two and potentially other features in their cost&lt;br/&gt;function. The Argument will however work as long as fees are part of the&lt;br/&gt;cost function.&lt;br/&gt;&lt;br/&gt;The Attack:&lt;br/&gt;=========&lt;br/&gt;&lt;br/&gt;1. Malory sets the routing fees of her channel(s) sufficiently negative.&lt;br/&gt;2. Now the cheapest route for all possible payment pairs on the network&lt;br/&gt;goes through Malory.&lt;br/&gt;3. Malory will accept any incoming HTLC but will shortly after the HTLC is&lt;br/&gt;locked in fail the payment without forwarding.&lt;br/&gt;( 4. Depending on the design of upfront fees she may need a collaborating&lt;br/&gt;proxy node)&lt;br/&gt;&lt;br/&gt;Outcome:&lt;br/&gt;========&lt;br/&gt;&lt;br/&gt;1. After announcing the negative routing fees every node that has seen the&lt;br/&gt;`channel_update`  will route through Malory if initiating a payment. This&lt;br/&gt;effectively redirects the entire traffic of the network through her node.&lt;br/&gt;2. Malory has create a DoS attack on her own node but depending on the size&lt;br/&gt;of the network she will not even see it as her channel partners will go&lt;br/&gt;down from the DoS first (or she is able to handle the traffic as she was&lt;br/&gt;prepared)&lt;br/&gt;3. Assuming Malory has enough Channel partners (or collaborates with them)&lt;br/&gt;she can collect the tiny unconditional upfront fees (Depending on the price&lt;br/&gt;of the upfront fees, the size of the network and the base load of payments&lt;br/&gt;per second this may or may not be lucrative)&lt;br/&gt;&lt;br/&gt;Also as her fees were so negative most nodes might not even blame her for&lt;br/&gt;the routing failures as they might assume others were just more quickly&lt;br/&gt;sniping that juicy liquidity. Yet Alice has collected some upfront fees of&lt;br/&gt;all payments that are going on at that time.&lt;br/&gt;&lt;br/&gt;Some thoughts about mitigation strategies:&lt;br/&gt;=================================&lt;br/&gt;&lt;br/&gt;## Working:&lt;br/&gt;* Choose weather to progress with either negative fees or upfront fees will&lt;br/&gt;stop this particular problem to come up.&lt;br/&gt;&lt;br/&gt;## Probably not working:&lt;br/&gt;* Forcing channels with negative fees to set the the upfront fee negative&lt;br/&gt;will not work. This is effectively handing out free money to the channel&lt;br/&gt;partner: As soon as someone announces negative fees the channel partner&lt;br/&gt;will send out fake payments and earn the negative upfront fee.&lt;br/&gt;* Allow `channel_updates` only to be relayed from connections that maintain&lt;br/&gt;a channel so that Mallory cannot quickly inform the entire network about&lt;br/&gt;being the most central node by connecting to everyone may help in&lt;br/&gt;combination with rate limiting of payments and reputation ideas but I guess&lt;br/&gt;others are more experienced than me with reputation systems. Also I think&lt;br/&gt;new participants need `channel_updates` even if they don&amp;#39;t have channels&lt;br/&gt;yet.&lt;br/&gt;&lt;br/&gt;Own thoughts:&lt;br/&gt;===========&lt;br/&gt;&lt;br/&gt;As many of you know I am currently writing a paper about the fundamental&lt;br/&gt;limitations of the scaling abilities of the Lightning Network to conduct&lt;br/&gt;Bitcoin payments [3]. Most folks I talk to see deliberate and malicious&lt;br/&gt;channel jamming as a problem. While I agree with the problem I think the&lt;br/&gt;situation is worse. It is my current understanding that natural congestion&lt;br/&gt;resulting from the selfish behavior of both sending and routing nodes will&lt;br/&gt;be a huge challenge for the network. This is amplified by the uncertainty&lt;br/&gt;(for example about liquidity). However, even without uncertainty it will&lt;br/&gt;create an upper boundary of how many payments per second the participants&lt;br/&gt;of the network will be able to conduct. This boundary is more or less given&lt;br/&gt;by the weighted betweenness centrality of the most central node and the&lt;br/&gt;routing throughput that this node is able to handle. More on this is soon&lt;br/&gt;to come here...&lt;br/&gt;&lt;br/&gt;That being said, independently of the up-front fees it seems to me that&lt;br/&gt;allowing negative fees tend to increase centralization effects and thus the&lt;br/&gt;price of anarchy and natural congestion. Yet I can&amp;#39;t quantify this at this&lt;br/&gt;time and thus I don&amp;#39;t know yet if this fundamentally speaks against&lt;br/&gt;negative fees. However as discussed above in combination with upfront fees&lt;br/&gt;there seems to be an economic incentive to abuse both together.&lt;br/&gt;&lt;br/&gt;Thanks to Christian Decker for spotting an error in an edge cases when I&lt;br/&gt;initially presented him a similar argument for review.&lt;br/&gt;&lt;br/&gt;with kind regards Rene Pickhardt&lt;br/&gt;&lt;br/&gt;[1]&lt;br/&gt;&lt;a href=&#34;https://lists.linuxfoundation.org/pipermail/lightning-dev/2022-September/003685.html&#34;&gt;https://lists.linuxfoundation.org/pipermail/lightning-dev/2022-September/003685.html&lt;/a&gt;&lt;br/&gt;[2]&lt;br/&gt;&lt;a href=&#34;https://lists.linuxfoundation.org/pipermail/lightning-dev/2022-November/003740.html&#34;&gt;https://lists.linuxfoundation.org/pipermail/lightning-dev/2022-November/003740.html&lt;/a&gt;&lt;br/&gt;[3] &lt;a href=&#34;https://twitter.com/renepickhardt/status/1605189724293169153&#34;&gt;https://twitter.com/renepickhardt/status/1605189724293169153&lt;/a&gt;&lt;br/&gt;-------------- next part --------------&lt;br/&gt;An HTML attachment was scrubbed...&lt;br/&gt;URL: &amp;lt;&lt;a href=&#34;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20230101/7e0f200b/attachment.html&amp;gt&#34;&gt;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20230101/7e0f200b/attachment.html&amp;gt&lt;/a&gt;;
    </content>
    <updated>2023-06-09T15:07:46&#43;02:00</updated>
  </entry>

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

  <entry>
    <id>https://nostr.ae/nevent1qqsyxkflk9zulvmwkn4hrczzkt46fs9sytajcfkg2cwwym6s45ghfqszyqtuekymu22uptn978xnws9fmtvyaj9k6uzswy487p9w22zt974ejyjy4rg</id>
    
      <title type="html">📅 Original date posted:2022-09-22 📝 Original message: Good ...</title>
    
    <link rel="alternate" href="https://nostr.ae/nevent1qqsyxkflk9zulvmwkn4hrczzkt46fs9sytajcfkg2cwwym6s45ghfqszyqtuekymu22uptn978xnws9fmtvyaj9k6uzswy487p9w22zt974ejyjy4rg" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqsw5pekx62s4x02cjpfg95mftnd5vusrgwks6xw9z92y5jtdntyecsp0a5s9&#39;&gt;nevent1q…a5s9&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2022-09-22&lt;br/&gt;📝 Original message:&lt;br/&gt;Good morning fellow Lightning Developers,&lt;br/&gt;&lt;br/&gt;I am pleased to share my most recent research results [1] with you. They&lt;br/&gt;may (if at all) only have a small impact on protocol development /&lt;br/&gt;specification but are actually mainly of concern to node operators and&lt;br/&gt;LSPs. I still thought they may be relevant for the list.&lt;br/&gt;&lt;br/&gt;While trying to estimate the expected liquidity distribution in depleted&lt;br/&gt;channels due to drain via Markov Models I realized that we can exploit the&lt;br/&gt;`htlc_maxium_msat` setting to act as a control valve and regulate the&lt;br/&gt;&amp;#34;pressure&amp;#34; coming from the drain and mitigate the depletion of channels.&lt;br/&gt;Such ideas are btw not novel at all and heavily used in fluid networks [2].&lt;br/&gt;Thus it seems very natural that we do the same on the Lightning Network.&lt;br/&gt;&lt;br/&gt;In the article we show within a theoretic model how expected payment&lt;br/&gt;failure rates per channel may drop significantly by up to an order of&lt;br/&gt;magnitude if channels set up proper asymmetric `htlc_maximum_msat` pairs.&lt;br/&gt;&lt;br/&gt;We furthermore provide in our iPython notebook [3] two experimental&lt;br/&gt;algorithmic ideas with which node operators can find decent&lt;br/&gt;`htlc_maximum_msat` values in a greedy fashion. One of the algorithms does&lt;br/&gt;not even require to know the drain or payment size distribution or build&lt;br/&gt;the Markov model but just looks at the liquidity distribution in the&lt;br/&gt;channel at the last x routing attempts and adjusts the `htlc_maximum_msat`&lt;br/&gt;value if the distribution is to far away from a uniform distribution.&lt;br/&gt;&lt;br/&gt;Looking forwards for your thoughts and feedback.&lt;br/&gt;&lt;br/&gt;with kind regards Rene&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;[1]:&lt;br/&gt;&lt;a href=&#34;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/&#34;&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/&lt;/a&gt;&lt;br/&gt;[2]: &lt;a href=&#34;https://en.wikipedia.org/wiki/Control_valve&#34;&gt;https://en.wikipedia.org/wiki/Control_valve&lt;/a&gt;&lt;br/&gt;[3]:&lt;br/&gt;&lt;a href=&#34;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&#34;&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&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;-- &lt;br/&gt;&lt;a href=&#34;https://ln.rene-pickhardt.de&#34;&gt;https://ln.rene-pickhardt.de&lt;/a&gt;&lt;br/&gt;-------------- next part --------------&lt;br/&gt;An HTML attachment was scrubbed...&lt;br/&gt;URL: &amp;lt;&lt;a href=&#34;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20220922/a895d1a1/attachment.html&amp;gt&#34;&gt;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20220922/a895d1a1/attachment.html&amp;gt&lt;/a&gt;;
    </content>
    <updated>2023-06-09T15:06:51&#43;02:00</updated>
  </entry>

  <entry>
    <id>https://nostr.ae/nevent1qqs84x9dvpha5fn2c299zqucm7qrzmuh76mmvtjz5g2utjpjq60tftszyqtuekymu22uptn978xnws9fmtvyaj9k6uzswy487p9w22zt974ejgf3mp3</id>
    
      <title type="html">📅 Original date posted:2022-08-25 📝 Original message: Dear ...</title>
    
    <link rel="alternate" href="https://nostr.ae/nevent1qqs84x9dvpha5fn2c299zqucm7qrzmuh76mmvtjz5g2utjpjq60tftszyqtuekymu22uptn978xnws9fmtvyaj9k6uzswy487p9w22zt974ejgf3mp3" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqsx54vf795jpwq9pflrt2uxw9rnq5y3rflq8w0nawxf02q9tm5fgscrgylgw&#39;&gt;nevent1q…ylgw&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2022-08-25&lt;br/&gt;📝 Original message:&lt;br/&gt;Dear fellow Lightning Developers,&lt;br/&gt;&lt;br/&gt;I was recently on an event where the visitors have been gifted 10k sats on&lt;br/&gt;a custodial wallet. They could spend those sats via some web interface and&lt;br/&gt;an NFC card. During the event I was contacted by several plebs who were&lt;br/&gt;confused about one particular thing:&lt;br/&gt;&lt;br/&gt;It was impossible for them to withdraw the full amount from the service.&lt;br/&gt;&lt;br/&gt;Pasting an invoice for 10k sats would not work as the custodial service&lt;br/&gt;required a fee budget of 1%. However if people submitted an invoice for&lt;br/&gt;9900 sats the remaining 100 sats were usually not fully required for the&lt;br/&gt;fees. Thus the users may have had a leftover of for example 67 sats. Now&lt;br/&gt;the problem repeated on the residual amount. While some services seem to&lt;br/&gt;have a drain feature for such a situation I find this frustrating and was&lt;br/&gt;wondering if we could help directly on a protocol level.&lt;br/&gt;&lt;br/&gt;Here is my proposal for a simple solution to this specific problem:&lt;br/&gt;`option_recipient_pays_routing_fees`&lt;br/&gt;&lt;br/&gt;This would be a new flag in invoices signaling that the recipient is&lt;br/&gt;willing to pay for the routing fees by releasing the preimage even if the&lt;br/&gt;full amount has not been arrived in htlcs at the recipient.&lt;br/&gt;&lt;br/&gt;So the workflow would be the following:&lt;br/&gt;&lt;br/&gt;1. Alice creates an invoice for 10k sats setting the&lt;br/&gt;`option_recipient_pays_routing_fees` flag in the invoice and passes it&lt;br/&gt;either to custodial user Bob or to her own custodial account.&lt;br/&gt;2. The payer parses the invoice and searches for a payment path or payment&lt;br/&gt;flow to Alice.&lt;br/&gt;3. Because `option_recipient_pays_routing_fee` is set, the onion is not&lt;br/&gt;constructed in a way that the final HTLC will be for the amount of 10k sats&lt;br/&gt;but rather in a way that the first htlc will be for 10k sats and the&lt;br/&gt;following HTLCs will be of decreasing value so that routing nodes are&lt;br/&gt;compensated properly.&lt;br/&gt;4. When the HTLC(s) arrive at Alice she will release the preimage if and&lt;br/&gt;only if not too many sats (e.g. 1% of the amount) are missing. Of course it&lt;br/&gt;would be good if the 1% was not hard coded in the protocol / software but&lt;br/&gt;configurable by Alice at the time of invoice creation.&lt;br/&gt;&lt;br/&gt;I think the main issue with this proposal is that instead of confusing&lt;br/&gt;users who wish to drain an account we may now have to educate users about&lt;br/&gt;two different invoice types. On the other hand I think this can probably&lt;br/&gt;easily be achieved via the current wide spread user interfaces. Of course&lt;br/&gt;it may be nice to have folks from the Bitcoin Design community to join this&lt;br/&gt;specific part of the discussion.&lt;br/&gt;&lt;br/&gt;With kind regards Rene Pickhardt&lt;br/&gt;-- &lt;br/&gt;&lt;a href=&#34;https://www.rene-pickhardt.de&#34;&gt;https://www.rene-pickhardt.de&lt;/a&gt;&lt;br/&gt;-------------- next part --------------&lt;br/&gt;An HTML attachment was scrubbed...&lt;br/&gt;URL: &amp;lt;&lt;a href=&#34;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20220825/400b3ecc/attachment.html&amp;gt&#34;&gt;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20220825/400b3ecc/attachment.html&amp;gt&lt;/a&gt;;
    </content>
    <updated>2023-06-09T15:06:43&#43;02:00</updated>
  </entry>

  <entry>
    <id>https://nostr.ae/nevent1qqsxp064dx5feemvxh56lyaqu6vzqw43wczvhf92upgrj959g9d65mgzyqtuekymu22uptn978xnws9fmtvyaj9k6uzswy487p9w22zt974ej5azdkg</id>
    
      <title type="html">📅 Original date posted:2022-06-08 📝 Original message: Dear ...</title>
    
    <link rel="alternate" href="https://nostr.ae/nevent1qqsxp064dx5feemvxh56lyaqu6vzqw43wczvhf92upgrj959g9d65mgzyqtuekymu22uptn978xnws9fmtvyaj9k6uzswy487p9w22zt974ej5azdkg" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqspeqsjc9kz6ge8ah99tq6rraw9qttps3fcwr4ulllwwcn4a53cs9sqxk6mf&#39;&gt;nevent1q…k6mf&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2022-06-08&lt;br/&gt;📝 Original message:&lt;br/&gt;Dear Tony,&lt;br/&gt;&lt;br/&gt;Thank you for putting emphasis on this. I was actually waiting for someone&lt;br/&gt;to publicly exploit this.&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&amp;gt; The reason this is possible is because [...] currently channel IDs are&lt;br/&gt;&amp;gt; based on UTXO&amp;#39;s. Scid aliases may be the biggest benefit here, but the use&lt;br/&gt;&amp;gt; of `unknown_next_peer` , `invalid_onion_hmac`,  `incorrect_cltv_expiry`,&lt;br/&gt;&amp;gt; and `amount_below_minimum` have been the biggest helpers in exploiting&lt;br/&gt;&amp;gt; channel privacy.&lt;br/&gt;&amp;gt;&lt;br/&gt;&lt;br/&gt;Just for reference the exploit with short_channel_ids is known since 2019:&lt;br/&gt;&lt;br/&gt;&lt;a href=&#34;https://github.com/lightning/bolts/issues/675&#34;&gt;https://github.com/lightning/bolts/issues/675&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;Though it is nice you point out explicitly the use of error codes of&lt;br/&gt;onions.&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&amp;gt; By creating a probe guessing the Channel ID based on unspent p2wsh&lt;br/&gt;&amp;gt; transactions, it&amp;#39;s a `m * n` problem to probe the entire network, where `m`&lt;br/&gt;&amp;gt; is utxos and `n` is nodes.&lt;br/&gt;&amp;gt;&lt;br/&gt;&lt;br/&gt;It is the main reason why I didn&amp;#39;t do this. Though similar to you probing&lt;br/&gt;ACINQ&amp;#39;s node one could probabilistically learn which nodes tend to have&lt;br/&gt;unannounced channels and gain some speedup by probing those nodes first.&lt;br/&gt;&lt;br/&gt;Also wallets tend to have poor utxo management. So looking at the on-chain&lt;br/&gt;signal one can probably guess for a p2wsh to which two nodes it might&lt;br/&gt;belong and try them first.&lt;br/&gt;&lt;br/&gt;These two strategies should reduce the number of tested nodes for a newly&lt;br/&gt;seen p2wsh output significantly and probably make it feasible to probe the&lt;br/&gt;network as new blocks come in.&lt;br/&gt;&lt;br/&gt;With kind regards Rene Pickhardt&lt;br/&gt;-------------- next part --------------&lt;br/&gt;An HTML attachment was scrubbed...&lt;br/&gt;URL: &amp;lt;&lt;a href=&#34;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20220608/08a200ad/attachment.html&amp;gt&#34;&gt;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20220608/08a200ad/attachment.html&amp;gt&lt;/a&gt;;
    </content>
    <updated>2023-06-09T15:06:12&#43;02:00</updated>
  </entry>

  <entry>
    <id>https://nostr.ae/nevent1qqs0qd8t4ttlgv5nufsrgjgdgl4zcvwmpualcj94rdz47e3ku52qlwszyqtuekymu22uptn978xnws9fmtvyaj9k6uzswy487p9w22zt974ejcp5n8u</id>
    
      <title type="html">📅 Original date posted:2022-03-14 📝 Original message: Dear ...</title>
    
    <link rel="alternate" href="https://nostr.ae/nevent1qqs0qd8t4ttlgv5nufsrgjgdgl4zcvwmpualcj94rdz47e3ku52qlwszyqtuekymu22uptn978xnws9fmtvyaj9k6uzswy487p9w22zt974ejcp5n8u" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqstna0p3nxx3lt2lyay965xfmenwlhd3uf58agt39retgfjjfz2krsn6yc3m&#39;&gt;nevent1q…yc3m&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2022-03-14&lt;br/&gt;📝 Original message:&lt;br/&gt;Dear Carsten and fellow lightning developers,&lt;br/&gt;&lt;br/&gt;thanks for going into such detail and discovering some of the minor&lt;br/&gt;inaccuracies of my very rough piecewise linearization!&lt;br/&gt;&lt;br/&gt;On Mon, Mar 14, 2022 at 1:53 PM Carsten Otto &amp;lt;bitcoin at c-otto.de&amp;gt; wrote:&lt;br/&gt;&lt;br/&gt;&amp;gt; 1.2) The Mission Control information provided by lnd [...]&lt;br/&gt;&amp;gt; &amp;gt; I think you talk a about a maximum available balance of a channel (and&lt;br/&gt;&amp;gt; not&lt;br/&gt;&amp;gt; &amp;gt; min available balance)?&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Yes, although MC also has information about &amp;#34;known&amp;#34; amounts (due to&lt;br/&gt;&amp;gt; failures that only happened further down the road).&lt;br/&gt;&amp;gt;&lt;br/&gt;&lt;br/&gt;I am unsure how mission control stores and handles that data. In my&lt;br/&gt;understanding they are mainly interested in a statistic of the ratio of&lt;br/&gt;successfull payments over the past X attempts on a channel given a certain&lt;br/&gt;time interval. But I assume they should have all the relevant data to&lt;br/&gt;produce a proper conditional proability to utilize our learnt knowledge.&lt;br/&gt;&lt;br/&gt;In any case from the probabilistic model we can do it mathematically&lt;br/&gt;precise by just looking at the conditional probabilities. As said I have&lt;br/&gt;written hands on instructions in the rust repo&lt;br/&gt;&lt;a href=&#34;https://github.com/lightningdevkit/rust-lightning/issues/1170#issuecomment-972396747&#34;&gt;https://github.com/lightningdevkit/rust-lightning/issues/1170#issuecomment-972396747&lt;/a&gt;&lt;br/&gt;and&lt;br/&gt;they have been fully implemented in&lt;br/&gt;&lt;a href=&#34;https://github.com/lightningdevkit/rust-lightning/pull/1227&#34;&gt;https://github.com/lightningdevkit/rust-lightning/pull/1227&lt;/a&gt;. Also in our&lt;br/&gt;mainnet test and simulations we have updated the priors according to those&lt;br/&gt;rules and this revealed the full power of the approach.&lt;br/&gt;&lt;br/&gt;To summarize: Basically we need to know the effective uncertainty by only&lt;br/&gt;looking at the effective amount that goes above the minimum certain&lt;br/&gt;liquidity (that we might know from a prior attempt) and the effective&lt;br/&gt;capacity (somebody recently suggested that conditional capacity might be a&lt;br/&gt;better wording)&lt;br/&gt;&lt;br/&gt;&amp;gt; Assuming that routing nodes indeed do so we would have learnt that neither&lt;br/&gt;&amp;gt; &amp;gt; channel has an effective capacity of N. So the combined virtual channel&lt;br/&gt;&amp;gt; &amp;gt; could be seen as 2N-1.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; You mean 2(N-1) = 2N-2?&lt;br/&gt;&amp;gt;&lt;br/&gt;&lt;br/&gt;Probably though the difference would be neglectable and if I understood you&lt;br/&gt;correctly you will just keep parallel channels separate anyway.&lt;br/&gt;&lt;br/&gt;&amp;gt; &amp;gt; 4) Leftovers after Piecewise Linearization&lt;br/&gt;&amp;gt; &amp;gt; I am not sure if I understand your question / issue here. The splitting&lt;br/&gt;&amp;gt; &amp;gt; works by selecting N points on the domain of the function and splitting&lt;br/&gt;&amp;gt; the&lt;br/&gt;&amp;gt; &amp;gt; domain into segments at those points. This should never leave sats over.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; With quantization of 10,000 a channel of size 123,456 ends up as an arc&lt;br/&gt;&amp;gt; with a capacity of 12 units. Cutting this into 5 pieces gives us&lt;br/&gt;&amp;gt; 5*2 with 2 units not ending up in any of those pieces. Or am I missing&lt;br/&gt;&amp;gt; something here, and we should split into 5 pieces of size 2.4 = 12/5?&lt;br/&gt;&amp;gt;&lt;br/&gt;&lt;br/&gt;Your observation is correct! Indeed I think my code rounds down the&lt;br/&gt;capacity instead of going to the correct points and using all of the&lt;br/&gt;capacity in the segmentation by making some channels 1 unit larger than&lt;br/&gt;others which would happen if actually finding points on the domain to build&lt;br/&gt;the segments. This could easily be fixed. However as always: Fully&lt;br/&gt;saturated channels mean very low probabilities so even in my situation&lt;br/&gt;where I may cut off a significant part of the channel I&amp;#39;d say in the&lt;br/&gt;extreme case where we would need to saturate even those sats the flow will&lt;br/&gt;and should most likely fail as the min cust is probably just lower than the&lt;br/&gt;amount we would attempt to send. Probably opening a new channel or doing an&lt;br/&gt;on chain transaction will be more useful. Though of course we should build&lt;br/&gt;the piecewise linearization correctly by the end of the day without&lt;br/&gt;throughing away some capacity.&lt;br/&gt;&lt;br/&gt;&amp;gt; If the quantization however makes a channel so small  that we cannot&lt;br/&gt;&amp;gt; &amp;gt; even create 5 (or N) disjoint segments then I guess the likelihood for&lt;br/&gt;&amp;gt; &amp;gt; being included into the final result is too small anyway.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; It may not be very likely, but flat-out ignoring 20k sat (in my&lt;br/&gt;&amp;gt; contrived example above) or up to 4*quantization sats (which is the case&lt;br/&gt;&amp;gt; you described) doesn&amp;#39;t feel right.&lt;br/&gt;&amp;gt;&lt;br/&gt;&lt;br/&gt;See above. I agree it is not 100% accurate. but in practice I doubt it&lt;br/&gt;would ever become a problem as this will only be an issue when the payment&lt;br/&gt;amount is very close to the min cut which would make flows so unlikely to&lt;br/&gt;begin with that we would use other ways to conduct the payment anyway.&lt;br/&gt;&lt;br/&gt;witch kind regards Rene&lt;br/&gt;-------------- next part --------------&lt;br/&gt;An HTML attachment was scrubbed...&lt;br/&gt;URL: &amp;lt;&lt;a href=&#34;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20220314/0f59c122/attachment.html&amp;gt&#34;&gt;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20220314/0f59c122/attachment.html&amp;gt&lt;/a&gt;;
    </content>
    <updated>2023-06-09T15:05:32&#43;02:00</updated>
  </entry>

  <entry>
    <id>https://nostr.ae/nevent1qqsqrnxqprrafjc66hyz34du0uqp3pjqlex5ewv5mzquy4tznjyjyyszyqtuekymu22uptn978xnws9fmtvyaj9k6uzswy487p9w22zt974ej884tdk</id>
    
      <title type="html">📅 Original date posted:2022-03-14 📝 Original message: Dear ...</title>
    
    <link rel="alternate" href="https://nostr.ae/nevent1qqsqrnxqprrafjc66hyz34du0uqp3pjqlex5ewv5mzquy4tznjyjyyszyqtuekymu22uptn978xnws9fmtvyaj9k6uzswy487p9w22zt974ej884tdk" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqsqgflkx6fwtqqzyxctcr2vg3ettgw6pm4ye9tulh34cguagnxgsvgyz8eas&#39;&gt;nevent1q…8eas&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2022-03-14&lt;br/&gt;📝 Original message:&lt;br/&gt;Dear Carsten, Martin and fellow lightning developers,&lt;br/&gt;&lt;br/&gt;first of all thank you very much for independently verifying and&lt;br/&gt;acknowledging my recent findings about the runtime of finding a pieceweise&lt;br/&gt;linearized approximation to the min cost flow problem, for working on&lt;br/&gt;integrating them into lnd-manageJ and for your excellent questions &amp;amp;&lt;br/&gt;thoughts.&lt;br/&gt;&lt;br/&gt;On Sun, Mar 13, 2022 at 8:17 PM Carsten Otto via Lightning-dev &amp;lt;&lt;br/&gt;lightning-dev at lists.linuxfoundation.org&amp;gt; wrote:&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&amp;gt; 1) What&amp;#39;s the reasoning behind combining parallel channels?&lt;br/&gt;&amp;gt;&lt;br/&gt;&lt;br/&gt;Generally speaking this is pure pragmatism on my end to simplify my life as&lt;br/&gt;handling parallel channels in some cases blows up complexity of code and&lt;br/&gt;simulations. However I think from a probabilistic point of view ( see below&lt;br/&gt;) the combination is more accurate to reflect the actual likelihood that&lt;br/&gt;the liquidity is available.&lt;br/&gt;&lt;br/&gt;I agree that parallel channels make things a lot more complicated, but I&lt;br/&gt;&amp;gt; also see the benefit from a node operator&amp;#39;s point of view. That being&lt;br/&gt;&amp;gt; said, wouldn&amp;#39;t it suffice to treat parallel channels individually?&lt;br/&gt;&amp;gt;&lt;br/&gt;&lt;br/&gt;I think that should work and especially when including fees to the cost&lt;br/&gt;function and considering how nodes handle routing requests on parallel&lt;br/&gt;channels we might have to do so anyway. The suggested flows will probably&lt;br/&gt;change in a way that disfavors parallel channels even if their virtual&lt;br/&gt;capacity is larger than an alternative single channel (see below)&lt;br/&gt;&lt;br/&gt;1.1) A payment of size 2 needs to be split into 1&#43;1 to fit through&lt;br/&gt;&amp;gt; parallel channels of size 1&#43;1. Combining the 1&#43;1 channels into a virtual&lt;br/&gt;&amp;gt; channel of size 2 only complicates the code that has to do come up with&lt;br/&gt;&amp;gt; a MPP that doesn&amp;#39;t over-saturate the actual channels. On the other hand,&lt;br/&gt;&amp;gt; I don&amp;#39;t think the probability for the virtual channel of size 2 is more&lt;br/&gt;&amp;gt; realistic than reasoning about two individual channels and their&lt;br/&gt;&amp;gt; probabilities - but I didn&amp;#39;t even try to see the math behind that.&lt;br/&gt;&amp;gt; Please prove me wrong? :)&lt;br/&gt;&amp;gt;&lt;br/&gt;&lt;br/&gt;* The likelihood that a 1 Satoshi capacity channel has 1 Satoshi to route&lt;br/&gt;is 1/2.&lt;br/&gt;* The likelihood that 2 channels of capacity 1 have each 1 satoshi&lt;br/&gt;available to route is 1/2*1/2 = 1/4&lt;br/&gt;* Combining both parallel channels to one virtual channel of capacity 2 and&lt;br/&gt;asking if 2 satoshis are available to route gives a likelihood of 1/3 which&lt;br/&gt;is larger than 1/4.&lt;br/&gt;&lt;br/&gt;However I believe in practice one cannot just send a 2 satoshi onion and&lt;br/&gt;expect the routing node to split the amount  correctly / accordingly&lt;br/&gt;between the two parallel channels. (I might be wrong here). So in that case&lt;br/&gt;modelling and computing probabilities for parallel channels might be&lt;br/&gt;necessary anyway though the math indicates that splitting liquidity in&lt;br/&gt;parallel channels will get you selected less frequently for routing.&lt;br/&gt;&lt;br/&gt;1.2) The Mission Control information provided by lnd can be used to&lt;br/&gt;&amp;gt; place a minimum available balance on each of the parallel channels. If&lt;br/&gt;&amp;gt; we know that node A isn&amp;#39;t able to forward N sats to node B, we can treat&lt;br/&gt;&amp;gt; all parallel channels between A and B (in that direction) to have a&lt;br/&gt;&amp;gt; capacity of at most N-1 sats. How would this look like if we combined&lt;br/&gt;&amp;gt; the parallel channels into a virtual one? Note that it may still be&lt;br/&gt;&amp;gt; possible to route two individual payments/onions of size N-1 sats from A&lt;br/&gt;&amp;gt; to B, given two parallel channels with that many sats on A&amp;#39;s side.&lt;br/&gt;&amp;gt;&lt;br/&gt;&lt;br/&gt;I think you talk a about a maximum available balance of a channel (and not&lt;br/&gt;min available balance)?&lt;br/&gt;In the case of parallel channels I am not even sure if such information is&lt;br/&gt;accurate as it is my understanding that the routing node may decide to use&lt;br/&gt;the parallel channel to forward the amount even though the other channel&lt;br/&gt;was specified in the onion.&lt;br/&gt;Assuming that routing nodes indeed do so we would have learnt that neither&lt;br/&gt;channel has an effective capacity of N. So the combined virtual channel&lt;br/&gt;could be seen as 2N-1. However if routing nodes don&amp;#39;t locally split a&lt;br/&gt;forwarding request across both channels we would know that calaculating&lt;br/&gt;with 2N-1 is bad as a request of N could not be fulfilled. I guess it is&lt;br/&gt;for the implementations that support parallel channels to figure out the&lt;br/&gt;details here.&lt;br/&gt;&lt;br/&gt;2) Optimal Piecewise Linearization&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; See Twitter [3].&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Is it worth it cutting a channel into pieces of different sizes, instead&lt;br/&gt;&amp;gt; of just having (as per your example) 5 pieces of the same size? If it&lt;br/&gt;&amp;gt; makes a noticeable difference, adding some complexity to the code might&lt;br/&gt;&amp;gt; be worth it.&lt;br/&gt;&amp;gt;&lt;br/&gt;&lt;br/&gt;I will certainly do experiments or be happy if others are faster to do them&lt;br/&gt;which compare the quality of the approximation with optimal piecewise&lt;br/&gt;linearization to my choice of fixed intervals and the selection of various&lt;br/&gt;numbers of segments. As long as we don&amp;#39;t have numbers it is hard to guess&lt;br/&gt;if it is worthwhile adding the complexity. Looking at the current results&lt;br/&gt;it seems that my (geometricly motivated but) arbitrary choice might end up&lt;br/&gt;to be good and easy enough. However we might very well see quite an&lt;br/&gt;improvement of the approximation if we find better piecewise linearizations.&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&amp;gt; 3) Size of Piecewise Linearization&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; My gut feeling is that cutting a 1 BTC channel into 5 pieces is&lt;br/&gt;&amp;gt; different from cutting a 0.01 BTC channel into 5 pieces. Would it make&lt;br/&gt;&amp;gt; sense to use different values of N depending on the channel size?&lt;br/&gt;&amp;gt;&lt;br/&gt;&lt;br/&gt;The main difference here is that a channel of 1 BTC is highly preferable&lt;br/&gt;from a probabilistic payment delivery perspective over a channel of 0.01&lt;br/&gt;BTC. Even approximating the 1 BTC channel with 1000 intervalls of 0.001 BTC&lt;br/&gt;should still have a lower unit cost in all pieces of the first 0.01 BTC of&lt;br/&gt;the liquidity than the first piece of the 0.01 BTC channel. So I think&lt;br/&gt;splitting all channels in the equal number of pieces is pretty well&lt;br/&gt;motivated but let me elaborate on this:&lt;br/&gt;&lt;br/&gt;The motivation of splitting all channels into the same number of pieces&lt;br/&gt;comes from the observation that from a probabilistic point of view (and&lt;br/&gt;very roughly speaking!) we want to find a flow that puts the same (high)&lt;br/&gt;success probability on all edges. Using 20% of the capacity gives an 80%&lt;br/&gt;probability that the liquidity is available. This in turn has a 51.2%&lt;br/&gt;chance to be successful on a three hop path which in my experience is a&lt;br/&gt;good probability to aim for as on average one is expected to need two&lt;br/&gt;attempts. Since the linearized pieces - if included in the flow - tend to&lt;br/&gt;be fully saturated I decided that it makes sense to put them in 5 buckets&lt;br/&gt;of 20% each. If you read the code carefully I don&amp;#39;t even approximate the&lt;br/&gt;cost correctly at the 2nd, 3rd, 4th and 5th piece. I just multiplied the&lt;br/&gt;linearized unit cost of the first piece with 2,3,4 and 5 respectively Which&lt;br/&gt;approximates the negative log probability with a quadratic cost function.&lt;br/&gt;But as we can see those geometrically motivated choices work already pretty&lt;br/&gt;well. Again I plan to invest more time to find a better approximation and&lt;br/&gt;we might end up using it. But I don&amp;#39;t expect too much gain from doing so.&lt;br/&gt;&lt;br/&gt; If you look at the output of the flow in the iPython notebook (Which I&lt;br/&gt;will copy to the end of the mail for your convenience) you see that most&lt;br/&gt;channels did not fully saturate the first piece and have a likelihood&lt;br/&gt;between 80% and 100% where as some channels saturated the first piece&lt;br/&gt;producing a likelihood of 80% and few channels saturated also the second&lt;br/&gt;piece giving a likelihood of 60%.&lt;br/&gt;&lt;br/&gt;Thus I expect that the real value from studying the optimal piece wise&lt;br/&gt;linear approximation will give us a better understanding of where to prune&lt;br/&gt;segments away. If we note that in this flow not a single channel used the&lt;br/&gt;third, forth and fifth piece we could have removed 60% of all edges and&lt;br/&gt;doubled the runtime and still compute the same resulting flow.&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&amp;gt; 4) Leftovers after Piecewise Linearization&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; If I cut some channel into N pieces, I might end up with up to N-1 sats&lt;br/&gt;&amp;gt; that don&amp;#39;t end up in any of the N pieces, effectively making the channel&lt;br/&gt;&amp;gt; look smaller than it is. For smaller values of N that&amp;#39;s obviously not an&lt;br/&gt;&amp;gt; issue (given the uncertainty we&amp;#39;re dealing with), but it might be more&lt;br/&gt;&amp;gt; problematic if quantization is used with larger values. Any thoughts on&lt;br/&gt;&amp;gt; this?&lt;br/&gt;&amp;gt;&lt;br/&gt;&lt;br/&gt;I am not sure if I understand your question / issue here. The splitting&lt;br/&gt;works by selecting N points on the domain of the function and splitting the&lt;br/&gt;domain into segments at those points. This should never leave sats over.&lt;br/&gt;The quantization which doesn&amp;#39;t boost the runtime too much anyway happens&lt;br/&gt;before piecewise linearization. So as long as the domain is larger than N&lt;br/&gt;the piecewiese linearization should not bring up a situation where sats are&lt;br/&gt;left over. If the quantization however makes a channel so small  that we&lt;br/&gt;cannot even create 5 (or N) disjoint segments then I guess the likelihood&lt;br/&gt;for being included into the final result is too small anyway. But I agree&lt;br/&gt;that an actual implementation might have to watch out for such edge cases.&lt;br/&gt;&lt;br/&gt;Again this yield interesting pruning opportunities to reduce the seize of&lt;br/&gt;the network before doing the expensive min cost flow computation. For&lt;br/&gt;example I could prune channels with high unit costs on the first segment.&lt;br/&gt;Especially if they are further away from the source and destination node.&lt;br/&gt;This would overall reduce the size of the graph and improve runtime.&lt;br/&gt;Already last July I had a pretty well working heurist that was able to&lt;br/&gt;through away about 90% of all channels and would pretty much always find&lt;br/&gt;the same flow in the pruned network as on the full network. I should really&lt;br/&gt;prioritize the pruning work again now that we have fast solvers.&lt;br/&gt;&lt;br/&gt;5) Fees (and other properties?)&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; How can we integrate fees into the function? I must admit, I haven&amp;#39;t&lt;br/&gt;&amp;gt; even thought about that, yet. A copy-paste answer would be great,&lt;br/&gt;&amp;gt; though! :) Maybe it&amp;#39;s also a good idea to punish channels based on their&lt;br/&gt;&amp;gt; CLTV delta? Ratio of enabled channels? Age? Manual punishment score? ...&lt;br/&gt;&amp;gt;&lt;br/&gt;&lt;br/&gt;plugging in fees (assuming only channels that set a base fee of zero) is&lt;br/&gt;very easy and straight forward.&lt;br/&gt;&lt;br/&gt;Let&amp;#39;s recall from the code that the piecewise linearized unit cost is&lt;br/&gt;computed as follows&lt;br/&gt;&lt;br/&gt;unit_cost = int(max_cap/cap)for i in range(N):&lt;br/&gt;     #arc format is src, dest, capacity, unit_cost&lt;br/&gt;     arcs.append((src,dest,int(cap/(N*QUANTIZATION)),(i&#43;1)*unit_cost))&lt;br/&gt;&lt;br/&gt;As described in our paper for a good (and to be determined) value of \mu we&lt;br/&gt;could just create the linear combination between the two features which&lt;br/&gt;would change the line to:&lt;br/&gt;&lt;br/&gt;     arcs.append((src,dest,int(cap/(N*QUANTIZATION)),(i&#43;1)*unit_cost &#43;&lt;br/&gt;mu*fee_rate_ppm))&lt;br/&gt;&lt;br/&gt;Note two things:&lt;br/&gt;1. the only requirement for the solver to work is that \mu*fee_rate_ppm&lt;br/&gt;needs to be an integer. So in case \mu was smaller than 1 we could also&lt;br/&gt;scale the term from the linearized log probabilities by putting a larger mu&lt;br/&gt;to the feature arising from the cost of the uncertainty.&lt;br/&gt;&lt;br/&gt;     arcs.append((src,dest,int(cap/(N*QUANTIZATION)),mu*(i&#43;1)*unit_cost&lt;br/&gt;&#43; fee_rate_ppm))&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;2. the cost from the routing fees is the same on each segment of the&lt;br/&gt;piecewise linearization which makes a lot of sense because the current&lt;br/&gt;feerate is indeed a unit cost that does not change with how heavily you&lt;br/&gt;plan to use a channel independently how the cost that comes from the&lt;br/&gt;probability grows.&lt;br/&gt;&lt;br/&gt;With respect to other features I guess the entire topic of feature&lt;br/&gt;engineering for our cost function should be a separate threat / topic and&lt;br/&gt;line of research but as you asked I will give you some short thoughts on&lt;br/&gt;this here:&lt;br/&gt;&lt;br/&gt;As pointed out to the c-lightning team in&lt;br/&gt;&lt;a href=&#34;https://github.com/ElementsProject/lightning/pull/4771#issuecomment-930173831&#34;&gt;https://github.com/ElementsProject/lightning/pull/4771#issuecomment-930173831&lt;/a&gt;&lt;br/&gt;and&lt;br/&gt;the following comment I believe that optimizing for CLTV is a poor choice&lt;br/&gt;and in min cost flow computations it might very well be non linear anyway&lt;br/&gt;and thus tricky to include in a meaningful way.Sure one could transform it&lt;br/&gt;to a unit cost by doing something like CLTV*max_cap/cap and add it to the&lt;br/&gt;cost function like the ppm. But I still do not really see why this is&lt;br/&gt;useful. On the other hand I very much believe we should start to&lt;br/&gt;investigate features that predict channel latency to setup / settle an HTLC&lt;br/&gt;as suggested in the last paragraph of this comment&lt;br/&gt;&lt;a href=&#34;https://github.com/lightningdevkit/rust-lightning/issues/1170#issuecomment-972396747&#34;&gt;https://github.com/lightningdevkit/rust-lightning/issues/1170#issuecomment-972396747&lt;/a&gt;&lt;br/&gt;However&lt;br/&gt;I fear that latency measures again are non linear though they could again&lt;br/&gt;be translated to a unit cost with the same trick as the CLTV.&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&amp;gt; 6) Non-Zero Base Fee&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; See Twitter [4].&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; According to Stefan [5] it should be possible to integrate ZmnSCPxj&amp;#39;s ideas&lt;br/&gt;&amp;gt; to make this work with non-zero base fees. How?&lt;br/&gt;&amp;gt; Simpler approach: Twitter [6].&lt;br/&gt;&amp;gt;&lt;br/&gt;&lt;br/&gt;I don&amp;#39;t have much to add to the base fee discussion at this point besides&lt;br/&gt;the emphasize that the above described linearization trick for CLTV or&lt;br/&gt;latency based features will not properly work for the base fee because one&lt;br/&gt;actually has to pay the full base fee at the end - independently of how&lt;br/&gt;much you saturate the channel. This might mess up the optimization.&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&amp;gt; 7) Private Channels&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; [very niche topic, not really that interesting nor urgent]&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; I&amp;#39;m a fan of adding private channels to provide more outbound liquidity,&lt;br/&gt;&amp;gt; mainly to reduce gossip and hide my intentions. If my total liquidity to&lt;br/&gt;&amp;gt; some peer is below the amount announced in public channels, I don&amp;#39;t see&lt;br/&gt;&amp;gt; any meaningful complication. However, I might have a public channel of&lt;br/&gt;&amp;gt; size N and several private channels bringing my local liquidity to some&lt;br/&gt;&amp;gt; value &amp;gt;N. It&amp;#39;s rather obvious that not announcing this fact is a bad&lt;br/&gt;&amp;gt; idea, as any #pickhardtpayments implementation would think I have 0-N on&lt;br/&gt;&amp;gt; my side of the channel(s). Assuming I&amp;#39;m willing to accept this tradeoff,&lt;br/&gt;&amp;gt; do you see other complications or issues with hidden liquidity?&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; My gut feeling is that this isn&amp;#39;t an issue, at all, as channel balances&lt;br/&gt;&amp;gt; change all the time, which is something the algorithm already has to&lt;br/&gt;&amp;gt; deal with.&lt;br/&gt;&amp;gt;&lt;br/&gt;&lt;br/&gt;As you noted from a probabilistic payment delivery point of view I might be&lt;br/&gt;interested in signaling all the liquidity that is being provided between&lt;br/&gt;two peers and I shoot myself if I hide it. That being said you might have&lt;br/&gt;reasons to do so and additionally I never rejected the idea to extend the&lt;br/&gt;current probabilistic model with a probabilistic node or channel provenance&lt;br/&gt;value that would be similar to the ideas in lnd&amp;#39;s mission control or the&lt;br/&gt;routescore by &lt;a href=&#34;https://lnrouter.app&#34;&gt;https://lnrouter.app&lt;/a&gt;. Given the fact that with hidden&lt;br/&gt;liquidity the probabilities are constantly underestimated such a provenance&lt;br/&gt;score will probably be higher than the one of other channels fixing the&lt;br/&gt;&amp;#34;introduced issue&amp;#34; of hidden liquidity&lt;br/&gt;&lt;br/&gt;8) Quality of Approximation&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; There are some problems in computer science that are hard/impossible to&lt;br/&gt;&amp;gt; approximate, in the sense that any kind of deviation from the optimum&lt;br/&gt;&amp;gt; could cause the computed results to be extremely bad. Do you have some&lt;br/&gt;&amp;gt; idea (or proof) that your kind of approximation isn&amp;#39;t causing a major&lt;br/&gt;&amp;gt; issue? I guess a piece-wise linearization with an infinite number of&lt;br/&gt;&amp;gt; pieces corresponds to the optimal result. Given a finite number of&lt;br/&gt;&amp;gt; pieces, how large is the difference to the optimum?&lt;br/&gt;&amp;gt;&lt;br/&gt;&lt;br/&gt;We don&amp;#39;t have to go to infinite to find a solution without error. We can&lt;br/&gt;stay with the finite number that corresponds to the channels capacity and&lt;br/&gt;make segments of 1 satoshi each encoding what this satoshi would actually&lt;br/&gt;cost in the original function (assuming all values in the original function&lt;br/&gt;were integers).&lt;br/&gt;&lt;br/&gt;I have not spent the time to properly express the error in dependence of&lt;br/&gt;the number of segments N or even empirically study its tradeoffs in&lt;br/&gt;practice (as I haven&amp;#39;t even included the optimal piecewise linearization&lt;br/&gt;yet) However the actual flow (see below) as well as the results from Dr.&lt;br/&gt;Martin Berger&lt;br/&gt;&lt;a href=&#34;https://lists.linuxfoundation.org/pipermail/lightning-dev/2022-March/003513.html&#34;&gt;https://lists.linuxfoundation.org/pipermail/lightning-dev/2022-March/003513.html&lt;/a&gt;&lt;br/&gt;indicate&lt;br/&gt;that the error should be possible to be managed and stay small enough in&lt;br/&gt;practice. That being said and as above it certainly makes sense to invest a&lt;br/&gt;bit of time on how to conduct the piecewise linearization properly.&lt;br/&gt;&lt;br/&gt;Output of the computed flow from the iPython notebok with a piece wise&lt;br/&gt;linearization of 5 equal sized segments per channel&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;Planning to deliver 0.50 BTC from 5051(03efccf...) to 13006&lt;br/&gt;(021c97a...) via an approximated optimally reliable payment flow...&lt;br/&gt;&lt;br/&gt;Runtime of flow computation: 0.85 sec&lt;br/&gt;Minimum approximated quadratic cost:  815932&lt;br/&gt;&lt;br/&gt; Arc 			      Flow / Capacity 	probability 	Fee (sats)&lt;br/&gt;5051 -&amp;gt; 8463     	  6700000 / 16777215 	0.600649	8957.900000&lt;br/&gt;5051 -&amp;gt; 3437     	  1800000 / 9000000 	0.800000	2406.600000&lt;br/&gt;5051 -&amp;gt; 9162     	  1240000 / 6200000 	0.800000	1657.880000&lt;br/&gt;5051 -&amp;gt; 14746     	  6700000 / 16777215 	0.600649	8957.900000&lt;br/&gt;5051 -&amp;gt; 14832     	  2000000 / 10000000 	0.800000	2674.000000&lt;br/&gt;6257 -&amp;gt; 14832     	  3350000 / 2411344242 	0.998611	335.100000&lt;br/&gt;14832 -&amp;gt; 12446     	  5350000 / 6200000000 	0.999137	6.350000&lt;br/&gt;7870 -&amp;gt; 6257     	  3350000 / 20000000 	0.832500	34.500000&lt;br/&gt;14746 -&amp;gt; 12446     	  6700000 / 100000000 	0.933000	3350.000000&lt;br/&gt;7914 -&amp;gt; 13006     	  6700000 / 200000000 	0.966500	33501.000000&lt;br/&gt;5051 -&amp;gt; 550     	  3300000 / 15000000 	0.780000	4412.100000&lt;br/&gt;11396 -&amp;gt; 13192     	  6700000 / 1000000000 	0.993300	2010.000000&lt;br/&gt;5051 -&amp;gt; 11396     	  6700000 / 16777215 	0.600649	8957.900000&lt;br/&gt;7199 -&amp;gt; 9162     	  3350000 / 445000000 	0.992472	848.550000&lt;br/&gt;9162 -&amp;gt; 12446     	  16590000 / 3900000000 	0.995746	17.590000&lt;br/&gt;5051 -&amp;gt; 13287     	  2000000 / 10000000 	0.800000	2674.000000&lt;br/&gt;5051 -&amp;gt; 1843     	  6700000 / 16777215 	0.600649	8957.900000&lt;br/&gt;5051 -&amp;gt; 11257     	  3350000 / 16777215 	0.800324	4478.950000&lt;br/&gt;1953 -&amp;gt; 12446     	  2160000 / 750000000 	0.997120	1080.000000&lt;br/&gt;550 -&amp;gt; 1843     	  3300000 / 30000000 	0.890000	1155.000000&lt;br/&gt;12756 -&amp;gt; 12446     	  2000000 / 16775679 	0.880780	301.000000&lt;br/&gt;5051 -&amp;gt; 12756     	  2000000 / 10000000 	0.800000	2674.000000&lt;br/&gt;3437 -&amp;gt; 12446     	  1800000 / 400000000 	0.995500	225.001000&lt;br/&gt;6713 -&amp;gt; 7914     	  6700000 / 200000000 	0.966500	837.501000&lt;br/&gt;11257 -&amp;gt; 7199     	  3350000 / 16777215 	0.800324	663.300000&lt;br/&gt;10914 -&amp;gt; 9162     	  2000000 / 500000000 	0.996000	1000.001000&lt;br/&gt;5051 -&amp;gt; 7870     	  3350000 / 16777215 	0.800324	3.781000&lt;br/&gt;8463 -&amp;gt; 5288     	  6700000 / 500000000 	0.986600	837.501000&lt;br/&gt;2781 -&amp;gt; 10914     	  2000000 / 500000000 	0.996000	401.000000&lt;br/&gt;13192 -&amp;gt; 6713     	  6700000 / 500000000 	0.986600	16750.000000&lt;br/&gt;32 -&amp;gt; 2781     	  2000000 / 210000000 	0.990476	200.000000&lt;br/&gt;5051 -&amp;gt; 9530     	  2160000 / 10811137 	0.800206	2.591000&lt;br/&gt;9530 -&amp;gt; 1953     	  2160000 / 16777215 	0.871254	438.336000&lt;br/&gt;1843 -&amp;gt; 9162     	  10000000 / 300000000 	0.966667	2500.000000&lt;br/&gt;5051 -&amp;gt; 14642     	  2000000 / 10000000 	0.800000	2.431000&lt;br/&gt;14642 -&amp;gt; 13006     	  2000000 / 50000000 	0.960000	6001.000000&lt;br/&gt;13287 -&amp;gt; 32     	  2000000 / 16777215 	0.880791	500.000000&lt;br/&gt;12446 -&amp;gt; 13006     	  34600000 / 200000000 	0.827000	103766.400000&lt;br/&gt;5288 -&amp;gt; 13006     	  6700000 / 100000000 	0.933000	15216.700000&lt;br/&gt;&lt;br/&gt;Probability of entire flow: 0.0032&lt;br/&gt;Total fee: 248793.763 sats&lt;br/&gt;Effective fee rate: 0.498 %&lt;br/&gt;Arcs included in payment flow: 39&lt;br/&gt;&lt;br/&gt;Don&amp;#39;t get confused by a low probability. The first attampt always has&lt;br/&gt;high uncertainty. We will learn fast in each consequitive round.&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;With kind regards Rene Pickhardt&lt;br/&gt;&lt;br/&gt;-- &lt;br/&gt;&amp;gt; Dr. Carsten Otto&lt;br/&gt;&amp;gt; carsten at c-otto.de&lt;br/&gt;&amp;gt; &lt;a href=&#34;https://c-otto.de&#34;&gt;https://c-otto.de&lt;/a&gt;&lt;br/&gt;&amp;gt; _______________________________________________&lt;br/&gt;&amp;gt; Lightning-dev mailing list&lt;br/&gt;&amp;gt; Lightning-dev at lists.linuxfoundation.org&lt;br/&gt;&amp;gt; &lt;a href=&#34;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&#34;&gt;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&lt;/a&gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;-- &lt;br/&gt;&lt;a href=&#34;https://www.rene-pickhardt.de&#34;&gt;https://www.rene-pickhardt.de&lt;/a&gt;&lt;br/&gt;-------------- next part --------------&lt;br/&gt;An HTML attachment was scrubbed...&lt;br/&gt;URL: &amp;lt;&lt;a href=&#34;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20220314/77da14bd/attachment-0001.html&amp;gt&#34;&gt;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20220314/77da14bd/attachment-0001.html&amp;gt&lt;/a&gt;;
    </content>
    <updated>2023-06-09T15:05:31&#43;02:00</updated>
  </entry>

  <entry>
    <id>https://nostr.ae/nevent1qqsg0m8l9sfdgxhqvpv2fv8wyz4f5v63e58fa3k4mxg92f8mc2q9v3czyqtuekymu22uptn978xnws9fmtvyaj9k6uzswy487p9w22zt974ej0jgrwu</id>
    
      <title type="html">📅 Original date posted:2022-03-11 📝 Original message: Dear ...</title>
    
    <link rel="alternate" href="https://nostr.ae/nevent1qqsg0m8l9sfdgxhqvpv2fv8wyz4f5v63e58fa3k4mxg92f8mc2q9v3czyqtuekymu22uptn978xnws9fmtvyaj9k6uzswy487p9w22zt974ej0jgrwu" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqsz8qf7vy2pa8yy3wstz3894xfsayuk3mah0z6n4n4ffpa3q8ur7ecryccxz&#39;&gt;nevent1q…ccxz&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2022-03-11&lt;br/&gt;📝 Original message:&lt;br/&gt;Dear fellow Lightning Developers,&lt;br/&gt;&lt;br/&gt;I am pleased (and a bit proud) to be able to inform you that I finally&lt;br/&gt;found a quick way to approximate the slow minimum convex cost flow&lt;br/&gt;computation. This is necessary for optimally reliable and cheap payment&lt;br/&gt;flows [0] to deliver large multi part payments over the Lightning Network.&lt;br/&gt;The proposed solution happens via piecewise linearization [1] of the min&lt;br/&gt;cost flow problem on the uncertainty network which we face in order to&lt;br/&gt;compute the optimal split and planning of large amount multi part payments.&lt;br/&gt;The notion of &amp;#34;optimal&amp;#34; is obviously subjective with respect to the chosen&lt;br/&gt;cost function. As known we suggest to include the negative logarithm of&lt;br/&gt;success probabilities based on the likelihood that enough liquidity is&lt;br/&gt;available on a channel as a dominant feature of the used cost function. We&lt;br/&gt;give the background for this in [2] which since then has already been&lt;br/&gt;picked up by c-lightning and LDK. The c-lightning team even published&lt;br/&gt;benchmarks showing significant improvement in payment speed over their&lt;br/&gt;previously used cost function [2b].&lt;br/&gt;&lt;br/&gt;Let me recall that one of the largest criticisms and concerns of our&lt;br/&gt;approach to use minimum cost flows for payment delivery back in July /&lt;br/&gt;August last year (especially by the folks from lightning labs) was that the&lt;br/&gt;min cost flow approach would be impractical due to run time constrains.&lt;br/&gt;Thus I am delighted that with the now published code [3] (which has exactly&lt;br/&gt;100 lines including data import and parsing and ignoring comments) we are&lt;br/&gt;able to compute a reasonable looking approximation to the optimal solution&lt;br/&gt;in a sub second run time on the complete public channel graph of the&lt;br/&gt;Lightning Network. This is achieved via piecewise linearization of the&lt;br/&gt;convex cost function and invoking of a standard linear min cost flow solver&lt;br/&gt;[4] for the linearized problem. This works quickly despite the fact that&lt;br/&gt;the piecewise linearization adds a significant higher amount of arcs to the&lt;br/&gt;network and blows up the size of the network on which we solve the min cost&lt;br/&gt;flow problem. This makes me fairly certain that with proper pruning of the&lt;br/&gt;graph we might even reach the 100 millisecond runtime frontier, which would&lt;br/&gt;be far faster than what I dreamed &amp;amp; hoped to be possible.&lt;br/&gt;&lt;br/&gt;The currently widely deployed Dijkstra search to generate a single&lt;br/&gt;candidate path takes roughly 100ms of runtime. It seems that with the&lt;br/&gt;runtime of the piecewise linearized problem the min cost flow approach is&lt;br/&gt;now competitive from a runtime perspective. The flow computation is still a&lt;br/&gt;bit slower than Dijkstra in both theory and practice. However the piecewise&lt;br/&gt;linearized min cost flow has the huge advantage that it generates several&lt;br/&gt;candidate paths for a solid approximation of the optimal MPP split.&lt;br/&gt;Remember the exact min cost flow corresponds to the optimal MPP split. The&lt;br/&gt;later was not used so far as the min cost flow was considered to be too&lt;br/&gt;slow. Yet the question how to split seems to be addressed as issues in&lt;br/&gt;implementations [5][6][7] and acknowledged to be complicated (especially&lt;br/&gt;with respect to fees) in [8]. This result is btw of particular interest for&lt;br/&gt;LSPs. If an LSP has to schedule x payments per second it can just do one&lt;br/&gt;flow computation with several sink nodes and plan all of those payments&lt;br/&gt;with a single min cost flow computation. This globally optimizes the&lt;br/&gt;potentially heavy load that LSPs might have even if all payments were so&lt;br/&gt;small that no splitting was necessary.&lt;br/&gt;&lt;br/&gt;The iPython notebook which I shared contains about 1 page to explain how to&lt;br/&gt;conduct a piecewise linear approximation. The quality of the approximation&lt;br/&gt;is not the major goal here as I am just focused to demonstrate the run time&lt;br/&gt;of the approach and the principle how to achieve this runtime. Thus I do&lt;br/&gt;the piecewise linear approximation very roughly in the published code.&lt;br/&gt;Selecting the optimal piecewise approximation [9] will not change the the&lt;br/&gt;runtime of flow computation but only blows up the code to prepare the&lt;br/&gt;solver. This is why I decided to keep the code as simple and short as&lt;br/&gt;possible even if that means that the approximation will be not as close to&lt;br/&gt;the optimum as it could be in practice. For the same reason I did not&lt;br/&gt;include any code to update the uncertainty network from previously failed&lt;br/&gt;or successful attempts by using conditional success probabilities P(X&amp;gt;a |&lt;br/&gt;min_liquidity &amp;lt; X &amp;lt; max_liquidity ). People who are interested might look&lt;br/&gt;at my hands on instructions and explanations for coders in this&lt;br/&gt;rust-lightning issue [10]. The folks from LDK have picked this up and&lt;br/&gt;implemented this already for single path payments in [11] which might be&lt;br/&gt;relevant for people who prefer code over math papers. An obvious&lt;br/&gt;optimization of the piece wise linearization would be to chose the first&lt;br/&gt;segment of the piecewise linear approximation with a capacity of the&lt;br/&gt;certain liquidity and a unit cost of 0 for that piece.&lt;br/&gt;&lt;br/&gt;Our original papers describe everything only from a theoretical point of&lt;br/&gt;view and with simulations. However our mainnet experiments from July last&lt;br/&gt;year [12] indicated that we easily have been able to deliver for example&lt;br/&gt;0.3679 BTC via a couple rounds of min cost flow computations through the&lt;br/&gt;Lightning Network (given we accept the computational waiting time). This&lt;br/&gt;experiment was too slow to be used in practice but confirmed our model and&lt;br/&gt;approach to deliver such large amounts. Given that the min cost flow&lt;br/&gt;computation is now significantly below the median onion round trip times it&lt;br/&gt;is my understanding that with these newly introduced techniques we should&lt;br/&gt;be able to deliver substantial monetary amounts over the Lightning Network&lt;br/&gt;within a couple of seconds despite the uncertainty about the Liquidity in&lt;br/&gt;remote channels. While I am very excited about the result I think some&lt;br/&gt;principle roadblocks of the protocol are becoming more and more visible:&lt;br/&gt;&lt;br/&gt;1. The well known issue of hanging HTLCs. As of now I believe onion&lt;br/&gt;messages would be great to acknowledge incoming HTLCs of multipart payments&lt;br/&gt;but I certainly believe this will not be sufficient if we don&amp;#39;t go for a&lt;br/&gt;cancelable &amp;amp; stuckless payment protocol as suggested in [13].&lt;br/&gt;2. I believe the Lightning Network Protocol should be able to handle&lt;br/&gt;redundant overpayments as suggested in [14] and [15] (The later paper&lt;br/&gt;derives independently of us the same success probabilities and tries to&lt;br/&gt;maximize them!). This would allow to transform the problem of finding a&lt;br/&gt;flow that maximizes the success probability to a flow that expects to&lt;br/&gt;deliver the amount of the invoice (when redundancy is applied) with a&lt;br/&gt;single round of min cost flow computation on average.&lt;br/&gt;&lt;br/&gt;Last but not least, please allow me to make a short remark on the (still to&lt;br/&gt;me very surprisingly controversial) base fee discussion: For simplicity I&lt;br/&gt;did not include any fee considerations to the published code (besides a fee&lt;br/&gt;report on how expensive the computed flow is). However in practice we wish&lt;br/&gt;to optimize at least for high reliability (via neg log success&lt;br/&gt;probabilities) and cheap fees which in particular with the ppm is very&lt;br/&gt;easily possible to be included to the piece wise linearized cost function.&lt;br/&gt;While for small base fees it seems possible to encode the base fee into the&lt;br/&gt;first segment of the piecewise linearized approximation I think the base&lt;br/&gt;fee will still be tricky to be handled in practice (even with this&lt;br/&gt;approximation). For example if the base fee is too high the &amp;#34;base fee&lt;br/&gt;adjusted&amp;#34; unit cost of the first segment of the piecewise linearized&lt;br/&gt;problem might be higher than the unit cost of the second segment which&lt;br/&gt;effectively would break the convexity. Thus I reiterate my earlier point&lt;br/&gt;that from the perspective of the year long pursued goal of optimizing for&lt;br/&gt;fees (which all Dijkstra based single path implementations do) it seems to&lt;br/&gt;be best if the non linearity that is introduced by the base fee would be&lt;br/&gt;removed at all. According to discussions with people who crate Lightning&lt;br/&gt;Network explorer (and according to my last check of gossip) about 90% of&lt;br/&gt;channels have a base fee of 1 sat or lower and ~38% of all channels already&lt;br/&gt;set their base fee away from the default value to 0 [16].&lt;br/&gt;&lt;br/&gt;I hope this mail was useful for you. Feel free to ask me anything if there&lt;br/&gt;should be questions or if you need help to integrate those results into&lt;br/&gt;your software!&lt;br/&gt;&lt;br/&gt;With kind regards Rene Pickhardt&lt;br/&gt;&lt;br/&gt;[0]: &lt;a href=&#34;https://arxiv.org/abs/2107.05322&#34;&gt;https://arxiv.org/abs/2107.05322&lt;/a&gt;&lt;br/&gt;[1]: &lt;a href=&#34;https://en.wikipedia.org/wiki/Piecewise_linear_function&#34;&gt;https://en.wikipedia.org/wiki/Piecewise_linear_function&lt;/a&gt;&lt;br/&gt;[2]: &lt;a href=&#34;https://arxiv.org/abs/2103.08576&#34;&gt;https://arxiv.org/abs/2103.08576&lt;/a&gt;&lt;br/&gt;[2b]:&lt;br/&gt;&lt;a href=&#34;https://medium.com/blockstream/c-lightning-v0-10-2-bitcoin-dust-consensus-rule-33e777d58657&#34;&gt;https://medium.com/blockstream/c-lightning-v0-10-2-bitcoin-dust-consensus-rule-33e777d58657&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;[3]:&lt;br/&gt;&lt;a href=&#34;https://github.com/renepickhardt/mpp-splitter/blob/master/Minimal%20Linearized%20min%20cost%20flow%20example%20for%20MPP.ipynb&#34;&gt;https://github.com/renepickhardt/mpp-splitter/blob/master/Minimal%20Linearized%20min%20cost%20flow%20example%20for%20MPP.ipynb&lt;/a&gt;&lt;br/&gt;[4]: &lt;a href=&#34;https://developers.google.com/optimization/flow/mincostflow&#34;&gt;https://developers.google.com/optimization/flow/mincostflow&lt;/a&gt;&lt;br/&gt;[5]: &lt;a href=&#34;https://github.com/lightningnetwork/lnd/issues/4203&#34;&gt;https://github.com/lightningnetwork/lnd/issues/4203&lt;/a&gt;&lt;br/&gt;[6]: &lt;a href=&#34;https://github.com/lightningdevkit/rust-lightning/issues/1276&#34;&gt;https://github.com/lightningdevkit/rust-lightning/issues/1276&lt;/a&gt;&lt;br/&gt;[7]: &lt;a href=&#34;https://github.com/ElementsProject/lightning/issues/4753&#34;&gt;https://github.com/ElementsProject/lightning/issues/4753&lt;/a&gt;&lt;br/&gt;[8]: &lt;a href=&#34;https://github.com/ACINQ/eclair/pull/1427&#34;&gt;https://github.com/ACINQ/eclair/pull/1427&lt;/a&gt;&lt;br/&gt;[9]: &lt;a href=&#34;http://www.iaeng.org/publication/WCECS2008/WCECS2008_pp1191-1194.pdf&#34;&gt;http://www.iaeng.org/publication/WCECS2008/WCECS2008_pp1191-1194.pdf&lt;/a&gt;&lt;br/&gt;[10]:&lt;br/&gt;&lt;a href=&#34;https://github.com/lightningdevkit/rust-lightning/issues/1170#issuecomment-972396747&#34;&gt;https://github.com/lightningdevkit/rust-lightning/issues/1170#issuecomment-972396747&lt;/a&gt;&lt;br/&gt;[11]: &lt;a href=&#34;https://github.com/lightningdevkit/rust-lightning/pull/1227&#34;&gt;https://github.com/lightningdevkit/rust-lightning/pull/1227&lt;/a&gt;&lt;br/&gt;[12]: &lt;a href=&#34;https://twitter.com/renepickhardt/status/1418849788531990530&#34;&gt;https://twitter.com/renepickhardt/status/1418849788531990530&lt;/a&gt;&lt;br/&gt;[13]:&lt;br/&gt;&lt;a href=&#34;https://lists.linuxfoundation.org/pipermail/lightning-dev/2019-June/002029.html&#34;&gt;https://lists.linuxfoundation.org/pipermail/lightning-dev/2019-June/002029.html&lt;/a&gt;&lt;br/&gt;[14]: &lt;a href=&#34;https://berkeley-defi.github.io/assets/material/1910.01834.pdf&#34;&gt;https://berkeley-defi.github.io/assets/material/1910.01834.pdf&lt;/a&gt;&lt;br/&gt;[15]: &lt;a href=&#34;https://dl.acm.org/doi/10.1145/3479722.3480997&#34;&gt;https://dl.acm.org/doi/10.1145/3479722.3480997&lt;/a&gt;&lt;br/&gt;[16]: &lt;a href=&#34;https://lnrouter.app/graph/zero-base-fee&#34;&gt;https://lnrouter.app/graph/zero-base-fee&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;-- &lt;br/&gt;&lt;a href=&#34;https://ln.rene-pickhardt.de&#34;&gt;https://ln.rene-pickhardt.de&lt;/a&gt;&lt;br/&gt;-------------- next part --------------&lt;br/&gt;An HTML attachment was scrubbed...&lt;br/&gt;URL: &amp;lt;&lt;a href=&#34;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20220311/0ba5d2d0/attachment-0001.html&amp;gt&#34;&gt;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20220311/0ba5d2d0/attachment-0001.html&amp;gt&lt;/a&gt;;
    </content>
    <updated>2023-06-09T15:05:29&#43;02:00</updated>
  </entry>

  <entry>
    <id>https://nostr.ae/nevent1qqs233mkcl95wuzhk3jw6lanav48v6k7e97pmgaeflfwt48vmzjpdfczyqtuekymu22uptn978xnws9fmtvyaj9k6uzswy487p9w22zt974ejvkxg7t</id>
    
      <title type="html">📅 Original date posted:2021-11-15 📝 Original message: Dear ...</title>
    
    <link rel="alternate" href="https://nostr.ae/nevent1qqs233mkcl95wuzhk3jw6lanav48v6k7e97pmgaeflfwt48vmzjpdfczyqtuekymu22uptn978xnws9fmtvyaj9k6uzswy487p9w22zt974ejvkxg7t" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqsp8x4xxfq06ef6k28d5x9sx5l04mg8pv2rkyuktmcklse5p56667cljhhzf&#39;&gt;nevent1q…hhzf&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2021-11-15&lt;br/&gt;📝 Original message:&lt;br/&gt;Dear Joost,&lt;br/&gt;&lt;br/&gt;First I am happy that you also agree that reliability can and should be&lt;br/&gt;expressed as a probability as discussed in [0].&lt;br/&gt;&lt;br/&gt;The problem that you address is that of feature engineering[1]. Which&lt;br/&gt;consists of two (or even more) steps:&lt;br/&gt;&lt;br/&gt;1.) Feature selection: That means in payment delivery we will compute a min&lt;br/&gt;cost flow [2] with a chosen cost function (historically people used&lt;br/&gt;dijkstra seach for single paths with the cost function representing the&lt;br/&gt;weights on the edges of the graph -which is what most folks currently still&lt;br/&gt;do). While [2] and I personally agree with you that the cost function&lt;br/&gt;should be a combination the two features fees and reliability (as in&lt;br/&gt;successprobability) Matt Corallo righfully pointed out [3] that other&lt;br/&gt;features might be chosen in the future to deliver more optimal results. For&lt;br/&gt;example implementations currently often use CLTV as a feature (which I&lt;br/&gt;honestly find horrible) and I am currently investigating if one could add&lt;br/&gt;latency of channels or - for known IP addresses - either the geo distance&lt;br/&gt;or IP distance.&lt;br/&gt;&lt;br/&gt;2.) Combining features: This is the question that you are asking. Often&lt;br/&gt;people use a linear weighted sum to combine features. This is what often&lt;br/&gt;happens implicitly in neural networks. While this is often good enough and&lt;br/&gt;while it is often practical to either learn the weights or give users a&lt;br/&gt;choice there are many situation where the weighted linear sum does not work&lt;br/&gt;well with the selected features. An example for the weighted sum is the&lt;br/&gt;risk-factor in c-lightning that could have been used to decide if one&lt;br/&gt;wanted the dijkstra seach to either optimize for CLTV delta or for paid&lt;br/&gt;routing fees. Also in our paper [2] in which we discuss the same two&lt;br/&gt;features that you mentioned we explain how a linear sum of two features can&lt;br/&gt;be optimal due to the lagrangian bounding principle. However in practice&lt;br/&gt;(of machine learning) it has been shown that using the harmonic mean [4]&lt;br/&gt;between features often works very well without the necessity to learn a&lt;br/&gt;weight / parameter. This has for example been done when c-lightnign&lt;br/&gt;recently switched to probabilistic path finding [5]. In this thread you&lt;br/&gt;find a long discussion and evaluation how the harmonic mean outperformed&lt;br/&gt;the linear sum.&lt;br/&gt;&lt;br/&gt;I think the main issue that you address here is that there is no universal&lt;br/&gt;truth for situations like this. In practice only tests and experience will&lt;br/&gt;help us to make good decisions.&lt;br/&gt;&lt;br/&gt;with kind Regards Rene&lt;br/&gt;&lt;br/&gt;[0]:&lt;br/&gt;&lt;a href=&#34;https://lists.linuxfoundation.org/pipermail/lightning-dev/2021-March/002984.html&#34;&gt;https://lists.linuxfoundation.org/pipermail/lightning-dev/2021-March/002984.html&lt;/a&gt;&lt;br/&gt;[1]: &lt;a href=&#34;https://en.wikipedia.org/wiki/Feature_engineering&#34;&gt;https://en.wikipedia.org/wiki/Feature_engineering&lt;/a&gt;&lt;br/&gt;[2]: &lt;a href=&#34;https://arxiv.org/abs/2107.05322&#34;&gt;https://arxiv.org/abs/2107.05322&lt;/a&gt;&lt;br/&gt;[3]:&lt;br/&gt;&lt;a href=&#34;https://lists.linuxfoundation.org/pipermail/lightning-dev/2021-September/003219.html&#34;&gt;https://lists.linuxfoundation.org/pipermail/lightning-dev/2021-September/003219.html&lt;/a&gt;&lt;br/&gt;[4]:  &lt;a href=&#34;https://en.wikipedia.org/wiki/Harmonic_mean&#34;&gt;https://en.wikipedia.org/wiki/Harmonic_mean&lt;/a&gt;&lt;br/&gt;[5]: &lt;a href=&#34;https://github.com/ElementsProject/lightning/pull/4771&#34;&gt;https://github.com/ElementsProject/lightning/pull/4771&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;On Mon, Nov 15, 2021 at 4:26 PM Joost Jager &amp;lt;joost.jager at gmail.com&amp;gt; wrote:&lt;br/&gt;&lt;br/&gt;&amp;gt; In Lightning pathfinding the two main variables to optimize for are&lt;br/&gt;&amp;gt; routing fee and reliability. Routing fee is concrete. It is the sat amount&lt;br/&gt;&amp;gt; that is paid when a payment succeeds. Reliability is a property of a route&lt;br/&gt;&amp;gt; that can be expressed as a probability. The probability that a route will&lt;br/&gt;&amp;gt; be successful.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; During pathfinding, route options are compared against each other. So for&lt;br/&gt;&amp;gt; example:&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Route A: fee 10 sat, success probability 50%&lt;br/&gt;&amp;gt; Route B: fee 20 sat, success probability 80%&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Which one is the better route? That depends on user preference. A patient&lt;br/&gt;&amp;gt; user will probably go for route A in the hope of saving on fees whereas for&lt;br/&gt;&amp;gt; a time-sensitive payment route B looks better.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; It would be great to offer this trade-off to the user in a simple way.&lt;br/&gt;&amp;gt; Preferably a single [0, 1] value that controls the selection process. At 0,&lt;br/&gt;&amp;gt; the route is only optimized for fees and probabilities are ignored&lt;br/&gt;&amp;gt; completely. At 1, the route is only optimized for reliability and fees are&lt;br/&gt;&amp;gt; ignored completely.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; But how to choose between the routes A and B for a value somewhere in&lt;br/&gt;&amp;gt; between 0 and 1? For example 0.5 - perfect balance between reliability and&lt;br/&gt;&amp;gt; fee. But what does that mean exactly?&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Anyone got an idea on how to approach this best? I am looking for a simple&lt;br/&gt;&amp;gt; formula to decide between routes, preferably with a reasonably sound&lt;br/&gt;&amp;gt; probability-theoretical basis (whatever that means).&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Joost&lt;br/&gt;&amp;gt; _______________________________________________&lt;br/&gt;&amp;gt; Lightning-dev mailing list&lt;br/&gt;&amp;gt; Lightning-dev at lists.linuxfoundation.org&lt;br/&gt;&amp;gt; &lt;a href=&#34;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&#34;&gt;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&lt;/a&gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;-- &lt;br/&gt;&lt;a href=&#34;https://www.rene-pickhardt.de&#34;&gt;https://www.rene-pickhardt.de&lt;/a&gt;&lt;br/&gt;-------------- next part --------------&lt;br/&gt;An HTML attachment was scrubbed...&lt;br/&gt;URL: &amp;lt;&lt;a href=&#34;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20211115/392fcbf0/attachment-0001.html&amp;gt&#34;&gt;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20211115/392fcbf0/attachment-0001.html&amp;gt&lt;/a&gt;;
    </content>
    <updated>2023-06-09T15:04:24&#43;02:00</updated>
  </entry>

  <entry>
    <id>https://nostr.ae/nevent1qqs2rklftzyzwv3u7662yf4ccwt6zps3rxmtje79k63ways0jvn6evgzyqtuekymu22uptn978xnws9fmtvyaj9k6uzswy487p9w22zt974ejmufr5q</id>
    
      <title type="html">📅 Original date posted:2021-08-26 📝 Original message: Dear ...</title>
    
    <link rel="alternate" href="https://nostr.ae/nevent1qqs2rklftzyzwv3u7662yf4ccwt6zps3rxmtje79k63ways0jvn6evgzyqtuekymu22uptn978xnws9fmtvyaj9k6uzswy487p9w22zt974ejmufr5q" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqsqrkwf2qh5nhfcumsmgz6gsuj6n90cv6hdywy4rw8wx2hfg8sz2fs4ess9g&#39;&gt;nevent1q…ss9g&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2021-08-26&lt;br/&gt;📝 Original message:&lt;br/&gt;Dear fellow lightning developers,&lt;br/&gt;&lt;br/&gt;with a mixture of shock and disbelief I have been following the (semi)&lt;br/&gt;public discussions for the last 6 weeks and the reaction of some companies&lt;br/&gt;/ people that reached out to me. I have to say I am really surprised by the&lt;br/&gt;amount of hesitation that - despite obvious and overwhelming mathematical&lt;br/&gt;evidence -  a small group of people demonstrated in response to our&lt;br/&gt;results. While I cannot make any sense of this I decided to post here&lt;br/&gt;despite the fact that I believe everything that needed to be said is&lt;br/&gt;already written and explained clearly in our paper [0] about optimally&lt;br/&gt;reliable and cheap payment flows on the Lightning Network. My hope is that&lt;br/&gt;this mail can help us to&lt;br/&gt;&lt;br/&gt;* clarify a few misunderstandings&lt;br/&gt;* stop having opinionated discussions about mathematical facts&lt;br/&gt;* find a quick agreement on how to move on&lt;br/&gt;&lt;br/&gt;As far as I can tell currently all implementations use some form of&lt;br/&gt;Dijkstra algorithm in payment delivery with a strong emphasize on finding&lt;br/&gt;paths with cheap fees. The reason seems to be that it is a well established&lt;br/&gt;assumption that users would prefer a cheap solution on the market of&lt;br/&gt;offered routing fees. (while routing nodes of course try to offer fees that&lt;br/&gt;maximize their earnings)&lt;br/&gt;&lt;br/&gt;If we look at the mentioned paper there are several results (I will soon&lt;br/&gt;publish a separate mail here discussing some of the more interesting&lt;br/&gt;results and consequences but I decided to split it and put this one here&lt;br/&gt;first as it seemed to be more urgent). One of the results which I will&lt;br/&gt;discuss now is the realization that - given the current fee function -&lt;br/&gt;finding the cheapest payment flow is an NP-hard problem because the fee&lt;br/&gt;function is neither linear nor convex.&lt;br/&gt;&lt;br/&gt;Our fee function is `f(x) = rx &#43; b` where `r`= fee rate, `b`=base fee and&lt;br/&gt;`x` is the amount we want to send.&lt;br/&gt;&lt;br/&gt;As we thought it was obvious that the function is not linear we only&lt;br/&gt;explained in the paper how the jump from f(0)=0 to f(1) = ppm&#43;base_fee&lt;br/&gt;breaks convexity. But as the question came up several times (for example&lt;br/&gt;here [1]) I want to stress that the fee function - despite looking like a&lt;br/&gt;straight line - is **not linear**. While writing this post I realized that&lt;br/&gt;the issue might be that the concept of linearity [2] from the field of&lt;br/&gt;linear algebra seems to be intermixed in the english language and American&lt;br/&gt;school system with the concept of linear polynomials / linear functions&lt;br/&gt;[3]. So maybe that is part of the problem that emerged in previous&lt;br/&gt;discussions.&lt;br/&gt;&lt;br/&gt;When I write linear here I am referring back to the concept of linearity&lt;br/&gt;from linear algebra (c.f.: [2]) which btw seems to be also the main reason&lt;br/&gt;why schnorr signatures [2b] are so powerful that everyone is happy they&lt;br/&gt;will find their way into bitcoin. We know that a necessary condition for a&lt;br/&gt;function to be called linear is that the following property holds:&lt;br/&gt;&lt;br/&gt;f(x&#43;y)=f(x)&#43;f(y)&lt;br/&gt;&lt;br/&gt;however if we look at our setting we see that:&lt;br/&gt;&lt;br/&gt;f(x&#43;y) = r(x&#43;y) &#43; b&lt;br/&gt;&lt;br/&gt;and&lt;br/&gt;&lt;br/&gt;f(x)&#43;f(y) = rx&#43;b &#43; ry&#43;b = r(x&#43;y) &#43; 2b&lt;br/&gt;&lt;br/&gt;equality (and thus linearity) only holds if&lt;br/&gt;&lt;br/&gt;r(x&#43;y)&#43;b = r(x&#43;y) &#43; 2b &amp;lt;==&amp;gt; b = 2b&lt;br/&gt;&lt;br/&gt;the later is true if and only if `b=0`. In other words: **Our current fee&lt;br/&gt;function is only linear if we set the base fee to zero.**&lt;br/&gt;&lt;br/&gt;On the other side we refer to research in our paper that shows that an&lt;br/&gt;optimal solution (in this case optimal means cheapest) cannot be found if&lt;br/&gt;the fee function is neither linear nor convex. I think one of the biggest&lt;br/&gt;misunderstandings that I saw in the discussions is that people seem to have&lt;br/&gt;thought this has something to do with our new / proposed method. But as far&lt;br/&gt;as I can tell it does absolutely not have any connection to it. Instead and&lt;br/&gt;as most of you probably know the property to be an NP-hard problem is&lt;br/&gt;completely independent of the used algorithm. This is why in the paper we&lt;br/&gt;suggested to drop the base_fee and mentioned in the German Podcast that the&lt;br/&gt;same effect could already be achieved by node operators today by setting&lt;br/&gt;their base fee to 0. it is also the reason why we asked before we published&lt;br/&gt;the paper why the base fee was introduced and what purpose it served [4].&lt;br/&gt;&lt;br/&gt;I am so surprised by some of the resistance because some of the biggest&lt;br/&gt;talking points by Lightning Network critics in the past have been that&lt;br/&gt;routing is either not solved or if it was solved it would be NP-hard. In&lt;br/&gt;our paper we show that delivering a payment can always be modeled as a min&lt;br/&gt;cost flow and the resulting optimization problem will indeed be NP-hard&lt;br/&gt;depending on the cost function. Given the current fee function with a non&lt;br/&gt;zero base fee and the goal of minimizing fees that is followed by all&lt;br/&gt;implementations I have to agree with such critics and say yes, in that&lt;br/&gt;particular case delivering a payment optimally is an NP-hard problem.&lt;br/&gt;&lt;br/&gt;Luckily there are things we can do about it:&lt;br/&gt;&lt;br/&gt;1.) we can decide to have a different optimization goal. For example in the&lt;br/&gt;Paper we used a previously introduced probabilisitic model that optimizes&lt;br/&gt;for reliability instead of fees and we show that in that case the function&lt;br/&gt;is convex and a polynomial exact algorithm is known and exists.&lt;br/&gt;2.) If we want to optimize for fees which - given current implementations&lt;br/&gt;for single payments and the overwhelming feedback of users - seems to be&lt;br/&gt;the case we can modify the fee function to be either convex or linear. As&lt;br/&gt;everyone who read until here knows the later can be achieved by just&lt;br/&gt;removing the base fee.&lt;br/&gt;3.) Of course we can follow the ideas of Matt Corallo and Olaoluwa&lt;br/&gt;Osuntokun to do more research. I mean there is a nice 1 million dollar&lt;br/&gt;bounty [5] for the person who finds a polynomial solution to NP-hard&lt;br/&gt;problems or proofs that such solutions cannot be found in polynomial time&lt;br/&gt;(which if you ask me personally is way more probable to happen but I&lt;br/&gt;usually try not to make wild conjectures about the future).&lt;br/&gt;4.) We can try to find linear approximations so that we can have more&lt;br/&gt;efficient algorithms to approximate such problems which I guess is what&lt;br/&gt;Matt and Olaoluwa might have meant when they suggested to do more research.&lt;br/&gt;&lt;br/&gt;As I was struggeling with the problem for over two years I personally have&lt;br/&gt;a pretty strong opinion about the 4 potentials paths:&lt;br/&gt;&lt;br/&gt;@1: We already describe in the paper that reliability should be included&lt;br/&gt;when deciding which channels to use while fees should not be neglected.&lt;br/&gt;Thus I tend to say: Yes let&amp;#39;s modify the goal in a way that we still keep&lt;br/&gt;optimizing for cheap delivery which by the end means keep a fee function&lt;br/&gt;but NOT the current fee function.&lt;br/&gt;@2: Seems like a total no-brainer to modify the fee function to drop the&lt;br/&gt;base fee because I believe nobody wants to drop the cheap requirement for&lt;br/&gt;payments and because of what I will say in reply to 3 &amp;amp; 4.&lt;br/&gt;@3: If you want to find solutions to hard problems I suggest to find a&lt;br/&gt;solution to the discrete logarithm instead of studying P=NP. The bounty is&lt;br/&gt;the the security of bitcoin and thus much higher than just the million&lt;br/&gt;dollar that you might get for the the solution to the P=NP problem. Ok,&lt;br/&gt;jokes aside of course doing research is always a good idea and we laid out&lt;br/&gt;a clear roadmap for further R&amp;amp;D in the paper that still holds even if we&lt;br/&gt;all agree that zerobasefee is a good thing. I am still seeking funding from&lt;br/&gt;the bitcoin / lightning network community to be able to continue research&lt;br/&gt;and development in this field so I full appreciate the suggestion by Matt&lt;br/&gt;and Olaoluwa who asked for more research and I hope the community will&lt;br/&gt;entrust me to lead such research. I can understand that people hesitated to&lt;br/&gt;support my work back in 2019 when I decided to focus on the reliability&lt;br/&gt;question and it was a gamble if I could deliver but I sincerely hope with&lt;br/&gt;my achievements that I lay out in full on &lt;a href=&#34;https://ln.rene-pickhardt.de&#34;&gt;https://ln.rene-pickhardt.de&lt;/a&gt; that&lt;br/&gt;there will be more support in the future (not only for me).&lt;br/&gt;@4: People in operation research have tried this for many years. In&lt;br/&gt;practice problems are being linearized all the time. But in the best case&lt;br/&gt;the models are already chosen to be linear and one hopes that such models&lt;br/&gt;are close enough to reality. We have been given a gift that the uncertainty&lt;br/&gt;in our channels naturally came as a convex cost function which makes the&lt;br/&gt;reliability goal somewhat easy to compute. More importantly it is a huge&lt;br/&gt;gift that it is just for us (users and developers) to decide how we want to&lt;br/&gt;have the fee structure on the Lightning network. A linear solution could&lt;br/&gt;just be agreed upon / recommended but of course we can keep a non-linear&lt;br/&gt;version and struggle around with approximations to handle np-hardness. For&lt;br/&gt;me it is so obvious what one would want to do that I will conclude with the&lt;br/&gt;subject line of this mail as a rethorical question &amp;#34;Do we really want users&lt;br/&gt;to solve an NP-hard problem when they wish to find a cheap way of paying&lt;br/&gt;each other on the Lightning Network?&amp;#34;&lt;br/&gt;&lt;br/&gt;In the recent Optech newsletter [6] Olaoluwa Osuntokun is said to have&lt;br/&gt;&amp;#34;emphasized a point made earlier that there’s no clear current need for&lt;br/&gt;node operators to change a parameter today for a new pathfinding algorithm&lt;br/&gt;that nobody is currently ready to use in production&amp;#34;. First of all I want&lt;br/&gt;to emphasize that Stefan and I have used this in production and have&lt;br/&gt;verified that our method works - as predicted in the paper - much better&lt;br/&gt;than the pay implementation used in LND (I will write more about that in&lt;br/&gt;the other mail that I already mentioned) But way more importantly (and as&lt;br/&gt;explained in this mail and our paper) this parameter change is not about&lt;br/&gt;some novel algorithm that we propose but rather about the mathematical&lt;br/&gt;structure of the optimization problem that we want(?) users to face when&lt;br/&gt;delivering payments (and that all implementations already presented to the&lt;br/&gt;users in the single path payment case). So I very strongly disagree with&lt;br/&gt;the statement that there is no clear need to change something. Actually I&lt;br/&gt;think there is an exceptionally strong need to change something and very&lt;br/&gt;good reason to do so rather sooner than later.&lt;br/&gt;&lt;br/&gt;That being said the high reliability and large amounts that we could&lt;br/&gt;deliver through the use of our method with a standard min convex cost flow&lt;br/&gt;solver as the algorithm comes from the fact that we used probablistic path&lt;br/&gt;finding [7] as the cost function. As demonstrated last march this already&lt;br/&gt;works much better for single paths when used as a weight in dijsktra than&lt;br/&gt;the stuff current implementations do. Also it did not create such a&lt;br/&gt;discussion when I shared the results about probabilisitic pathfinding last&lt;br/&gt;march and already mentioned that I only need to finish the work on optimal&lt;br/&gt;splitting. So for the higher reliability and larger amounts alone that our&lt;br/&gt;method can do, we do not even need a zerobasefee. This is because&lt;br/&gt;probabilistic path finding merely models the uncertainty of the liquidity&lt;br/&gt;in the channels to decide which channels to use with what amounts in&lt;br/&gt;payment delivery to maximize the success probability. The only reason why&lt;br/&gt;we mention (zerobase)fees is because of @1 and the assumption that node&lt;br/&gt;operators would arbitrarily increase their fees on channels if we would not&lt;br/&gt;take fees into consideration when deciding which channels to use. Since the&lt;br/&gt;basefee kicks in and breaks the nice mathematical properties we addressed&lt;br/&gt;it.&lt;br/&gt;&lt;br/&gt;Btw I have a suggestion to node operators who seek channel partners and&lt;br/&gt;nodes with whom to open channels. If you don&amp;#39;t want your customers / users&lt;br/&gt;be required to solve or approximate NP-hard problems you could open your&lt;br/&gt;channels with other nodes who already support zero base fee on their&lt;br/&gt;channels. As of now this seems to be a clear indicator that those nodes&lt;br/&gt;care about reliability and try to provide a good &amp;amp; honest service to the&lt;br/&gt;network. As more and more wallets should use optimal payment flows it is&lt;br/&gt;also reasonable to expect that a lot of routing is likely to happen in the&lt;br/&gt;#zerobasefee part of the network which is already pretty large [8]. At&lt;br/&gt;least when I make a payment this part of the network is where I look first&lt;br/&gt;to deliver the payment. Also connecting to nodes that indicate via&lt;br/&gt;zerobasefee that they care seems at least to me personally way more&lt;br/&gt;reasonable than following some random intransparent score that assigns&lt;br/&gt;numbers to nodes.&lt;br/&gt;&lt;br/&gt;As said initially I thought I already had said everything which is why -&lt;br/&gt;unless substential new information comes up - I will most likely not engage&lt;br/&gt;into further bike shedding discussions on the zero base fee discussions.&lt;br/&gt;This is now for the community to decide and not for me to argue.&lt;br/&gt;&lt;br/&gt;with kind regards Rene&lt;br/&gt;&lt;br/&gt;[0]: &lt;a href=&#34;https://arxiv.org/abs/2107.05322&#34;&gt;https://arxiv.org/abs/2107.05322&lt;/a&gt;&lt;br/&gt;[1]:&lt;br/&gt;&lt;a href=&#34;https://bitcoin.stackexchange.com/questions/108018/would-a-min-fee-setting-for-lightning-channels-make-sense#comment124039_108325&#34;&gt;https://bitcoin.stackexchange.com/questions/108018/would-a-min-fee-setting-for-lightning-channels-make-sense#comment124039_108325&lt;/a&gt;&lt;br/&gt;[2]: &lt;a href=&#34;https://en.wikipedia.org/wiki/Linearity&#34;&gt;https://en.wikipedia.org/wiki/Linearity&lt;/a&gt;&lt;br/&gt;[2b]:&lt;br/&gt;&lt;a href=&#34;https://courses.csail.mit.edu/6.857/2020/projects/4-Elbahrawy-Lovejoy-Ouyang-Perez.pdf&#34;&gt;https://courses.csail.mit.edu/6.857/2020/projects/4-Elbahrawy-Lovejoy-Ouyang-Perez.pdf&lt;/a&gt;&lt;br/&gt;[3]: &lt;a href=&#34;https://en.wikipedia.org/wiki/Linear_function&#34;&gt;https://en.wikipedia.org/wiki/Linear_function&lt;/a&gt;&lt;br/&gt;[4]:&lt;br/&gt;&lt;a href=&#34;https://bitcoin.stackexchange.com/questions/107311/why-was-the-base-fee-for-the-routing-fee-calculation-of-the-lightning-network-in&#34;&gt;https://bitcoin.stackexchange.com/questions/107311/why-was-the-base-fee-for-the-routing-fee-calculation-of-the-lightning-network-in&lt;/a&gt;&lt;br/&gt;[5]:&lt;br/&gt;&lt;a href=&#34;https://en.wikipedia.org/wiki/P_versus_NP_problem#Results_about_difficulty_of_proof&#34;&gt;https://en.wikipedia.org/wiki/P_versus_NP_problem#Results_about_difficulty_of_proof&lt;/a&gt;&lt;br/&gt;[6]: &lt;a href=&#34;https://bitcoinops.org/en/newsletters/2021/08/25/&#34;&gt;https://bitcoinops.org/en/newsletters/2021/08/25/&lt;/a&gt;&lt;br/&gt;[7]:&lt;br/&gt;&lt;a href=&#34;https://lists.linuxfoundation.org/pipermail/lightning-dev/2021-March/002984.html&#34;&gt;https://lists.linuxfoundation.org/pipermail/lightning-dev/2021-March/002984.html&lt;/a&gt;&lt;br/&gt;[8]: &lt;a href=&#34;https://lnrouter.app/graph/zero-base-fee&#34;&gt;https://lnrouter.app/graph/zero-base-fee&lt;/a&gt;&lt;br/&gt;-- &lt;br/&gt;&lt;a href=&#34;https://www.rene-pickhardt.de&#34;&gt;https://www.rene-pickhardt.de&lt;/a&gt;&lt;br/&gt;-------------- next part --------------&lt;br/&gt;An HTML attachment was scrubbed...&lt;br/&gt;URL: &amp;lt;&lt;a href=&#34;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20210826/7fde2220/attachment-0001.html&amp;gt&#34;&gt;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20210826/7fde2220/attachment-0001.html&amp;gt&lt;/a&gt;;
    </content>
    <updated>2023-06-09T15:03:35&#43;02:00</updated>
  </entry>

  <entry>
    <id>https://nostr.ae/nevent1qqs27uan7384u7jkzj6h2zchd5dvc93sh6gcvjw9cg99d9dflxyx6fszyqtuekymu22uptn978xnws9fmtvyaj9k6uzswy487p9w22zt974ejgspjez</id>
    
      <title type="html">📅 Original date posted:2021-04-06 📝 Original message: Dear ...</title>
    
    <link rel="alternate" href="https://nostr.ae/nevent1qqs27uan7384u7jkzj6h2zchd5dvc93sh6gcvjw9cg99d9dflxyx6fszyqtuekymu22uptn978xnws9fmtvyaj9k6uzswy487p9w22zt974ejgspjez" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqsgvmhslffnn8q025l47p9z0u97jmk9u6pkmpjs2jacja8q85wg8hqtr6tf9&#39;&gt;nevent1q…6tf9&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2021-04-06&lt;br/&gt;📝 Original message:&lt;br/&gt;Dear fellow Lightning Developers,&lt;br/&gt;&lt;br/&gt;as you all probably know Andreas, Roasbeef and I are working on writing the&lt;br/&gt;book &amp;#34;Mastering the Lightning Network&amp;#34; and I am happy to say that there has&lt;br/&gt;been quite some progress over the last 18 months. In Particular it lead to&lt;br/&gt;a diagram of the Lightning Network Protocol Suite which is the reason I am&lt;br/&gt;sending this email. We would love to have your feedback and criticism (not&lt;br/&gt;on my little design skills but on the content!). You can find the diagram&lt;br/&gt;at:&lt;br/&gt;&lt;br/&gt; &lt;img src=&#34;https://commons.wikimedia.org/wiki/File:Lightning_Network_Protocol_Suite.png&#34;&gt; &lt;br/&gt;&lt;br/&gt;As a Wikipedia Contributor I shared the current Version on Wikimedia&lt;br/&gt;commons where the Diagram can easily be updated but the link will stay the&lt;br/&gt;same as they also allow version control of files. Eventually I am happy to&lt;br/&gt;open a PR and add this to BOLT 0 or the Readme of the lightning-rfc. But&lt;br/&gt;first we would welcome and encourage your feedback and discussion.&lt;br/&gt;Especially the naming of some layers are somewhat novel but also the labels&lt;br/&gt;for the boxes and the geometry and semantics of the boxes themselves.&lt;br/&gt;&lt;br/&gt;To give you some context: As you know the BOLTs are somewhat linked and&lt;br/&gt;intermixed. For example BOLT2 describes the channel state machine with the&lt;br/&gt;HTLCs which is mainly needed for routing, BOLT 07 is named gossip routing&lt;br/&gt;though the main onion routing is happening in BOLT 04, ... I am not saying&lt;br/&gt;that such things would be wrong. However I made the experience that those&lt;br/&gt;iterdependencies can sometimes be a bit confusing when introducing the&lt;br/&gt;protocol to new people.&lt;br/&gt;&lt;br/&gt;Consequently this lead to plenty of internal discussions which we concluded&lt;br/&gt;by deciding that we need an architecture diagram for the Lightning Network.&lt;br/&gt;After a couple internal iterations we believe it is time to present our&lt;br/&gt;current diagram to the community and hope to get even more feedback before&lt;br/&gt;we `fix` it and use it also as a guide for some of the chapters in the&lt;br/&gt;book. You can see a part of our discussions and previous versions on github&lt;br/&gt;&lt;a href=&#34;https://github.com/lnbook/lnbook/issues/342&#34;&gt;https://github.com/lnbook/lnbook/issues/342&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;Also please note that BOLT 03 and BOLT 5 which is the Bitcoin stuff is&lt;br/&gt;currently not part of the diagram at all.&lt;br/&gt;&lt;br/&gt;with kind Regards Rene&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;-- &lt;br/&gt;&lt;a href=&#34;https://www.rene-pickhardt.de&#34;&gt;https://www.rene-pickhardt.de&lt;/a&gt;&lt;br/&gt;-------------- next part --------------&lt;br/&gt;An HTML attachment was scrubbed...&lt;br/&gt;URL: &amp;lt;&lt;a href=&#34;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20210406/d796f6a1/attachment.html&amp;gt&#34;&gt;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20210406/d796f6a1/attachment.html&amp;gt&lt;/a&gt;;
    </content>
    <updated>2023-06-09T15:02:13&#43;02:00</updated>
  </entry>

  <entry>
    <id>https://nostr.ae/nevent1qqs2wfg2afv33kvwkfaqtrq290egru0rm6z2qlze7v6gk6yg7nqvclqzyqtuekymu22uptn978xnws9fmtvyaj9k6uzswy487p9w22zt974eju0wtlh</id>
    
      <title type="html">📅 Original date posted:2020-06-17 📝 Original message: Hey ...</title>
    
    <link rel="alternate" href="https://nostr.ae/nevent1qqs2wfg2afv33kvwkfaqtrq290egru0rm6z2qlze7v6gk6yg7nqvclqzyqtuekymu22uptn978xnws9fmtvyaj9k6uzswy487p9w22zt974eju0wtlh" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqs8m2fxmf2gxax2fceehffltpy5hcja5qsq4nsljtedaxkyvusj8egu6q5u5&#39;&gt;nevent1q…q5u5&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2020-06-17&lt;br/&gt;📝 Original message:&lt;br/&gt;Hey everyone and of course good morning ZmnSCPxj (:&lt;br/&gt;&lt;br/&gt;about 11 months ago I discovered a potential blackmail attack with HTLCs&lt;br/&gt;after answering this question on stack exchange (c.f&lt;br/&gt;&lt;a href=&#34;https://bitcoin.stackexchange.com/questions/89232/why-is-my-spendable-msat-much-lower-than-msatoshi-to-us/89235#89235&#34;&gt;https://bitcoin.stackexchange.com/questions/89232/why-is-my-spendable-msat-much-lower-than-msatoshi-to-us/89235#89235&lt;/a&gt;).&lt;br/&gt;This attack is similar to the one that was possible with tx malleability on&lt;br/&gt;the funding transaction without the segwit upgrade (c.f.&lt;br/&gt;&lt;a href=&#34;https://commons.wikimedia.org/w/index.php?title=File:Introduction_to_the_Lightning_Network_Protocol_and_the_Basics_of_Lightning_Technology_(BOLT_aka_Lightning-rfc).pdf&amp;amp;page=126&#34;&gt;https://commons.wikimedia.org/w/index.php?title=File:Introduction_to_the_Lightning_Network_Protocol_and_the_Basics_of_Lightning_Technology_(BOLT_aka_Lightning-rfc).pdf&amp;amp;page=126&lt;/a&gt;).&lt;br/&gt;Meaning an attacker can force a victim to lose money and use this fact to&lt;br/&gt;blackmail the victim, to potentially gain / steal some of the lost funds.&lt;br/&gt;&lt;br/&gt;TL;DR:&lt;br/&gt;=====&lt;br/&gt;* Depending on the circumstances this attack allows an attacker to make&lt;br/&gt;channel partners lose a substantial amount of BTC without substantial costs&lt;br/&gt;for the attacker.&lt;br/&gt;* Depending on the exact circumstances this could be for example ~0.15 BTC.&lt;br/&gt;In particular it demonstrates why opening a channel is not an entirely&lt;br/&gt;trustless activity.&lt;br/&gt;* The attacker will reliably only be able to force the victim to lose this&lt;br/&gt;amount of Bitcoin.&lt;br/&gt;* It is not clear how in practice the attacker could gain this amount or&lt;br/&gt;parts of it as this would involve not only game theory but also rather&lt;br/&gt;quick communication between attacker and victim and customized Lightning&lt;br/&gt;nodes which at least for the victim would be unlikely to exist.&lt;br/&gt;* None of the suggested fixes seems to be satisfying though the current&lt;br/&gt;solution of lowering the maximum amount of HTLCs that can concurrently be&lt;br/&gt;in flight seems to be a reasonable start for now.&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;Timeline on Disclosure&lt;br/&gt;=================&lt;br/&gt;I have disclosed this attack on Sunday July 21st 2019 to Fabrice Drouin&lt;br/&gt;(and shortly after to Christian Decker) in a phone call who in turn has&lt;br/&gt;discussed it with people from the other implementations. From his feedback&lt;br/&gt;I understood that people working on implementations have been more or less&lt;br/&gt;aware of the possibility of this attack. Fabrice also mentioned that he&lt;br/&gt;believed implementations currently try to mitigate this by setting low&lt;br/&gt;limits of allowed / accepted HTLCs in flight. However at that time this was&lt;br/&gt;only true for e-clair. It is now also true for c-lightning and as far as I&lt;br/&gt;know still not true for lnd. Fabrice said that the people he talked to have&lt;br/&gt;suggested that I should eventually describe the attack in public to raise&lt;br/&gt;awareness (also from the group of node operators) for the problems related&lt;br/&gt;to this attack. He also suggested that - if I wanted to - I should update&lt;br/&gt;the rfc with recommendations  and warnings. While I already have in mind&lt;br/&gt;how to change the rfc I wanted to start the discussion first. Maybe some&lt;br/&gt;people find better fixes than just a warning that I have in mind. So far I&lt;br/&gt;didn&amp;#39;t do anything because I wanted to also give lnd the chance to handle&lt;br/&gt;the problem.&lt;br/&gt;&lt;br/&gt;There are two reasons I disclose this attack today:&lt;br/&gt;1.) I think almost 1 year is enough time to do something about it. The only&lt;br/&gt;implementation that afaik didn&amp;#39;t yet is lnd (see below) but I got roasbeefs&lt;br/&gt;ok last week to go ahead and publish the attack anyway so that we can have&lt;br/&gt;a broader discussion on mitigation strategies.&lt;br/&gt;2.) The attack seems actually very similar to the one described in the&lt;br/&gt;&amp;#34;Flood &amp;amp; Loot: A Systemic Attack On The Lightning Network&amp;#34; - paper which&lt;br/&gt;came out 2 days ago (c.f.: &lt;a href=&#34;https://arxiv.org/abs/2006.08513&#34;&gt;https://arxiv.org/abs/2006.08513&lt;/a&gt; ). I believe&lt;br/&gt;any person reading that paper will understand the possibility of the attack&lt;br/&gt;that I describe anyway so I believe it is now more or less public anyway&lt;br/&gt;and thus time for an open / public discussion.&lt;br/&gt;&lt;br/&gt;The main difference between the two attacks (if I understand this novel&lt;br/&gt;paper correctly) is: In the &amp;#34;flood and loot&amp;#34;-attack one tries to steal the&lt;br/&gt;HTLC output of the victims. Where in the &amp;#34;flood and blackmail&amp;#34;-attack that&lt;br/&gt;I describe I try to to force the victim to lose almost all its funds due to&lt;br/&gt;high on chain fees (Which I could use to blackmail the victim)&lt;br/&gt;&lt;br/&gt;Description of the attack&lt;br/&gt;===================&lt;br/&gt;Let us assume the victim has funded a channel with an attacker meaning it&lt;br/&gt;will have to pay the fees for the commitment transaction in case of a force&lt;br/&gt;close.&lt;br/&gt;&lt;br/&gt;During a fee spike (let us assume fee estimators suggest 150 sat / byte)&lt;br/&gt;the attacker spams this channel with the maximum possible amount of HTLCs&lt;br/&gt;that the protocol allows. The HTLCs can be of a small value but need to be&lt;br/&gt;bigger than the dust limit so that additional outputs are actually added to&lt;br/&gt;the commitment transaction which makes it quite large in Bytes. According&lt;br/&gt;to the BOLTs these are 483 additional outputs to the commitment&lt;br/&gt;transaction.&lt;br/&gt;The direction of HTLCs are chosen so that the amount is taken from the&lt;br/&gt;`to_remote` output of the attacker (obviously on the victims side it will&lt;br/&gt;be the `to_local` output) For the actual attack it does not matter in which&lt;br/&gt;direction the HTLCs are spammed but economically the direction I propose&lt;br/&gt;makes even more sense for the attacker and can be achieved with circular&lt;br/&gt;onions.&lt;br/&gt;&lt;br/&gt;The attacked channel partner will happily - according to the protocol - use&lt;br/&gt;a higher fee than the current fee rate. I quote from BOLT 02 which suggests&lt;br/&gt;a buffer of a factor of 5&lt;br/&gt;&lt;a href=&#34;https://github.com/lightningnetwork/lightning-rfc/blob/master/02-peer-protocol.md#updating-fees-update_fee&#34;&gt;https://github.com/lightningnetwork/lightning-rfc/blob/master/02-peer-protocol.md#updating-fees-update_fee&lt;/a&gt;:&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&amp;gt; The node responsible for paying the Bitcoin fee [...] SHOULD send&lt;br/&gt;update_fee to ensure the current fee rate is sufficient (by a significant&lt;br/&gt;margin) for timely processing of the commitment transaction. [...] Given&lt;br/&gt;the variance in fees, and the fact that the transaction may be spent in the&lt;br/&gt;future, it&amp;#39;s a good idea for the fee payer to keep a good margin (say 5x&lt;br/&gt;the expected fee requirement); but, due to differing methods of fee&lt;br/&gt;estimation, an exact value is not specified.&lt;br/&gt;&lt;br/&gt;This overpayment of fees will result in 750 sat / byte for this fee spike&lt;br/&gt;scenario. This is by the way not completely unrealistic [I recently opened&lt;br/&gt;a channel with 2.56 sat / byte (c.f.:&lt;br/&gt;&lt;a href=&#34;https://www.smartbit.com.au/tx/c0ac6cfe15e0d0c921362ab9fad998a8a8e16cd8d9d4159487dd69141ea2b9b0&#34;&gt;https://www.smartbit.com.au/tx/c0ac6cfe15e0d0c921362ab9fad998a8a8e16cd8d9d4159487dd69141ea2b9b0&lt;/a&gt;)&lt;br/&gt;and the channel was force closed a couple minutes later due to an&lt;br/&gt;implementation bug resulting in fees of 101.17 sat / byte (c.f.:&lt;br/&gt;&lt;a href=&#34;https://www.smartbit.com.au/tx/e32135315ec147bb27f771b2e15c7178ea573afd16cd4970bf814c9b18bc46e3&#34;&gt;https://www.smartbit.com.au/tx/e32135315ec147bb27f771b2e15c7178ea573afd16cd4970bf814c9b18bc46e3&lt;/a&gt;&lt;br/&gt;)&lt;br/&gt;&lt;br/&gt;As far as I understand the appendix of BOLT 03 offered HTLCs are 43 Byte in&lt;br/&gt;size (c.f.:&lt;br/&gt;&lt;a href=&#34;https://github.com/lightningnetwork/lightning-rfc/blob/master/03-transactions.md#appendix-a-expected-weights&#34;&gt;https://github.com/lightningnetwork/lightning-rfc/blob/master/03-transactions.md#appendix-a-expected-weights&lt;/a&gt;)&lt;br/&gt;resulting in the following additional fees for the spammed commitment&lt;br/&gt;transaction:&lt;br/&gt;&lt;br/&gt;fee (for 483 htlcs)  = 483 * 43 byte * 750 sat / byte = 15576750 sat =&lt;br/&gt;0.1557675 BTC&lt;br/&gt;&lt;br/&gt;Additionally the victim will also have to swipe all offered HTLCs (which&lt;br/&gt;will be additional costs but could be done once the fees came down) so we&lt;br/&gt;neglect them.&lt;br/&gt;&lt;br/&gt;Once all HTLCs are set up the attacker will stop signing commitment&lt;br/&gt;transactions. In the beginning this is not suspicious as the HTLCs will&lt;br/&gt;take some time to settle anyway. But also when fees go down and the victim&lt;br/&gt;who funded the channel wants to update the fees the attacker will just not&lt;br/&gt;be responsive. Eventually the victim will dare to force close the channel&lt;br/&gt;with all those expensive HTLCs.&lt;br/&gt;&lt;br/&gt;Knowing that this will happen and that the victim has to spend those funds&lt;br/&gt;(publishing old state obviously does not work!) the attacker has a time&lt;br/&gt;window to blackmail the victim outside of the lightning network protocol:&lt;br/&gt;&amp;#34;Either you will pay those 0.1557675 BTC of fees or we will collaboratively&lt;br/&gt;close the channel but that will cost you part of the amount you lost.&amp;#34; Game&lt;br/&gt;theory suggests that the attacker will be able to claim the major fraction&lt;br/&gt;of the BTC (c.f. &lt;a href=&#34;https://en.wikipedia.org/wiki/Ultimatum_game&#34;&gt;https://en.wikipedia.org/wiki/Ultimatum_game&lt;/a&gt; that are&lt;br/&gt;frozen in tx fees as the victim effectively already has lost that money and&lt;br/&gt;can only gain something back.&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;Thoughts&lt;br/&gt;=======&lt;br/&gt;You might say that the blackmail part of this attack is unrealistic as the&lt;br/&gt;blackmailing person will not have enough time to successfully do the&lt;br/&gt;blackmail as the channel that is not operational will fail.&lt;br/&gt;&lt;br/&gt;1.) The only thing that lightning nodes might do is a fee update as the&lt;br/&gt;htlcs stuffed the channel so I believe there is actually some time to&lt;br/&gt;contact the victim.&lt;br/&gt;2.) What if the attacker is a mining pool who is just interested in high&lt;br/&gt;fees who does not even need to do the blackmailing stuff but will just&lt;br/&gt;force close the channel once the htlcs are set up?&lt;br/&gt;3.) The attacker might not even be interested in blackmailing the victim.&lt;br/&gt;The attacker could just be interested in harming the victim. Though it&lt;br/&gt;might certainly be a challenge to target a specific victim and trick it&lt;br/&gt;into opening a channel with an attacker.&lt;br/&gt;&lt;br/&gt;Also you might say that an attacker needs many incoming channels to execute&lt;br/&gt;this attack. This can be achieved by gaming the autopilot. an attacker can&lt;br/&gt;start by creating many channels making him a highly likely channel partner&lt;br/&gt;for autopilot users (who will also fund the channel). Such a highly&lt;br/&gt;connected node might also be interesting for non autopilot users.&lt;br/&gt;&lt;br/&gt;Implementations&lt;br/&gt;============&lt;br/&gt;&lt;br/&gt;I looked at the code myself. I hope I do oversee things but to me it looks&lt;br/&gt;like only eclaire was somehow mitigating this attack from being exploited.&lt;br/&gt;(by a default config of 30 accepted htlcs which will protect the average&lt;br/&gt;user and is much lower than the 483) and c-lightning has merged a patch&lt;br/&gt;from me which I provided after I disclosed the attack:&lt;br/&gt;&lt;br/&gt;## clightning:&lt;br/&gt;&lt;br/&gt;c-lightning did not by default set a hard cap on htlcs before version 0.7.2&lt;br/&gt;but then merged my patch&lt;br/&gt;&lt;a href=&#34;https://github.com/ElementsProject/lightning/pull/2858&#34;&gt;https://github.com/ElementsProject/lightning/pull/2858&lt;/a&gt; which tried to&lt;br/&gt;resemble the eclair defaults&lt;br/&gt;&lt;br/&gt;## eclaire:&lt;br/&gt;&lt;br/&gt;the max accepted htlc value per channel is set as a constant to 483 which&lt;br/&gt;follows the recommendation of the BOLTs:&lt;br/&gt;&lt;a href=&#34;https://github.com/ACINQ/eclair/blob/e62adf2deae213d2cd0f2a6874227dcfc57880ae/eclair-core/src/main/scala/fr/acinq/eclair/channel/Channel.scala#L52&#34;&gt;https://github.com/ACINQ/eclair/blob/e62adf2deae213d2cd0f2a6874227dcfc57880ae/eclair-core/src/main/scala/fr/acinq/eclair/channel/Channel.scala#L52&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;The value is tested against at:&lt;br/&gt;&lt;a href=&#34;https://github.com/ACINQ/eclair/blob/f724efaa76b256048de18f706e9cb58ecbebd6aa/eclair-core/src/main/scala/fr/acinq/eclair/channel/Helpers.scala#L99&#34;&gt;https://github.com/ACINQ/eclair/blob/f724efaa76b256048de18f706e9cb58ecbebd6aa/eclair-core/src/main/scala/fr/acinq/eclair/channel/Helpers.scala#L99&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;and:&lt;br/&gt;&lt;a href=&#34;https://github.com/ACINQ/eclair/blob/f724efaa76b256048de18f706e9cb58ecbebd6aa/eclair-core/src/main/scala/fr/acinq/eclair/channel/Helpers.scala#L132&#34;&gt;https://github.com/ACINQ/eclair/blob/f724efaa76b256048de18f706e9cb58ecbebd6aa/eclair-core/src/main/scala/fr/acinq/eclair/channel/Helpers.scala#L132&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;and:&lt;br/&gt;&lt;a href=&#34;https://github.com/ACINQ/eclair/blob/93d9369f900766171f2ddf579e8b12e28d8f0d25/eclair-core/src/main/scala/fr/acinq/eclair/channel/Commitments.scala#L154&#34;&gt;https://github.com/ACINQ/eclair/blob/93d9369f900766171f2ddf579e8b12e28d8f0d25/eclair-core/src/main/scala/fr/acinq/eclair/channel/Commitments.scala#L154&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;However the default config file specifies a maximum amount of 30 accepted&lt;br/&gt;htlcs at:&lt;br/&gt;&lt;a href=&#34;https://github.com/ACINQ/eclair/blob/9afb26e09c69dd5d6a14732baf5dcdf2b7a9142b/eclair-core/src/main/resources/reference.conf#L62&#34;&gt;https://github.com/ACINQ/eclair/blob/9afb26e09c69dd5d6a14732baf5dcdf2b7a9142b/eclair-core/src/main/resources/reference.conf#L62&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;## lnd&lt;br/&gt;It seems like lnd did not and last time I checked (maybe I oversaw&lt;br/&gt;something) does not set a hard cap on htlcs by default. The way how I&lt;br/&gt;understand the code they allow up to 483 htlcs by default:&lt;br/&gt;&lt;br/&gt;The test when adding an htlc if it is beyond the maximum accepted values is&lt;br/&gt;here:&lt;br/&gt;&lt;a href=&#34;https://github.com/lightningnetwork/lnd/blob/970d7604071baae227db42d4665ef9d1b56988e8/lnwallet/channel.go#L3795&#34;&gt;https://github.com/lightningnetwork/lnd/blob/970d7604071baae227db42d4665ef9d1b56988e8/lnwallet/channel.go#L3795&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;the default configuration seems to be here (and in the most recent commit&lt;br/&gt;the line still exists):&lt;br/&gt;&lt;a href=&#34;https://github.com/lightningnetwork/lnd/blob/8b04cfbf12f460853e8c55611cd1bba21b1510ef/input/size.go#L187&#34;&gt;https://github.com/lightningnetwork/lnd/blob/8b04cfbf12f460853e8c55611cd1bba21b1510ef/input/size.go#L187&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;the software will accept up to 483 htlcs according to this line:&lt;br/&gt;&lt;a href=&#34;https://github.com/lightningnetwork/lnd/blob/111cbeaa990cba78563d6cc8c19b152e2d3042f6/lnwallet/reservation.go#L314&#34;&gt;https://github.com/lightningnetwork/lnd/blob/111cbeaa990cba78563d6cc8c19b152e2d3042f6/lnwallet/reservation.go#L314&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;I could not find any spec lower than that in the suggested sample config&lt;br/&gt;at:&lt;br/&gt;&lt;a href=&#34;https://github.com/lightningnetwork/lnd/blob/master/sample-lnd.conf&#34;&gt;https://github.com/lightningnetwork/lnd/blob/master/sample-lnd.conf&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;Ideas for Fixes&lt;br/&gt;===========&lt;br/&gt;&lt;br/&gt;I am completely unhappy with each of the following ideas. I hope you will&lt;br/&gt;come up with smarter solutions. I believe the solution is not obvious. Thus&lt;br/&gt;I thought it makes sense in the brainstorm phase to even post some ideas&lt;br/&gt;with obvious drawbacks.&lt;br/&gt;&lt;br/&gt;1. The current solution is to just not use up the max value of&lt;br/&gt;htlc&amp;#39;s. Eclaire and c-lightning by default only use up to 30 htlcs.&lt;br/&gt;2. Probably the best fix (not sure if I understand the consequences&lt;br/&gt;correctly) is coming from this PR to bitcoin core (c.f.&lt;br/&gt;&lt;a href=&#34;https://github.com/bitcoin/bitcoin/pull/15681&#34;&gt;https://github.com/bitcoin/bitcoin/pull/15681&lt;/a&gt; by @TheBlueMatt . If I get it&lt;br/&gt;correctly with that we could always have low fees and ask the person who&lt;br/&gt;want to claim their outputs to pay fees. This excludes overpayment and&lt;br/&gt;could happen at a later stage when fees are not spiked. Still the victim&lt;br/&gt;who offered the htlcs would have to spend those outputs at some time.&lt;br/&gt;3. Don&amp;#39;t overpay fees in commitment transactions. We can&amp;#39;t foresee the&lt;br/&gt;future anyway&lt;br/&gt;4. Don&amp;#39;t add htlcs for which the on chain fee is higher than the HTLCs&lt;br/&gt;value (like we do with sub dust amounts and sub satoshi amounts. This would&lt;br/&gt;at least make the attack expensive as the attacker would have to bind a lot&lt;br/&gt;of liquidity.&lt;br/&gt;5. Somehow be able to aggregate htlc&amp;#39;s. In a world where we use payment&lt;br/&gt;points instead of preimages we might be able to do so. It would be really&lt;br/&gt;cool if separate HTLC&amp;#39;s could be combined to 1 single output. I played&lt;br/&gt;around a little bit but I have not come up with a scheme that is more&lt;br/&gt;compact in all cases. Thus I just threw in the idea.&lt;br/&gt;6. Split onchain fees differently (now the attacker would also lose fees by&lt;br/&gt;conducting this attack) - No I don&amp;#39;t want to start yet another fee&lt;br/&gt;bikeshadding debate. (In particular I believe that a different split of&lt;br/&gt;fees might make the Flood &amp;amp; Loot attack economically more viable which&lt;br/&gt;relies on the same principle)&lt;br/&gt;&lt;br/&gt;Independently I think we should have a hint in our readme file about where&lt;br/&gt;and how people can disclose attacks and vulnerabilities. Implementations&lt;br/&gt;have this but the BOLTs do not.&lt;br/&gt;&lt;br/&gt;with kind regards Rene&lt;br/&gt;&lt;br/&gt;-- &lt;br/&gt;&lt;br/&gt;&lt;a href=&#34;https://www.rene-pickhardt.de&#34;&gt;https://www.rene-pickhardt.de&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;Skype: rene.pickhardt&lt;br/&gt;-------------- next part --------------&lt;br/&gt;An HTML attachment was scrubbed...&lt;br/&gt;URL: &amp;lt;&lt;a href=&#34;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20200617/07158fbc/attachment-0001.html&amp;gt&#34;&gt;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20200617/07158fbc/attachment-0001.html&amp;gt&lt;/a&gt;;
    </content>
    <updated>2023-06-09T15:00:23&#43;02:00</updated>
  </entry>

  <entry>
    <id>https://nostr.ae/nevent1qqstpgjrrw0hqm9u4ufn0nj42qgacjve5trfn6pwm6m0xjwkpgmhftszyqtuekymu22uptn978xnws9fmtvyaj9k6uzswy487p9w22zt974ejfwdzc7</id>
    
      <title type="html">📅 Original date posted:2020-02-09 📝 Original message: Good ...</title>
    
    <link rel="alternate" href="https://nostr.ae/nevent1qqstpgjrrw0hqm9u4ufn0nj42qgacjve5trfn6pwm6m0xjwkpgmhftszyqtuekymu22uptn978xnws9fmtvyaj9k6uzswy487p9w22zt974ejfwdzc7" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqsww2h63nr9njy0647then9x7rd6mns0ltqssnaet0rh5fkwcwr37q8h45f8&#39;&gt;nevent1q…45f8&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2020-02-09&lt;br/&gt;📝 Original message:&lt;br/&gt;Good Morning Cezary,&lt;br/&gt;&lt;br/&gt;you might want to direct questions about understanding the lightning&lt;br/&gt;network protocol like yours to &lt;a href=&#34;https://bitcoin.stackexchanage.com&#34;&gt;https://bitcoin.stackexchanage.com&lt;/a&gt; as this&lt;br/&gt;mailinglist is more devoted towards driving the development of the&lt;br/&gt;protocol. Anyway here are the answers to your questions 2 and 3 and&lt;br/&gt;probably also to the first one though I am not entirely sure if I&lt;br/&gt;understand exactly what you are asking for. In case I misunderstood you&lt;br/&gt;suggest to put follow up questions on stackexchange.&lt;br/&gt;&lt;br/&gt;1. Is this possible that by sending funds without invoice, the last hub&lt;br/&gt;&amp;gt; prepares the last HTLC with small amount to the payee? In other words - Can&lt;br/&gt;&amp;gt; payee detect, that the last HTLC amount is smaller that it should be?&lt;br/&gt;&amp;gt;&lt;br/&gt;&lt;br/&gt;But in general the payee will only release the preimage for an invoice if&lt;br/&gt;the payee is satisfied with the amount - which is usually specified in the&lt;br/&gt;invoice. If you talk about keysend then the payee does not expect an amount&lt;br/&gt;and will most likely release the preimage as the payee would consider this&lt;br/&gt;to be free money&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&amp;gt; 2. Are there additional data added to the end of onion encrypted list of&lt;br/&gt;&amp;gt; HTLCs in order to prevent last hub to guess, that it is the last hub in the&lt;br/&gt;&amp;gt; route?&lt;br/&gt;&amp;gt;&lt;br/&gt;&lt;br/&gt;yes the onions are always of constant size (20 * 65 Byte = 1300 Byte) This&lt;br/&gt;process of padding is well described in the Sphinx paper&lt;br/&gt;&lt;a href=&#34;https://cypherpunks.ca/~iang/pubs/Sphinx_Oakland09.pdf&#34;&gt;https://cypherpunks.ca/~iang/pubs/Sphinx_Oakland09.pdf&lt;/a&gt; and in BOLT 04&lt;br/&gt;&lt;a href=&#34;https://github.com/lightningnetwork/lightning-rfc/blob/master/04-onion-routing.md&#34;&gt;https://github.com/lightningnetwork/lightning-rfc/blob/master/04-onion-routing.md&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;3. When payment is during confirmation, are channels locked entirely, or&lt;br/&gt;&amp;gt; only for the in flight payment amount? In other words - can single channel&lt;br/&gt;&amp;gt; process more that single transaction at once?&lt;br/&gt;&amp;gt;&lt;br/&gt;&lt;br/&gt;HTLCs are additional outputs in the commitment transaction. The protocol&lt;br/&gt;allows for up to 483 htlcs concurrently in flight as specified in BOLT 04 (&amp;#34;&lt;br/&gt;max_accepted_htlcs is limited to 483 to ensure that, even if both sides&lt;br/&gt;send the maximum number of HTLCs, the commitment_signed message will still&lt;br/&gt;be under the maximum message size. It also ensures that a single penalty&lt;br/&gt;transaction can spend the entire commitment transaction, as calculated in BOLT&lt;br/&gt;#5&lt;br/&gt;&amp;lt;&lt;a href=&#34;https://github.com/lightningnetwork/lightning-rfc/blob/master/05-onchain.md#penalty-transaction-weight-calculation&amp;gt&#34;&gt;https://github.com/lightningnetwork/lightning-rfc/blob/master/05-onchain.md#penalty-transaction-weight-calculation&amp;gt&lt;/a&gt;;&lt;br/&gt;.&amp;#34;)&lt;br/&gt;&lt;br/&gt;However the the standard of implementations and recommendation is 30. This&lt;br/&gt;means that a single payment is not freezing the channel. It however &amp;#34;locks&amp;#34;&lt;br/&gt;the amount of that payment which for the time until settlement cannot be&lt;br/&gt;used by either party of the channel for other payments / activities.&lt;br/&gt;&lt;br/&gt;with kind regards Rene&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&amp;gt; I would like to kindly pleas to reply in simple words, as my English is&lt;br/&gt;&amp;gt; still far from being perfect.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Best Regards,&lt;br/&gt;&amp;gt; Cezary Dziemian&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; _______________________________________________&lt;br/&gt;&amp;gt; Lightning-dev mailing list&lt;br/&gt;&amp;gt; Lightning-dev at lists.linuxfoundation.org&lt;br/&gt;&amp;gt; &lt;a href=&#34;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&#34;&gt;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&lt;/a&gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;-- &lt;br/&gt;&lt;a href=&#34;https://www.rene-pickhardt.de&#34;&gt;https://www.rene-pickhardt.de&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;Skype: rene.pickhardt&lt;br/&gt;&lt;br/&gt;mobile: &#43;49 (0)176 5762 3618&lt;br/&gt;-------------- next part --------------&lt;br/&gt;An HTML attachment was scrubbed...&lt;br/&gt;URL: &amp;lt;&lt;a href=&#34;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20200209/d8727a02/attachment-0001.html&amp;gt&#34;&gt;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20200209/d8727a02/attachment-0001.html&amp;gt&lt;/a&gt;;
    </content>
    <updated>2023-06-09T14:58:50&#43;02:00</updated>
  </entry>

  <entry>
    <id>https://nostr.ae/nevent1qqsf0jra8z7nmqkjesceekpgfpvjh37dcvcah49n79vsl3n5cd7l5cqzyqtuekymu22uptn978xnws9fmtvyaj9k6uzswy487p9w22zt974ej2k567x</id>
    
      <title type="html">📅 Original date posted:2020-01-07 📝 Original message: Good ...</title>
    
    <link rel="alternate" href="https://nostr.ae/nevent1qqsf0jra8z7nmqkjesceekpgfpvjh37dcvcah49n79vsl3n5cd7l5cqzyqtuekymu22uptn978xnws9fmtvyaj9k6uzswy487p9w22zt974ej2k567x" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqs0u9gewjknzxgyqqqpeh97mpah6zlkuv6dsxjc3rmrdc6pj5uy9kq0k2f7y&#39;&gt;nevent1q…2f7y&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2020-01-07&lt;br/&gt;📝 Original message:&lt;br/&gt;Good morning ZmnSCPxj, and list,&lt;br/&gt;&lt;br/&gt;the answer to your question is absolutely yes and we can can achieve this&lt;br/&gt;actually in a very simple and elegant way.&lt;br/&gt;&lt;br/&gt;Please find attached a clear and simple adaption of the algorithm described&lt;br/&gt;from the paper for a general multipath payment and a small python code&lt;br/&gt;example available at:&lt;br/&gt;&lt;a href=&#34;https://github.com/renepickhardt/Imbalance-measure-and-proactive-channel-rebalancing-algorithm-for-the-Lightning-Network/blob/master/code/mppalgo.py&#34;&gt;https://github.com/renepickhardt/Imbalance-measure-and-proactive-channel-rebalancing-algorithm-for-the-Lightning-Network/blob/master/code/mppalgo.py&lt;/a&gt;&lt;br/&gt;that computes this in a model case (assuming 10 payment channels that all&lt;br/&gt;have a capacity of 1 BTC just to save some lines in coding). The output of&lt;br/&gt;the code is at the end of the Mail.&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;Algorithm to conduct payments which optimally (? I have not proved this yet&lt;br/&gt;but I see no way that would be more optimal with respect to the&lt;br/&gt;Ginicoefficients) reduces the imbalance of nodes when conducting a&lt;br/&gt;(multipath)payment.&lt;br/&gt;&lt;br/&gt;Let us assume a node $u$ wants to pay someone for an amount $a$.&lt;br/&gt;&lt;br/&gt;1. We assume the payment was already achieved over some channel(s) and&lt;br/&gt;compute the new node balance coefficient $\nu&amp;#39;_u$ after this imaginary&lt;br/&gt;payment has been conducted as $\frac{\tau_u - a}{\kappa_u}$. remember&lt;br/&gt;\tau_u is just the total amount of funds that node $u$ currently has and&lt;br/&gt;$\kappa_u$ is the sum of the capacities of all its payment channels.&lt;br/&gt;2. For all online channel partners $\{v_1,...,v_d\}$ we compute&lt;br/&gt;$\zeta_{(u,v_1),...,\zeta_{(u,v_d})}$&lt;br/&gt;3. Let us assume channels are ordered such that&lt;br/&gt;$\zeta_{(u,v_1)&amp;gt;...&amp;gt;\zeta_{(u,v_d&amp;#39;})}$ and omit channels with $\zeta(u,v_i)&lt;br/&gt;- \nu&amp;#39;_u &amp;lt; 0$ Those channels need more funds and should not be used to pay.&lt;br/&gt;That is why we might have $d&amp;#39; &amp;lt; d$&lt;br/&gt;5. Compute all $d&amp;#39;$ rebalancing amounts $r_i =&lt;br/&gt;c(u,v_i)*(\zeta_{(u,v_i)}-\nu&amp;#39;_u)$ as in the paper but with the new node&amp;#39;s&lt;br/&gt;balance coefficient!&lt;br/&gt;6. set $R = sum_i r_i$&lt;br/&gt;7. distribute payments across channels  $a_i = a*r_i/R$ being the amount&lt;br/&gt;$a_i$ that should be paid on channel $i$. Recall $a_i &amp;lt; a$ and $sum_i a_i =&lt;br/&gt;a$ and $a_i &amp;lt; r_i$. This means that with this computation all channel have&lt;br/&gt;enough liquidity to do the subpayments and the subpayments will add up to&lt;br/&gt;the amount (ignoring channel reserves)&lt;br/&gt;8. probe for paths for each amount and channel (potentially split the&lt;br/&gt;amount for a channel across several paths that all start with that&lt;br/&gt;channel). As we don&amp;#39;t know what the rest of the network looks like we don&amp;#39;t&lt;br/&gt;know if we will be able to find paths for each channel (as before)&lt;br/&gt;&lt;br/&gt;Now the really nice side effect: We could compute routing hints for the&lt;br/&gt;invoices in the same way! by now taking the channels where $\zeta(u,v_i) -&lt;br/&gt;\nu&amp;#39;_u$ &amp;lt; 0. We could also split the amounts in that way and also give&lt;br/&gt;amounts together with the routing hints. This would allow a sender to send&lt;br/&gt;the payments in a way that is most benefitial too us. (The sender could&lt;br/&gt;also follow the above method for their outgoing channels) Only the rest of&lt;br/&gt;the network might suffer worse imbalance bus guess what they charge a&lt;br/&gt;routing fee for that service!&lt;br/&gt;&lt;br/&gt;With these nice results let me just review some notation from the paper (so&lt;br/&gt;that we in future might all agree to this wording/termonology):&lt;br/&gt;&lt;br/&gt;* *Rebalancing* is the operation of moving funds along circular paths&lt;br/&gt;between channels. As pointed out in the past this does not really change&lt;br/&gt;the topology of the graph as the properties like the max flow / min cut&lt;br/&gt;will not be affected by this. As such some people (including myself) have&lt;br/&gt;argued in the past that multipathpayments are sufficient for path finding&lt;br/&gt;as they will quicker find the max flow and that rebalancing is not&lt;br/&gt;necessary. However the results of my research indicate that such operations&lt;br/&gt;will increase the likelihood of arbitrary payments to succeed and thus (at&lt;br/&gt;least in my interpretation) increase the reliability of the network.&lt;br/&gt;* in particular a node is *balanced* if the zeta values are the same and&lt;br/&gt;the gini coefficient is zero. While this is the case for all channels being&lt;br/&gt;50-50 there are far less strict ways of achieving a good balance than&lt;br/&gt;asking for channels to be opened in such a way that everyone ha 50-50.&lt;br/&gt;* *Making payments actually changes the topology* of the network (similarly&lt;br/&gt;to opening and closing channels). With the notation of the paper the \tau&lt;br/&gt;values change and are part of the topology. This way &amp;#34;rebalancing&amp;#34; with&lt;br/&gt;submarine swaps using loop or any of those services is not a rebalancing&lt;br/&gt;operation in the sense of the paper and/or the above point but in fact a&lt;br/&gt;change of topology.&lt;br/&gt;* combining topology changes with rebalancing operations (which is often&lt;br/&gt;the goal when making submarine swaps) seems however to be a good idea. In&lt;br/&gt;that sense your general thought of rebalancing while paying should be&lt;br/&gt;pursued.&lt;br/&gt;&lt;br/&gt;Last but not least the promised output of the example code:&lt;br/&gt;&lt;br/&gt;$ python3 mppalgo.py&lt;br/&gt;0.3 initial imblance&lt;br/&gt;new funds 4.8 and new node balance coefficient 0.48&lt;br/&gt;&lt;br/&gt;Conduct the following payments:&lt;br/&gt;channel 0 old balance: 1.00, payment amount 0.22 new balance 0.78&lt;br/&gt;channel 1 old balance: 0.90, payment amount 0.18 new balance 0.72&lt;br/&gt;channel 2 old balance: 0.80, payment amount 0.14 new balance 0.66&lt;br/&gt;channel 3 old balance: 0.70, payment amount 0.10 new balance 0.60&lt;br/&gt;channel 4 old balance: 0.60, payment amount 0.05 new balance 0.55&lt;br/&gt;channel 5 old balance: 0.50, payment amount 0.01 new balance 0.49&lt;br/&gt;&lt;br/&gt;---- unchanged channels as they need more funds on our side ----&lt;br/&gt;&lt;br/&gt;channel 6 old balance: 0.40, payment amount 0.00 new balance 0.40&lt;br/&gt;channel 7 old balance: 0.30, payment amount 0.00 new balance 0.30&lt;br/&gt;channel 8 old balance: 0.20, payment amount 0.00 new balance 0.20&lt;br/&gt;channel 9 old balance: 0.10, payment amount 0.00 new balance 0.10&lt;br/&gt;total amount paid over several channels:  0.7&lt;br/&gt;(was asked to send: 0.7)&lt;br/&gt;&lt;br/&gt;new imbalance 0.25 and old imbalance 0.30&lt;br/&gt;&lt;br/&gt;Have a nice day! Rene&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;On Tue, Jan 7, 2020 at 3:30 AM ZmnSCPxj &amp;lt;ZmnSCPxj at protonmail.com&amp;gt; wrote:&lt;br/&gt;&lt;br/&gt;&amp;gt; Good morning Rene, and list,&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; It seems to me that the rule used here might be useful to guide how to&lt;br/&gt;&amp;gt; split a payment for multipath as well.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; For example, consider the case where a payer Alice has channels to Bob and&lt;br/&gt;&amp;gt; Charlie.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; * Alice-Bob has A=0.5, B=0.5&lt;br/&gt;&amp;gt; * Alice-Charlie has A=0.5, C=0.5&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; In that case, in order to retain balance, if Alice has to pay 0.1, it&lt;br/&gt;&amp;gt; should strive to split the payment into a 0.05 via Alice-Bob and 0.05 via&lt;br/&gt;&amp;gt; Alice-Charlie.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Would it be possible to derive such a calculation from your published rule?&lt;br/&gt;&amp;gt; For example, if one of the payer channels is imbalanced in favor of the&lt;br/&gt;&amp;gt; payer, then the payment probably should not be split, but if the payment is&lt;br/&gt;&amp;gt; big enough that it would be imbalanced against the payer afterwards, then&lt;br/&gt;&amp;gt; some small amount must be split out to another channel.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Regards,&lt;br/&gt;&amp;gt; ZmnSCPxj&lt;br/&gt;&amp;gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;-- &lt;br/&gt;&lt;a href=&#34;https://www.rene-pickhardt.de&#34;&gt;https://www.rene-pickhardt.de&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;Skype: rene.pickhardt&lt;br/&gt;&lt;br/&gt;mobile: &#43;49 (0)176 5762 3618&lt;br/&gt;-------------- next part --------------&lt;br/&gt;An HTML attachment was scrubbed...&lt;br/&gt;URL: &amp;lt;&lt;a href=&#34;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20200107/53e1fd73/attachment.html&amp;gt&#34;&gt;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20200107/53e1fd73/attachment.html&amp;gt&lt;/a&gt;;
    </content>
    <updated>2023-06-09T14:57:59&#43;02:00</updated>
  </entry>

  <entry>
    <id>https://nostr.ae/nevent1qqs9ct8cguk4dwfzgmxw8ya43ljdavhyqa52euuccx4rcsln92lcl3gzyqtuekymu22uptn978xnws9fmtvyaj9k6uzswy487p9w22zt974ejjcr8px</id>
    
      <title type="html">📅 Original date posted:2019-03-14 📝 Original message: Hey ...</title>
    
    <link rel="alternate" href="https://nostr.ae/nevent1qqs9ct8cguk4dwfzgmxw8ya43ljdavhyqa52euuccx4rcsln92lcl3gzyqtuekymu22uptn978xnws9fmtvyaj9k6uzswy487p9w22zt974ejjcr8px" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqsyg206e3dyuxqcm4knqq0h5umm3kwjrjsk4cnhvkw62xuf8264wscudltc4&#39;&gt;nevent1q…ltc4&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2019-03-14&lt;br/&gt;📝 Original message:&lt;br/&gt;Hey everyone,&lt;br/&gt;&lt;br/&gt;I am glad the suggestion is being picked up. At this time I want to respond&lt;br/&gt;to two of the concerns that have been thrown in. I have some other comments&lt;br/&gt;and ideas but would like to hold them back so that we can have more people&lt;br/&gt;joining the discussion without bias also this mail will already be quite&lt;br/&gt;long.&lt;br/&gt;&lt;br/&gt;ZmnSCPxj suggested to introduce a `success_rate` for JIT routing. While&lt;br/&gt;this success_rate can obviously only be estimated or configured I would&lt;br/&gt;advice against including this to the protocol. As I mentioned before I&lt;br/&gt;suggested to include JIT Routing as a MAY Recommendation so it is up to the&lt;br/&gt;node to decide if it cannot earn `offered_fee_amount` to engage in the&lt;br/&gt;JIT-rebalancing operation. A node operator might be willing in general to&lt;br/&gt;to pay a fee for rebalancing even if there is not an outstanding routing&lt;br/&gt;event taking place. So even while `rebalancing_fee_amount` &amp;gt;&lt;br/&gt;`offered_fee_amount` the node could see the offered_fee_amount as a&lt;br/&gt;discount for the planned rebalancing amount. We don&amp;#39;t know that and I&lt;br/&gt;honestly believe that the protocol should not make economical decisions for&lt;br/&gt;the node. In any case rebalancing will overall increase the likelihood for&lt;br/&gt;successful routing but it makes sense to defer the rebalancing operation to&lt;br/&gt;a moment in which the liquidity is actually needed.&lt;br/&gt;&lt;br/&gt;Regarding Ariels suggestion about reusing the payment hash with JIT Routing&lt;br/&gt;I have some more thoughts:&lt;br/&gt;Reusing the payment hash indeed seems like a good idea. However it produces&lt;br/&gt;some technical issues which in my opinion can all be mitigated. it is just&lt;br/&gt;a question with these challenges if it is worthwhile doing it?&lt;br/&gt;&lt;br/&gt;I have drawn several situations and tried to construct an example in which&lt;br/&gt;using the same payment hash for the JIT-rebalancing would result in a&lt;br/&gt;severe problem with the payment process in the sense that it would be&lt;br/&gt;compromised or somebody could steal funds. It could however be a privacy&lt;br/&gt;issue as more nodes are being aware of the same payment (but that is also&lt;br/&gt;the case with base-AMP)&lt;br/&gt;I was not able to construct such a situation (under the assumption that the&lt;br/&gt;rebalancing amount does not exceed the original payment amount). My feeling&lt;br/&gt;(though I have not done this yet) is that one should be able to proof that&lt;br/&gt;taking the same payment hash would always work and in fact create a&lt;br/&gt;situation in which at least the rebalancing only takes place if the entire&lt;br/&gt;payment was routed successfully.&lt;br/&gt;&lt;br/&gt;Assuming someone will be able to proof that using the same payment hash for&lt;br/&gt;JIT Routing is not an issue we still run into another problem (which I&lt;br/&gt;believe can be fixed with another MUST rule but comes with quite some&lt;br/&gt;implementation overhead.)&lt;br/&gt;&lt;br/&gt;The deadlock problem when doing JIT Routing with the same payment hash:&lt;br/&gt;When using the same payment hash there will be two htlc&amp;#39;s (potentially of&lt;br/&gt;different amounts) in opposing directions on the same channel (or in the&lt;br/&gt;lnd case maybe between separate channels between the same two peers).&lt;br/&gt;Unluckily without a novel rule this can produce a deadlock.&lt;br/&gt;&lt;br/&gt;As an example take the situation from my initial email with an additional&lt;br/&gt;recipient R1:&lt;br/&gt;&lt;br/&gt;  100 / 110     80 / 200      150/180&lt;br/&gt;S ----------&amp;gt; B --------&amp;gt; R ----------&amp;gt; R1&lt;br/&gt;              \         /&lt;br/&gt;        80/200  \     /  100/200&lt;br/&gt;                  \ /&lt;br/&gt;                             T&lt;br/&gt;&lt;br/&gt;Meaning we have the following channels:&lt;br/&gt;S ---&amp;gt; B capacity: 110   A funds: 100  B funds:  10&lt;br/&gt;B ---&amp;gt; R capacity: 200   B funds:  80  R funds: 120&lt;br/&gt;B ---&amp;gt; T capacity: 200   B funds:  80  T funds: 120&lt;br/&gt;T ---&amp;gt; R capacity: 200   T funds: 100  R funds: 100&lt;br/&gt;R ---&amp;gt; R1 capacity: 180   R funds: 150  R1 funds: 30&lt;br/&gt;&lt;br/&gt;neglecting fees the following htlcs would be offered&lt;br/&gt;1.) S--&amp;gt;B amount: 90&lt;br/&gt;2.) B--&amp;gt;T amount:50&lt;br/&gt;3.) T--&amp;gt;R amount:50&lt;br/&gt;4.) R--&amp;gt;B amount: 50&lt;br/&gt;5.) B--&amp;gt;R amount: 90 (difficult to set up before 4. settles)&lt;br/&gt;6.) R--&amp;gt;R1 amount: 90&lt;br/&gt;&lt;br/&gt;while 1,5 and 6 are the original path 2,3,4 are the JIT rebalancing.&lt;br/&gt;&lt;br/&gt;We see that in this situation using the same preimage results in a problem.&lt;br/&gt;Since the rebalancing is not settled R will not accept the 5th htlc (B---&amp;gt;R&lt;br/&gt;amount: 90) as there is not enough liquidity on B&amp;#39;s side producing a&lt;br/&gt;deadlock&lt;br/&gt;However since the same payment hash is used it is save to combine the 4th&lt;br/&gt;and 5th htlc to have the following situation:&lt;br/&gt;&lt;br/&gt;1.) S--&amp;gt;B amount: 90&lt;br/&gt;2.) B--&amp;gt;T amount:50&lt;br/&gt;3.) T--&amp;gt;R amount:50&lt;br/&gt;4.) R--&amp;gt;B will be removed or settled or replaced by the 5th htlcs with a&lt;br/&gt;different amount (90 - 50)&lt;br/&gt;5.) B--&amp;gt;R amount: 40&lt;br/&gt;6.) R--&amp;gt;R1 amount: 90&lt;br/&gt;&lt;br/&gt;Note that while theoretically it seems tempting to just have two htlc&lt;br/&gt;outputs as the second node could always claim the htlc if the first claims&lt;br/&gt;theirs. However this will not work onchain as potentially more funds are&lt;br/&gt;spend than exist.&lt;br/&gt;&lt;br/&gt;Therefor we need a MUST-rule to fix the deadlock problem (which could&lt;br/&gt;probably also be formulated in a symmetric way):&lt;br/&gt;If a node N offers an htlc to a partner with an amount x from whom the node&lt;br/&gt;already received an htlc y (where y is smaller than x) the nodes must&lt;br/&gt;create a new channel state discarding the old htlc but having a new offer&lt;br/&gt;from N with the amount x-y.&lt;br/&gt;&lt;br/&gt;This decreases the liquidity bound in the routing process, enables for a&lt;br/&gt;critical channel to be rebalanced several times during several JIT&lt;br/&gt;operations and keeps the onchain footprint low as there are less htlc&lt;br/&gt;outputs.&lt;br/&gt;&lt;br/&gt;Also as mentioned above it seems crucial that the rebalancing amount must&lt;br/&gt;not exceed the original payment amount if the payment hash is being reused.&lt;br/&gt;Imagine there was no R1 and R was actually the final destination and B&lt;br/&gt;decides to rebalance an amount larger than necessary (which could not&lt;br/&gt;happen in our setup). R could release the preimage before setting up the&lt;br/&gt;final htlc from R back to B to fulfill the rebalancing request. This could&lt;br/&gt;also happen if T was the final recipient (which R would not now!)&lt;br/&gt;&lt;br/&gt;The only way how I see that this problem can be mitigated is by introducing&lt;br/&gt;the following rule (morally even as a MUST rule)&lt;br/&gt;If a node decides to engage in JIT Routing using the same payment hash as&lt;br/&gt;the incoming htlc it SHOULD NOT rebalance an amount higher than the&lt;br/&gt;incoming HTLCs. If it rebalances with a new payment hash it MAY use an&lt;br/&gt;arbitrary amount.&lt;br/&gt;Rational: (as described above)&lt;br/&gt;&lt;br/&gt;Another problem while reusing the payment hash is that in this situation&lt;br/&gt;the node who issued the invoice could be involved in a rebalancing act and&lt;br/&gt;decline an htlc as the amount is not sufficient for the invoice. Therefor&lt;br/&gt;we would have to set either the base-AMP feature flag or create a new one&lt;br/&gt;for JIT-routing which would signal that there are more htlc&amp;#39;s coming which&lt;br/&gt;need to be combined to forward an onion.&lt;br/&gt;&lt;br/&gt;In order to avoid this complex aggregation of htlcs we could also see this&lt;br/&gt;process as a local AMP right a way saying that a node instead of forwarding&lt;br/&gt;the onion MAY do a local base-AMP to the next recipient.&lt;br/&gt;&lt;br/&gt;So in my opinion this suggestions to reuse the payment hash is not only&lt;br/&gt;reasonable but actually desirable in particular if we can proof that it is&lt;br/&gt;not a problem and if we agree that we can mitigate the technical challenges&lt;br/&gt;which I described in this mail.&lt;br/&gt;&lt;br/&gt;Best regards Rene&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;On Thu, Mar 14, 2019 at 2:08 PM Ariel Lorenzo-Luaces &amp;lt;arielluaces at gmail.com&amp;gt;&lt;br/&gt;wrote:&lt;br/&gt;&lt;br/&gt;&amp;gt; Hello Rene, ZmnSCPxj, and list&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; I really like the proposal and I&amp;#39;m sure it&amp;#39;s the correct way forward for&lt;br/&gt;&amp;gt; reducing payment failures and increasing privacy (through mitigating&lt;br/&gt;&amp;gt; probing based network analysis)&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; However I am concerned that this proposal could introduce a vulnerability&lt;br/&gt;&amp;gt; to a spoofed-payment attack.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; An adversary could create a malicious payment that&amp;#39;s guaranteed to fail,&lt;br/&gt;&amp;gt; for free. Any intermediary nodes on the path of the payment before it fails&lt;br/&gt;&amp;gt; could lose fees due to rebalancing if the rebalancing path&amp;#39;s success is not&lt;br/&gt;&amp;gt; dependent on the original payment&amp;#39;s success.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Could anyone speak to this and confirm whether it would be possible for&lt;br/&gt;&amp;gt; the rebalancing step to reuse the original payment hash? If this is&lt;br/&gt;&amp;gt; possible then it should explicitly be included in this proposal.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; If reusing the payment hash is not possible on the routing path then JIT&lt;br/&gt;&amp;gt; routing would need some other mitigation for the spoofed-payment attack.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Cheers&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Ariel Lorenzo-Luaces&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; On Mar 14, 2019, at 7:45 AM, ZmnSCPxj via Lightning-dev &amp;lt;&lt;br/&gt;&amp;gt; lightning-dev at lists.linuxfoundation.org&amp;gt; wrote:&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Good morning Rene and list,&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Let us consider then the rule *when* a rebalancing would be beneficial to the node.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; The node is offered a fee amount (`offered_fee_amount`) for the forwarding.&lt;br/&gt;&amp;gt;&amp;gt; It knows that, under current channel states, it will definitely have to fail and earn 0 fees.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; If it engages in JIT-routing, it must pay some fee (`rebalancing_fee_amount`) for the rebalancing operation.&lt;br/&gt;&amp;gt;&amp;gt; But even if it successfully forwards its hop, it is still possible that the route will fail anyway and it will earn 0 fees.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; So let us consider the probability of success (`success_rate`), a value between 0 to 1.0.&lt;br/&gt;&amp;gt;&amp;gt; This is the estimated probability that we will succeed the route after we forward it.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; We should only engage in JIT-routing if:&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;     offered_fee_amount * success_rate - rebalancing_fee_amount &amp;gt; 0&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; The LHS of the subtraction is the expected earning, while the RHS of the subtraction is the expected cost.&lt;br/&gt;&amp;gt;&amp;gt; The above is trivial accounting for determining net earnings.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; The fee amounts are trivially computable.&lt;br/&gt;&amp;gt;&amp;gt; Presumably the rebalancing code can compute the fee given a particular rebalance path, and thus can provide `rebalancing_fee_amount`.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; The `success_rate` can be computed statically from some node data.&lt;br/&gt;&amp;gt;&amp;gt; Better, is for the node to start with this precomputed static information, but augment this over time with its own experienced `success_rate` for all forwards.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Regards,&lt;br/&gt;&amp;gt;&amp;gt; ZmnSCPxj&lt;br/&gt;&amp;gt;&amp;gt; ------------------------------&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Lightning-dev mailing list&lt;br/&gt;&amp;gt;&amp;gt; Lightning-dev at lists.linuxfoundation.org&lt;br/&gt;&amp;gt;&amp;gt; &lt;a href=&#34;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&#34;&gt;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; _______________________________________________&lt;br/&gt;&amp;gt; Lightning-dev mailing list&lt;br/&gt;&amp;gt; Lightning-dev at lists.linuxfoundation.org&lt;br/&gt;&amp;gt; &lt;a href=&#34;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&#34;&gt;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&lt;/a&gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;-- &lt;br/&gt;&lt;a href=&#34;https://www.rene-pickhardt.de&#34;&gt;https://www.rene-pickhardt.de&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;Skype: rene.pickhardt&lt;br/&gt;&lt;br/&gt;mobile: &#43;49 (0)176 5762 3618&lt;br/&gt;-------------- next part --------------&lt;br/&gt;An HTML attachment was scrubbed...&lt;br/&gt;URL: &amp;lt;&lt;a href=&#34;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20190314/35731641/attachment-0001.html&amp;gt&#34;&gt;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20190314/35731641/attachment-0001.html&amp;gt&lt;/a&gt;;
    </content>
    <updated>2023-06-09T14:54:23&#43;02:00</updated>
  </entry>

  <entry>
    <id>https://nostr.ae/nevent1qqsv8rpzktqzg5f8sf6jklvyss4x7wyrm70pyrzv4gtzda3e7uuu55qzyqtuekymu22uptn978xnws9fmtvyaj9k6uzswy487p9w22zt974ej343vcx</id>
    
      <title type="html">📅 Original date posted:2019-01-24 📝 Original message: Dear ...</title>
    
    <link rel="alternate" href="https://nostr.ae/nevent1qqsv8rpzktqzg5f8sf6jklvyss4x7wyrm70pyrzv4gtzda3e7uuu55qzyqtuekymu22uptn978xnws9fmtvyaj9k6uzswy487p9w22zt974ej343vcx" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqsyrl0r5des0j79qvjygd566aj60hcev9049skxnsp7jgy3uvu3qws3a3ztq&#39;&gt;nevent1q…3ztq&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2019-01-24&lt;br/&gt;📝 Original message:&lt;br/&gt;Dear Melvin,&lt;br/&gt;&lt;br/&gt;I believe the vocabulary is not consistent across implementations. For&lt;br/&gt;example if you look at c lightning there is no such command `describegraph`&lt;br/&gt;but there are the two commands `listnodes` and `listchannels` which should&lt;br/&gt;give the same information. For both I have attached a sample output at the&lt;br/&gt;end of the mail to demonstrate how the naming of the vocabulary differs.&lt;br/&gt;&lt;br/&gt;Since the data of these commands is taken from the gossip store which&lt;br/&gt;stores the gossip messages I would suggest to take the vocabulary from the&lt;br/&gt;BOLT 07 which defines the gossip messages. Also this mailinglist is for&lt;br/&gt;protocol development and the spec should be the authorative source for&lt;br/&gt;naming:&lt;br/&gt;&lt;a href=&#34;https://github.com/lightningnetwork/lightning-rfc/blob/master/07-routing-gossip.md&#34;&gt;https://github.com/lightningnetwork/lightning-rfc/blob/master/07-routing-gossip.md&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;There are more terms specified in other bolts which could be a basis for a&lt;br/&gt;vocabulary. I have created an overview by hand and made a Pull Request to&lt;br/&gt;the repository which has not been merged yet as it was the wish of the&lt;br/&gt;developers to have such a list to be extracted automatically.&lt;br/&gt;Still this the overview in that pull request could serve as a basis for&lt;br/&gt;such a vocabulary :&lt;br/&gt;&lt;a href=&#34;https://github.com/lightningnetwork/lightning-rfc/pull/458&#34;&gt;https://github.com/lightningnetwork/lightning-rfc/pull/458&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;Now the example outputs from c-lightning we already that there are&lt;br/&gt;differences in naming. Take the identifier for a node for example:&lt;br/&gt;* BOLT07: node_id&lt;br/&gt;* LND: pub_key&lt;br/&gt;* clightning: nodeid&lt;br/&gt;&lt;br/&gt;example outputs:&lt;br/&gt;&lt;br/&gt;lighting-cli listnodes&lt;br/&gt; {&lt;br/&gt;      &amp;#34;nodeid&amp;#34;:&lt;br/&gt;&amp;#34;02396bf51e81f8f67eaca3652271b4fe8d3f57bedb9578af711606391c5c66760e&amp;#34;,&lt;br/&gt;      &amp;#34;alias&amp;#34;: &amp;#34;PuraSloboda&amp;#34;,&lt;br/&gt;      &amp;#34;color&amp;#34;: &amp;#34;68f442&amp;#34;,&lt;br/&gt;      &amp;#34;last_timestamp&amp;#34;: 1548200218,&lt;br/&gt;      &amp;#34;globalfeatures&amp;#34;: &amp;#34;&amp;#34;,&lt;br/&gt;      &amp;#34;global_features&amp;#34;: &amp;#34;&amp;#34;,&lt;br/&gt;      &amp;#34;addresses&amp;#34;: [&lt;br/&gt;        {&lt;br/&gt;          &amp;#34;type&amp;#34;: &amp;#34;ipv4&amp;#34;,&lt;br/&gt;          &amp;#34;address&amp;#34;: &amp;#34;144.136.223.22&amp;#34;,&lt;br/&gt;          &amp;#34;port&amp;#34;: 9735&lt;br/&gt;        }&lt;br/&gt;      ]&lt;br/&gt;    }&lt;br/&gt;&lt;br/&gt;lightning-cli listchannels&lt;br/&gt;{&lt;br/&gt;      &amp;#34;source&amp;#34;:&lt;br/&gt;&amp;#34;03bb88ccc444534da7b5b64b4f7b15e1eccb18e102db0e400d4b9cfe93763aa26d&amp;#34;,&lt;br/&gt;      &amp;#34;destination&amp;#34;:&lt;br/&gt;&amp;#34;0272045af48b9871013753f7cce1cf82ed80b97d669ca44709e01976a67df80adc&amp;#34;,&lt;br/&gt;      &amp;#34;short_channel_id&amp;#34;: &amp;#34;559893:1912:0&amp;#34;,&lt;br/&gt;      &amp;#34;public&amp;#34;: true,&lt;br/&gt;      &amp;#34;satoshis&amp;#34;: 47000,&lt;br/&gt;      &amp;#34;message_flags&amp;#34;: 0,&lt;br/&gt;      &amp;#34;channel_flags&amp;#34;: 1,&lt;br/&gt;      &amp;#34;flags&amp;#34;: 1,&lt;br/&gt;      &amp;#34;active&amp;#34;: true,&lt;br/&gt;      &amp;#34;last_update&amp;#34;: 1548332847,&lt;br/&gt;      &amp;#34;base_fee_millisatoshi&amp;#34;: 1000,&lt;br/&gt;      &amp;#34;fee_per_millionth&amp;#34;: 1,&lt;br/&gt;      &amp;#34;delay&amp;#34;: 144&lt;br/&gt;    }&lt;br/&gt;&lt;br/&gt;With kind regards Rene&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;On Thu, Jan 24, 2019 at 1:21 PM Melvin Carvalho &amp;lt;melvincarvalho at gmail.com&amp;gt;&lt;br/&gt;wrote:&lt;br/&gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; On Mon, 21 Jan 2019 at 14:11, René Pickhardt &amp;lt;r.pickhardt at googlemail.com&amp;gt;&lt;br/&gt;&amp;gt; wrote:&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Dear Melvin,&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; have you looked into the W3C Payment Group?&lt;br/&gt;&amp;gt;&amp;gt; &lt;a href=&#34;https://www.w3.org/TR/payment-request/&#34;&gt;https://www.w3.org/TR/payment-request/&lt;/a&gt; The entire field of semantic web&lt;br/&gt;&amp;gt;&amp;gt; kind of originated from W3C and they are working on a recommendation for&lt;br/&gt;&amp;gt;&amp;gt; browser vendors to enable a low level payment API.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Also there is LightningJoule that builds on top of webln. While this is&lt;br/&gt;&amp;gt;&amp;gt; not an otology it goes implicitly in a similar direction (c.f.:&lt;br/&gt;&amp;gt;&amp;gt; &lt;a href=&#34;https://github.com/wbobeirne/webln&#34;&gt;https://github.com/wbobeirne/webln&lt;/a&gt; and in particular this discussion:&lt;br/&gt;&amp;gt;&amp;gt; &lt;a href=&#34;https://github.com/wbobeirne/webln/issues/1&#34;&gt;https://github.com/wbobeirne/webln/issues/1&lt;/a&gt; in which Will said that in&lt;br/&gt;&amp;gt;&amp;gt; his thoughts webln is different to the W3C Payment Group.)&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; I am looking forward to see your progress with integrating Lightning to&lt;br/&gt;&amp;gt;&amp;gt; the semantic web!&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; with kind regards Rene&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; My first observation is these two data structures in lnd describe graph,&lt;br/&gt;&amp;gt; one for channels and one for nodes.  These seem to be two fundamental&lt;br/&gt;&amp;gt; concepts in lightning.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Channel&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;         {&lt;br/&gt;&amp;gt;             &amp;#34;channel_id&amp;#34;: &amp;#34;615605565348708353&amp;#34;,&lt;br/&gt;&amp;gt;             &amp;#34;chan_point&amp;#34;:&lt;br/&gt;&amp;gt; &amp;#34;d8cfed73e0004fe1427d3045c5b20da0418f3cb803e8e35be48ee713aadbf56d:1&amp;#34;,&lt;br/&gt;&amp;gt;             &amp;#34;last_update&amp;#34;: 1548330355,&lt;br/&gt;&amp;gt;             &amp;#34;node1_pub&amp;#34;:&lt;br/&gt;&amp;gt; &amp;#34;024a2e265cd66066b78a788ae615acdc84b5b0dec9efac36d7ac87513015eaf6ed&amp;#34;,&lt;br/&gt;&amp;gt;             &amp;#34;node2_pub&amp;#34;:&lt;br/&gt;&amp;gt; &amp;#34;03e03c56bb540c36b9e77c2aea2bb6529b907ece6c1395228c05459af13d0e2a5c&amp;#34;,&lt;br/&gt;&amp;gt;             &amp;#34;capacity&amp;#34;: &amp;#34;1000000&amp;#34;,&lt;br/&gt;&amp;gt;             &amp;#34;node1_policy&amp;#34;: {&lt;br/&gt;&amp;gt;                 &amp;#34;time_lock_delta&amp;#34;: 144,&lt;br/&gt;&amp;gt;                 &amp;#34;min_htlc&amp;#34;: &amp;#34;1000&amp;#34;,&lt;br/&gt;&amp;gt;                 &amp;#34;fee_base_msat&amp;#34;: &amp;#34;1000&amp;#34;,&lt;br/&gt;&amp;gt;                 &amp;#34;fee_rate_milli_msat&amp;#34;: &amp;#34;1&amp;#34;,&lt;br/&gt;&amp;gt;                 &amp;#34;disabled&amp;#34;: false&lt;br/&gt;&amp;gt;             },&lt;br/&gt;&amp;gt;             &amp;#34;node2_policy&amp;#34;: {&lt;br/&gt;&amp;gt;                 &amp;#34;time_lock_delta&amp;#34;: 144,&lt;br/&gt;&amp;gt;                 &amp;#34;min_htlc&amp;#34;: &amp;#34;1000&amp;#34;,&lt;br/&gt;&amp;gt;                 &amp;#34;fee_base_msat&amp;#34;: &amp;#34;1000&amp;#34;,&lt;br/&gt;&amp;gt;                 &amp;#34;fee_rate_milli_msat&amp;#34;: &amp;#34;1&amp;#34;,&lt;br/&gt;&amp;gt;                 &amp;#34;disabled&amp;#34;: false&lt;br/&gt;&amp;gt;             }&lt;br/&gt;&amp;gt;         }&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Node&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;         {&lt;br/&gt;&amp;gt;             &amp;#34;last_update&amp;#34;: 1547380072,&lt;br/&gt;&amp;gt;             &amp;#34;pub_key&amp;#34;:&lt;br/&gt;&amp;gt; &amp;#34;0200072fd301cb4a680f26d87c28b705ccd6a1d5b00f1b5efd7fe5f998f1bbb1f1&amp;#34;,&lt;br/&gt;&amp;gt;             &amp;#34;alias&amp;#34;: &amp;#34;OutaSpace&amp;#34;,&lt;br/&gt;&amp;gt;             &amp;#34;addresses&amp;#34;: [&lt;br/&gt;&amp;gt;                 {&lt;br/&gt;&amp;gt;                     &amp;#34;network&amp;#34;: &amp;#34;tcp&amp;#34;,&lt;br/&gt;&amp;gt;                     &amp;#34;addr&amp;#34;: &amp;#34;46.163.78.93:9760&amp;#34;&lt;br/&gt;&amp;gt;                 },&lt;br/&gt;&amp;gt;                 {&lt;br/&gt;&amp;gt;                     &amp;#34;network&amp;#34;: &amp;#34;tcp&amp;#34;,&lt;br/&gt;&amp;gt;                     &amp;#34;addr&amp;#34;: &amp;#34;[2a01:488:66:1000:2ea3:4e5d:0:1]:9760&amp;#34;&lt;br/&gt;&amp;gt;                 },&lt;br/&gt;&amp;gt;                 {&lt;br/&gt;&amp;gt;                     &amp;#34;network&amp;#34;: &amp;#34;tcp&amp;#34;,&lt;br/&gt;&amp;gt;                     &amp;#34;addr&amp;#34;: &amp;#34;2dkobxxunnjatyph.onion:9760&amp;#34;&lt;br/&gt;&amp;gt;                 },&lt;br/&gt;&amp;gt;                 {&lt;br/&gt;&amp;gt;                     &amp;#34;network&amp;#34;: &amp;#34;tcp&amp;#34;,&lt;br/&gt;&amp;gt;                     &amp;#34;addr&amp;#34;:&lt;br/&gt;&amp;gt; &amp;#34;nzslu33ecbokyn32teza2peiiiuye43ftom7jvnuhsxdbg3vhw7w3aqd.onion:9760&amp;#34;&lt;br/&gt;&amp;gt;                 }&lt;br/&gt;&amp;gt;             ],&lt;br/&gt;&amp;gt;             &amp;#34;color&amp;#34;: &amp;#34;#123456&amp;#34;&lt;br/&gt;&amp;gt;         },&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; It would be useful to write a vocab for these and then document what they&lt;br/&gt;&amp;gt; mean.  It would then be possible to add markup to an explorer to make it&lt;br/&gt;&amp;gt; self documenting.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; My first question is : are these terms consistent across different&lt;br/&gt;&amp;gt; implementations e.g. c-lightning, eclair ?&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; On Mon, Jan 21, 2019 at 7:17 AM Melvin Carvalho &amp;lt;melvincarvalho at gmail.com&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; wrote:&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; Hi All&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; I work on the solid project [1] and am very interested in the lightning&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; network.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; In particular, I am looking at trying to create an integration between&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; lightning (layer 2) and solid (layer 3?  web layer?).&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; The first step towards integration would be to port some of the&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; lightning concepts to the semantic web.  This is done by creating an&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; ontology.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; Does anyone know of any existing work in this area.  Alternatively, does&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; anyone have an interest to collaborate on an ontology?&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; Best&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; Melvin&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; [1] &lt;a href=&#34;https://solid.mit.edu/&#34;&gt;https://solid.mit.edu/&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; _______________________________________________&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; Lightning-dev mailing list&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; Lightning-dev at lists.linuxfoundation.org&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &lt;a href=&#34;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&#34;&gt;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; --&lt;br/&gt;&amp;gt;&amp;gt; &lt;a href=&#34;https://www.rene-pickhardt.de&#34;&gt;https://www.rene-pickhardt.de&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Skype: rene.pickhardt&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; mobile: &#43;49 (0)176 5762 3618&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&lt;br/&gt;-- &lt;br/&gt;&lt;a href=&#34;https://www.rene-pickhardt.de&#34;&gt;https://www.rene-pickhardt.de&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;Skype: rene.pickhardt&lt;br/&gt;&lt;br/&gt;mobile: &#43;49 (0)176 5762 3618&lt;br/&gt;-------------- next part --------------&lt;br/&gt;An HTML attachment was scrubbed...&lt;br/&gt;URL: &amp;lt;&lt;a href=&#34;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20190124/8007367f/attachment-0001.html&amp;gt&#34;&gt;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20190124/8007367f/attachment-0001.html&amp;gt&lt;/a&gt;;
    </content>
    <updated>2023-06-09T14:54:05&#43;02:00</updated>
  </entry>

  <entry>
    <id>https://nostr.ae/nevent1qqspywv973yw53u0ex79v5xdp2l25exsfxeve7ttlq2vylfjgc2swwszyqtuekymu22uptn978xnws9fmtvyaj9k6uzswy487p9w22zt974ejn2md8h</id>
    
      <title type="html">📅 Original date posted:2019-01-21 📝 Original message: Dear ...</title>
    
    <link rel="alternate" href="https://nostr.ae/nevent1qqspywv973yw53u0ex79v5xdp2l25exsfxeve7ttlq2vylfjgc2swwszyqtuekymu22uptn978xnws9fmtvyaj9k6uzswy487p9w22zt974ejn2md8h" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqsqjn3v0n260g78j87v32229s9nl005a3dsagc383y658pq2ednxscw5fpfp&#39;&gt;nevent1q…fpfp&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2019-01-21&lt;br/&gt;📝 Original message:&lt;br/&gt;Dear Melvin,&lt;br/&gt;&lt;br/&gt;have you looked into the W3C Payment Group?&lt;br/&gt;&lt;a href=&#34;https://www.w3.org/TR/payment-request/&#34;&gt;https://www.w3.org/TR/payment-request/&lt;/a&gt; The entire field of semantic web&lt;br/&gt;kind of originated from W3C and they are working on a recommendation for&lt;br/&gt;browser vendors to enable a low level payment API.&lt;br/&gt;&lt;br/&gt;Also there is LightningJoule that builds on top of webln. While this is not&lt;br/&gt;an otology it goes implicitly in a similar direction (c.f.:&lt;br/&gt;&lt;a href=&#34;https://github.com/wbobeirne/webln&#34;&gt;https://github.com/wbobeirne/webln&lt;/a&gt; and in particular this discussion:&lt;br/&gt;&lt;a href=&#34;https://github.com/wbobeirne/webln/issues/1&#34;&gt;https://github.com/wbobeirne/webln/issues/1&lt;/a&gt; in which Will said that in his&lt;br/&gt;thoughts webln is different to the W3C Payment Group.)&lt;br/&gt;&lt;br/&gt;I am looking forward to see your progress with integrating Lightning to the&lt;br/&gt;semantic web!&lt;br/&gt;&lt;br/&gt;with kind regards Rene&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;On Mon, Jan 21, 2019 at 7:17 AM Melvin Carvalho &amp;lt;melvincarvalho at gmail.com&amp;gt;&lt;br/&gt;wrote:&lt;br/&gt;&lt;br/&gt;&amp;gt; Hi All&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; I work on the solid project [1] and am very interested in the lightning&lt;br/&gt;&amp;gt; network.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; In particular, I am looking at trying to create an integration between&lt;br/&gt;&amp;gt; lightning (layer 2) and solid (layer 3?  web layer?).&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; The first step towards integration would be to port some of the lightning&lt;br/&gt;&amp;gt; concepts to the semantic web.  This is done by creating an ontology.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Does anyone know of any existing work in this area.  Alternatively, does&lt;br/&gt;&amp;gt; anyone have an interest to collaborate on an ontology?&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Best&lt;br/&gt;&amp;gt; Melvin&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; [1] &lt;a href=&#34;https://solid.mit.edu/&#34;&gt;https://solid.mit.edu/&lt;/a&gt;&lt;br/&gt;&amp;gt; _______________________________________________&lt;br/&gt;&amp;gt; Lightning-dev mailing list&lt;br/&gt;&amp;gt; Lightning-dev at lists.linuxfoundation.org&lt;br/&gt;&amp;gt; &lt;a href=&#34;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&#34;&gt;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&lt;/a&gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;-- &lt;br/&gt;&lt;a href=&#34;https://www.rene-pickhardt.de&#34;&gt;https://www.rene-pickhardt.de&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;Skype: rene.pickhardt&lt;br/&gt;&lt;br/&gt;mobile: &#43;49 (0)176 5762 3618&lt;br/&gt;-------------- next part --------------&lt;br/&gt;An HTML attachment was scrubbed...&lt;br/&gt;URL: &amp;lt;&lt;a href=&#34;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20190121/bc0c5b29/attachment.html&amp;gt&#34;&gt;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20190121/bc0c5b29/attachment.html&amp;gt&lt;/a&gt;;
    </content>
    <updated>2023-06-09T14:54:04&#43;02:00</updated>
  </entry>

  <entry>
    <id>https://nostr.ae/nevent1qqsgd07k5rt5avjuet553y60u8sceuxu5alu4uy553nu5yhw58e88rqzyqtuekymu22uptn978xnws9fmtvyaj9k6uzswy487p9w22zt974ejltrj4s</id>
    
      <title type="html">📅 Original date posted:2018-11-20 📝 Original message: Hey ...</title>
    
    <link rel="alternate" href="https://nostr.ae/nevent1qqsgd07k5rt5avjuet553y60u8sceuxu5alu4uy553nu5yhw58e88rqzyqtuekymu22uptn978xnws9fmtvyaj9k6uzswy487p9w22zt974ejltrj4s" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqsztunnm7mwfkr0jyjm5qk2kwlsnn4q9suhnaeg4q75efnqp75jwzqg4a0rf&#39;&gt;nevent1q…a0rf&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2018-11-20&lt;br/&gt;📝 Original message:&lt;br/&gt;Hey List,&lt;br/&gt;&lt;br/&gt;as this base AMP proposal seems pretty small I just started to write this&lt;br/&gt;up to make a PR for BOLT04 and BOLT11. While doing my write up I realize&lt;br/&gt;that there are smaller things that I would want to verify / double check&lt;br/&gt;and propose with you.&lt;br/&gt;&lt;br/&gt;## Verifying:&lt;br/&gt;1.) I understand the receiving node signals support for Base AMP by setting&lt;br/&gt;a feature bit in the BOLT11 String&lt;br/&gt;2.) The sending node signals a multipath payment by setting a feature bit&lt;br/&gt;and by using the same `amount to forward` value in the last hop of the&lt;br/&gt;onion for all paths which will also be bigger that the incoming htlcs whose&lt;br/&gt;sum has to be at least the size of `amount_to_forward`.&lt;br/&gt;&lt;br/&gt;## Clarifying:&lt;br/&gt;3.) Senders MUST NOT (SHOULD NOT?) create paths which would have to be&lt;br/&gt;merged by intermediary nodes (as we don&amp;#39;t know - and have no means of&lt;br/&gt;querying - if they support the format of the adepted onion packages for&lt;br/&gt;partial paths. Also it even seems impossible since the rest of the path for&lt;br/&gt;at least one partial path could not be stored in the onion / forwarded&lt;br/&gt;onions can&amp;#39;t be seen)&lt;br/&gt;&lt;br/&gt;## Proposing:&lt;br/&gt;Should we specify an algorithm for executing a multipath payment for the&lt;br/&gt;sending node or should this be left to the implementation. An obvious Idea&lt;br/&gt;for an algorithm would be a divide and conquer scheme which should be&lt;br/&gt;obvious with the following python style pseudo code:&lt;br/&gt;&lt;br/&gt;def pay_base_amp(amount):&lt;br/&gt;   success = False&lt;br/&gt;   for route in get_available_routes():&lt;br/&gt;       success = send_via_route(route, amount)&lt;br/&gt;    if not success:&lt;br/&gt;       pay_base_amp(amount/2 &#43; 1) # the &#43;1 is to mitigate rounding errors.&lt;br/&gt;there could be other ways to do so.&lt;br/&gt;       pay_base_amp(amount/2 &#43; 1)&lt;br/&gt;&lt;br/&gt;Even if we leave the exact AMP execution to the sender we could still&lt;br/&gt;suggest this divide and conquer scheme in BOLT 04&lt;br/&gt;&lt;br/&gt;Another idea I had (which is probably a bad one as it allows for probing of&lt;br/&gt;channel balances) would be to allow nodes on a partial path to send back&lt;br/&gt;some hints of how much additional capacity they can forward if they see&lt;br/&gt;that the partial payment feature bit is set (this would require to set this&lt;br/&gt;feature bit in every onion) Also if we want to make use of this information&lt;br/&gt;every node would have to support base amp. So I guess this idea is bad for&lt;br/&gt;several reasons. Still we could have a MAY rule out of it?&lt;br/&gt;&lt;br/&gt;best Rene&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;On Fri, Nov 16, 2018 at 4:45 PM Anthony Towns &amp;lt;aj at erisian.com.au&amp;gt; wrote:&lt;br/&gt;&lt;br/&gt;&amp;gt; On Thu, Nov 15, 2018 at 11:54:22PM &#43;0000, ZmnSCPxj via Lightning-dev wrote:&lt;br/&gt;&amp;gt; &amp;gt; The improvement is in a reduction in `fee_base_msat` in the C-&amp;gt;D path.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; I think reliability (and simplicity!) are the biggest things to improve&lt;br/&gt;&amp;gt; in lightning atm. Having the flag just be incuded in invoices and not&lt;br/&gt;&amp;gt; need to be gossiped seems simpler to me; and I think endpoint-only&lt;br/&gt;&amp;gt; merging is better for reliability too. Eg, if you find candidate routes:&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;   A -&amp;gt; B -&amp;gt; M -- actual directed capacity $6&lt;br/&gt;&amp;gt;   A -&amp;gt; C -&amp;gt; M -- actual directed capacity $5.50&lt;br/&gt;&amp;gt;   M -&amp;gt; E -&amp;gt; F -- actual directed capacity $6&lt;br/&gt;&amp;gt;   A -&amp;gt; X -&amp;gt; F -- actual directed capacity $7&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; and want to send $9 form A to F, you might start by trying to send&lt;br/&gt;&amp;gt; $5 via B and $4 via C.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; With endpoint-only merging you&amp;#39;d do:&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;    $5 via A,B,M,E,F -- partial success&lt;br/&gt;&amp;gt;    $4 via A,C,M,E -- failure&lt;br/&gt;&amp;gt;    $4 via A,X,F -- payment completion&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; whereas with in-route merging, you&amp;#39;d do:&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;    $5 via A,B,M -- held&lt;br/&gt;&amp;gt;    $4 via A,C,M -- to be continued&lt;br/&gt;&amp;gt;    $9 via M,E -- both partial payments fail&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; which seems a fair bit harder to incrementally recover from.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; Granted, current `fee_base_msat` across the network is very low&lt;br/&gt;&amp;gt; currently.&lt;br/&gt;&amp;gt; &amp;gt; So I do not object to restricting merge points to ultimate payees.&lt;br/&gt;&amp;gt; &amp;gt; If fees rise later, we can revisit this.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; So, while we already agree on the approach to take, I think the above&lt;br/&gt;&amp;gt; provides an additional rationale :)&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Cheers,&lt;br/&gt;&amp;gt; aj&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; _______________________________________________&lt;br/&gt;&amp;gt; Lightning-dev mailing list&lt;br/&gt;&amp;gt; Lightning-dev at lists.linuxfoundation.org&lt;br/&gt;&amp;gt; &lt;a href=&#34;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&#34;&gt;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&lt;/a&gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;-- &lt;br/&gt;&lt;a href=&#34;https://www.rene-pickhardt.de&#34;&gt;https://www.rene-pickhardt.de&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;Skype: rene.pickhardt&lt;br/&gt;&lt;br/&gt;mobile: &#43;49 (0)176 5762 3618&lt;br/&gt;-------------- next part --------------&lt;br/&gt;An HTML attachment was scrubbed...&lt;br/&gt;URL: &amp;lt;&lt;a href=&#34;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20181120/af408cd6/attachment.html&amp;gt&#34;&gt;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20181120/af408cd6/attachment.html&amp;gt&lt;/a&gt;;
    </content>
    <updated>2023-06-09T14:52:44&#43;02:00</updated>
  </entry>

  <entry>
    <id>https://nostr.ae/nevent1qqsfun6lsj20d57xn58yjamxd3vjr2pkdsrst2mgwkas6m7j3fxp3pczyqtuekymu22uptn978xnws9fmtvyaj9k6uzswy487p9w22zt974ejdjppts</id>
    
      <title type="html">📅 Original date posted:2018-10-10 📝 Original message: Dear ...</title>
    
    <link rel="alternate" href="https://nostr.ae/nevent1qqsfun6lsj20d57xn58yjamxd3vjr2pkdsrst2mgwkas6m7j3fxp3pczyqtuekymu22uptn978xnws9fmtvyaj9k6uzswy487p9w22zt974ejdjppts" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqs0cggwnr6wqqzzpd9nfvdrpc3mdmttjtghmsxxnmlsa8ey9f9nd9sxcgzyg&#39;&gt;nevent1q…gzyg&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2018-10-10&lt;br/&gt;📝 Original message:&lt;br/&gt;Dear Rusty,&lt;br/&gt;&lt;br/&gt;thanks for the initiative. You suggested in your paragraph &amp;#34;messages&lt;br/&gt;changes during splicing&amp;#34; during splicing to duplicate each commitment&lt;br/&gt;transaction. One which spends the old funding tx and one which spends the&lt;br/&gt;spliced tx. I believe this can be simplified. Though I think my workflow&lt;br/&gt;pretty much resembles what you have written in &amp;#34;Splice Signing&amp;#34; from point&lt;br/&gt;1. to 6. Maybe I might have misunderstood some parts of your suggestion.&lt;br/&gt;&lt;br/&gt;I will not write this down as formal as your proposal as I believe we are&lt;br/&gt;currently in the feedback and discussion phase. Maybe you already had&lt;br/&gt;&amp;#34;those details&amp;#34; that I am suggesting in mind. In that case sorry for my&lt;br/&gt;mail.&lt;br/&gt;&lt;br/&gt;So let us take the example of Splicing in:&lt;br/&gt;* The situation before splicing is that we have one output in our funding&lt;br/&gt;tx that is being spent with each commitment tx. (actually if the channel&lt;br/&gt;was spliced before we have more inputs but that should not change anything)&lt;br/&gt;* Splice in would create one additional output that can be spent in future&lt;br/&gt;commitment tx.&lt;br/&gt;* I propose while splicing in this output should be spent by a special&lt;br/&gt;commitment tx which goes to the funder of the splicing operation. This&lt;br/&gt;should happen before the actual funding takes place. The other commitment&lt;br/&gt;tx spending the original output continues to operate (assuring non blocking&lt;br/&gt;splice in operation).&lt;br/&gt;* Once we have enough confirmations we merge the channels (either&lt;br/&gt;automatically or with the next channel update). A new commitment tx is&lt;br/&gt;being created which now spends each output of each of the two funding tx&lt;br/&gt;and assigns the channel balance to the channel partners accordingly to the&lt;br/&gt;two independent channels. The old commitment txs are being invalidated.&lt;br/&gt;* The disadvantage is that while splicing is not completed and if the&lt;br/&gt;funder of the splicing tx is trying to publish an old commitment tx the&lt;br/&gt;node will only be punished by sending all the funds of the first funding tx&lt;br/&gt;to the partner as the special commitment tx of the 2nd output has no newer&lt;br/&gt;state yet.&lt;br/&gt;&lt;br/&gt;I believe splicing out is even safer:&lt;br/&gt;* One just creates a spent of the funding tx which has two outputs. One&lt;br/&gt;output goes to the recipient of the splice out operation and the second&lt;br/&gt;output acts as a new funding transaction for the newly spliced channel.&lt;br/&gt;Once signatures for the new commitment transaction are exchanged (basically&lt;br/&gt;following the protocol to open a channel) the splicing operation can be&lt;br/&gt;broadcasted.&lt;br/&gt;* The old channel MUST NOT be used anymore but the new channel can be&lt;br/&gt;operational right away without blockchain confirmation. In case someone&lt;br/&gt;tries to publish an old state of the old channel it will be a double spent&lt;br/&gt;of the splicing operation and in the worst case will be punished and the&lt;br/&gt;splicing was not successful. if one publishes an old state of the new&lt;br/&gt;channel everything will just work as normal even if the funding tx is not&lt;br/&gt;yet mined. It could only be replaced with an old state of the previous&lt;br/&gt;channel (which as we saw is not a larger risk than the usual operation of a&lt;br/&gt;lightning node)&lt;br/&gt;&lt;br/&gt;As mentioned maybe you had this workflow already in your mind but I don&amp;#39;t&lt;br/&gt;see why we need to send around all the messages twice with my workflow. We&lt;br/&gt;only need to maintain double state but only until it is fair / safe to do&lt;br/&gt;so. I would also believe that with my approach it should be possible (but&lt;br/&gt;not really necessary) to have multiple splicing operations in parallel.&lt;br/&gt;&lt;br/&gt;One other question: What happens to the short_channel_id of a channel to&lt;br/&gt;which founds have been spliced in?&lt;br/&gt;&lt;br/&gt;best Rene&lt;br/&gt;&lt;br/&gt;On Wed, Oct 10, 2018 at 5:46 AM Rusty Russell &amp;lt;rusty at rustcorp.com.au&amp;gt; wrote:&lt;br/&gt;&lt;br/&gt;&amp;gt; Hi all!&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;         We&amp;#39;ve had increasing numbers of c-lightning users get upset they&lt;br/&gt;&amp;gt; can&amp;#39;t open multiple channels, so I guess we&amp;#39;re most motivated to allow&lt;br/&gt;&amp;gt; splicing of existing channels.  Hence this rough proposal.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; For simplicity, I&amp;#39;ve chosen to only allow a single splice at a time.&lt;br/&gt;&amp;gt; It&amp;#39;s still complex :(&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Feedback welcome!&lt;br/&gt;&amp;gt; --&lt;br/&gt;&amp;gt; Splice Negotiation:&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; 1. type: 40 (`splice_add_input`) (`option_splice`)&lt;br/&gt;&amp;gt; 2. data:&lt;br/&gt;&amp;gt;    * [`32`:`channel_id`]&lt;br/&gt;&amp;gt;    * [`8`: `satoshis`]&lt;br/&gt;&amp;gt;    * [`32`: `prevtxid`]&lt;br/&gt;&amp;gt;    * [`4`: `prevtxoutnum`]&lt;br/&gt;&amp;gt;    * [`2`: `scriptlen`]&lt;br/&gt;&amp;gt;    * [`scriptlen`: `scriptpubkey`]&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; 1. type: 41 (`splice_add_output`) (`option_splice`)&lt;br/&gt;&amp;gt; 2. data:&lt;br/&gt;&amp;gt;    * [`32`:`channel_id`]&lt;br/&gt;&amp;gt;    * [`8`: `satoshis`]&lt;br/&gt;&amp;gt;    * [`2`: `scriptlen`]&lt;br/&gt;&amp;gt;    * [`scriptlen`: `outscript`]&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; 1. type: 42 (`splice_all_added`) (`option_splice`)&lt;br/&gt;&amp;gt; 2. data:&lt;br/&gt;&amp;gt;    * [`32`:`channel_id`]&lt;br/&gt;&amp;gt;    * [`4`:`feerate_per_kw`]&lt;br/&gt;&amp;gt;    * [`4`:`minimum_depth`]&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Each side sends 0 or more `splice_add_input` and 0 or more&lt;br/&gt;&amp;gt; `splice_add_output` followed by `spice_all_added` to complete the splice&lt;br/&gt;&amp;gt; proposal.  This is done either to initiate a splice, or to respond to a&lt;br/&gt;&amp;gt; `splice_*` from the other party.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; `splice_add_input` is checked for the following:&lt;br/&gt;&amp;gt; - must not be during a current splice&lt;br/&gt;&amp;gt; - scriptpubkey is empty, or of form &amp;#39;HASH160 &amp;lt;20-byte-script-hash&amp;gt; EQUAL&amp;#39;&lt;br/&gt;&amp;gt; - `satoshis` doesn&amp;#39;t wrap on addition.&lt;br/&gt;&amp;gt; - MAY check that it matches outpoint specified (sig will simply be&lt;br/&gt;&amp;gt;   invalid if so), and that outpoint is segwit.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; `splice_add_output` is checked for the following:&lt;br/&gt;&amp;gt; - must not be during a current splice&lt;br/&gt;&amp;gt; - `satoshis` is less than or equal to amount owing to proposer, minus&lt;br/&gt;&amp;gt;   current reserve, and greater than or equal to `dust_limit_satoshis` we&lt;br/&gt;&amp;gt;   sent in our open_channel/accept_channel ,sg.&lt;br/&gt;&amp;gt; - script is one of the approved forms as it is for `shutdown`.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; FIXME: Do we disallow splice-out if they specified&lt;br/&gt;&amp;gt;        option_upfront_shutdown_script?&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; `splice_all_added` is checked for the following:&lt;br/&gt;&amp;gt; - average of `feerate_per_kw` by both sides (round down) is sufficient.&lt;br/&gt;&amp;gt; - average of `feerate_per_kw` by both sides not grossly excessive, if we&amp;#39;re&lt;br/&gt;&amp;gt;   paying some of the fees (see below!)&lt;br/&gt;&amp;gt; - both sides can afford the fees from their post-splice funds (see&lt;br/&gt;&amp;gt;   Verification Changes below)&lt;br/&gt;&amp;gt; - maximum of the two `minimum_depth` is not grossly excessive.&lt;br/&gt;&amp;gt; - There is at least one splice_add_input or splice_add_output.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Splice negotiation, like closing negotiation, does not have persistent&lt;br/&gt;&amp;gt; state.  Reconnecting forgets previous negotiation.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Splice Signing&lt;br/&gt;&amp;gt; --------------&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Once `splice_all_added` is both sent and received, we need to create and&lt;br/&gt;&amp;gt; sign both the splice tx itself, and the first commitment transaction&lt;br/&gt;&amp;gt; which spends it (but not in that order!).&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; 1. One input spends the current funding tx output.&lt;br/&gt;&amp;gt; 2. There is one additional input for each splice_add_input.&lt;br/&gt;&amp;gt; 3. One output creates the new funding tx.&lt;br/&gt;&amp;gt; 4. There is one additional output for each splice_add_output.&lt;br/&gt;&amp;gt; 5. The entire transaction is sorted into BIP69 order.&lt;br/&gt;&amp;gt; 6. The feerate is the sum of the two `feerate_per_kw` divided by 2,&lt;br/&gt;&amp;gt;    rounded down.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; 1. type: 43 (`splice_commitment_signature`) (`option_splice`)&lt;br/&gt;&amp;gt; 2. data:&lt;br/&gt;&amp;gt;    * [`32`:`channel_id`]&lt;br/&gt;&amp;gt;    * [`64`:`commitment_signature`]&lt;br/&gt;&amp;gt;    * [`2`:`num_htlcs`]&lt;br/&gt;&amp;gt;    * [`num_htlcs*64`:`htlc_signature`]&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; 1. type: 44 (`splice_signature`) (`option_splice`)&lt;br/&gt;&amp;gt; 2. data:&lt;br/&gt;&amp;gt;    * [`32`:`channel_id`]&lt;br/&gt;&amp;gt;    * [`64`:`splice_signature`]&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; 1. type: 45 (`splice_witness`) (`option_splice`)&lt;br/&gt;&amp;gt; 2. data:&lt;br/&gt;&amp;gt;    * [`32`:`channel_id`]&lt;br/&gt;&amp;gt;    * [`2`: `num_witness_elements`&lt;br/&gt;&amp;gt;    * [`2`:`len`]&lt;br/&gt;&amp;gt;    * [`len`:`witnesses`]&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; `witnesses` itself is serialized as `num_witness_elements` of:&lt;br/&gt;&amp;gt; * `2`:`len`&lt;br/&gt;&amp;gt; * `len`: `witness_element`&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Each side sends `splice_commitment_signature` and waits to receive and&lt;br/&gt;&amp;gt; verify the other side&amp;#39;s `splice_commitment_signature` before sending&lt;br/&gt;&amp;gt; `splice_signature` and `splice_witness` for each `splice_add_input` it&lt;br/&gt;&amp;gt; proposed, in BIP69 input order.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Once a node has sent `splice_commitment_signature` it should remember&lt;br/&gt;&amp;gt; the splice proposal across reconnects.  Once it has both sent&lt;br/&gt;&amp;gt; `splice_signature`, the splice is locked in.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Splice Announcement&lt;br/&gt;&amp;gt; -------------------&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; We have to tell the network about the new channel, otherwise there will&lt;br/&gt;&amp;gt; be a distruption when it sees the old funding transaction spent.  This&lt;br/&gt;&amp;gt; is inevitable for older nodes who won&amp;#39;t understand splicing anyway.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; We can&amp;#39;t send out a `channel_announcement` or `channel_update` for the&lt;br/&gt;&amp;gt; new channel until after the new funding transaction has 6 confirmations,&lt;br/&gt;&amp;gt; so we append to the existing `channel_update` for the original channel,&lt;br/&gt;&amp;gt; using a new `message_flags` field:&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; | Bit Position  | Name                      | Field&lt;br/&gt;&amp;gt;     |&lt;br/&gt;&amp;gt; | ------------- | ------------------------- |&lt;br/&gt;&amp;gt; -------------------------------- |&lt;br/&gt;&amp;gt; | 0             | `option_channel_htlc_max` | `htlc_maximum_msat`&lt;br/&gt;&amp;gt;     |&lt;br/&gt;&amp;gt; | 1             | `option_channel_moving`   | `moving_txid&lt;br/&gt;&amp;gt;      |&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; The `channel_update` gains the following field:&lt;br/&gt;&amp;gt;     * [`32`: moving_txid`] (option_channel_moving)&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; If a current `channel_update` for a closing channel contains&lt;br/&gt;&amp;gt; `option_channel_moving` a node SHOULD ignore the channel close for at&lt;br/&gt;&amp;gt; least 100 blocks iff spent by `moving_txid`.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; A node SHOULD immediately forward a `channel_update` it sees containing&lt;br/&gt;&amp;gt; `option_channel_moving` if neither previous `channel_update` for the&lt;br/&gt;&amp;gt; channel contains `option_channel_moving`.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Each side of the splice can send these unilaterally, and SHOULD allow a&lt;br/&gt;&amp;gt; few minutes for propagation (remember, average propagation from old&lt;br/&gt;&amp;gt; nodes is still 30 seconds) prior to broadcast of the splice transaction.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Message Changes During Splicing&lt;br/&gt;&amp;gt; -------------------------------&lt;br/&gt;&amp;gt; Once you&amp;#39;ve sent `splice_commitment_signature` each commitment&lt;br/&gt;&amp;gt; transaction is duplicated: one spends the old funding transaction, one&lt;br/&gt;&amp;gt; spends the splice transaction:&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; 1. type: 39 (`closing_signed`)&lt;br/&gt;&amp;gt; 2. data:&lt;br/&gt;&amp;gt;    * [`32`:`channel_id`]&lt;br/&gt;&amp;gt;    * [`8`:`fee_satoshis`]&lt;br/&gt;&amp;gt;    * [`64`:`signature`]&lt;br/&gt;&amp;gt;    * [`64`:`splice_signature`] (`option_splice`)&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; 1. type: 132 (`commitment_signed`)&lt;br/&gt;&amp;gt; 2. data:&lt;br/&gt;&amp;gt;    * [`32`:`channel_id`]&lt;br/&gt;&amp;gt;    * [`64`:`signature`]&lt;br/&gt;&amp;gt;    * [`2`:`num_htlcs`]&lt;br/&gt;&amp;gt;    * [`num_htlcs*64`:`htlc_signature`]&lt;br/&gt;&amp;gt;    * [`num_htlcs*64`:`htlc_splice_signature`] (`option_splice`)&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; If a reconnection occurs between between sending and receiving&lt;br/&gt;&amp;gt; `splice_commitment_signature`) the peer&amp;#39;s status is uncertain (similarly&lt;br/&gt;&amp;gt; for closing).  This we have a new field in `channel_reestablish` to flag&lt;br/&gt;&amp;gt; that we consider ourselves to be splicing:&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; 1. type: 136 (`channel_reestablish`)&lt;br/&gt;&amp;gt; 2. data:&lt;br/&gt;&amp;gt;    * [`32`:`channel_id`]&lt;br/&gt;&amp;gt;    * [`8`:`next_local_commitment_number`]&lt;br/&gt;&amp;gt;    * [`8`:`next_remote_revocation_number`]&lt;br/&gt;&amp;gt;    * [`32`:`your_last_per_commitment_secret`] (`option_data_loss_protect`)&lt;br/&gt;&amp;gt;    * [`33`:`my_current_per_commitment_point`] (`option_data_loss_protect`)&lt;br/&gt;&amp;gt;    * [`32`:`splice_txid`] (`option_splice`)&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; The splice_txid field indicates that this side considers itself to be&lt;br/&gt;&amp;gt; splicing.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; The sender:&lt;br/&gt;&amp;gt; - if it has sent `splice_commitment_signature` and not sent the&lt;br/&gt;&amp;gt; corresponding&lt;br/&gt;&amp;gt;   `splice_closed`, MUST set `splice_txid` to the txid of the splice tx.&lt;br/&gt;&amp;gt;    - Otherwise MUST NOT.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; The recipient:&lt;br/&gt;&amp;gt; - if it has sent `splice_commitment_signature` and not sent the&lt;br/&gt;&amp;gt; corresponding&lt;br/&gt;&amp;gt;   `splice_closed`:&lt;br/&gt;&amp;gt;   - if `splice_txid` does not exist or does not match the current splice:&lt;br/&gt;&amp;gt;     - SHOULD fail the channel&lt;br/&gt;&amp;gt;   - otherwise:&lt;br/&gt;&amp;gt;     - MUST retransmit `splice_signature`&lt;br/&gt;&amp;gt; - otherwise:&lt;br/&gt;&amp;gt;   - if `splice_txid` field exists and is not all zeroes:&lt;br/&gt;&amp;gt;     - MUST send `splice_closed`&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Validation Changes During Splicing&lt;br/&gt;&amp;gt; ----------------------------------&lt;br/&gt;&amp;gt; We track &amp;#34;post-splice&amp;#34; values as well as current values during&lt;br/&gt;&amp;gt; splicing.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; The post-splice reserve is 1% of post-splice capcacity (rounded down).&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; The fees for the splicing transaction itself are divided into parts by&lt;br/&gt;&amp;gt; the number of `splice_add_input` plus `splice_add_output`, rounded up.&lt;br/&gt;&amp;gt; Each side pays as many parts as it proposed `splice_add_input` plus&lt;br/&gt;&amp;gt; `splice_add_output`.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; (So if Alice proposes two and Bob proposes one, and the total fee is 1000&lt;br/&gt;&amp;gt; satoshi, each part is 334 satoshi: Alice pays 668 and Bob pays 334.)&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Each side&amp;#39;s post-splice funds are debited their `splice_add_output`&lt;br/&gt;&amp;gt; amounts, and credited their `splice_add_input` amounts, a debited the&lt;br/&gt;&amp;gt; splice tx fees.  If any debiting occurs, the funds must be above the&lt;br/&gt;&amp;gt; post-splice reserve (ie. you can have below reserve, but you can&amp;#39;t spend&lt;br/&gt;&amp;gt; if you&amp;#39;re below reserve).&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; All update_add_htlc must be valid for the *both* the current and&lt;br/&gt;&amp;gt; post-splice balances.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Completing Splicing&lt;br/&gt;&amp;gt; -------------------&lt;br/&gt;&amp;gt; Once you&amp;#39;ve seen both side&amp;#39;s `minimum_depth` confirmations of the splice&lt;br/&gt;&amp;gt; transaction (ie. the maximum of the two `minimum_depth` values), you can&lt;br/&gt;&amp;gt; complete the splice by sending:&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; 1. type: 46 (`splice_closed`) (`option_splice`)&lt;br/&gt;&amp;gt; 2. data:&lt;br/&gt;&amp;gt;    * [`32`:`channel_id`]&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Once you&amp;#39;ve sent and received `splice_closed` you can send&lt;br/&gt;&amp;gt; `announcement_signatures` for the new channel as per normal rules (ie. 6&lt;br/&gt;&amp;gt; confirmations, `announce_channel` bit set).&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; In addition, you can forget everything about the old channel (including&lt;br/&gt;&amp;gt; old HTLCs and revocation requirements).&lt;br/&gt;&amp;gt; _______________________________________________&lt;br/&gt;&amp;gt; Lightning-dev mailing list&lt;br/&gt;&amp;gt; Lightning-dev at lists.linuxfoundation.org&lt;br/&gt;&amp;gt; &lt;a href=&#34;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&#34;&gt;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&lt;/a&gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;-- &lt;br/&gt;&lt;a href=&#34;https://www.rene-pickhardt.de&#34;&gt;https://www.rene-pickhardt.de&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;Skype: rene.pickhardt&lt;br/&gt;&lt;br/&gt;mobile: &#43;49 (0)176 5762 3618&lt;br/&gt;-------------- next part --------------&lt;br/&gt;An HTML attachment was scrubbed...&lt;br/&gt;URL: &amp;lt;&lt;a href=&#34;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20181011/d0a500b9/attachment-0001.html&amp;gt&#34;&gt;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20181011/d0a500b9/attachment-0001.html&amp;gt&lt;/a&gt;;
    </content>
    <updated>2023-06-09T14:51:36&#43;02:00</updated>
  </entry>

  <entry>
    <id>https://nostr.ae/nevent1qqsrntgwhxmxuy6g2jwye7c7tl8lzrm3lv2ap7chza3vx78ymurluxczyqtuekymu22uptn978xnws9fmtvyaj9k6uzswy487p9w22zt974ejswshx9</id>
    
      <title type="html">📅 Original date posted:2018-03-13 📝 Original message: Hey ...</title>
    
    <link rel="alternate" href="https://nostr.ae/nevent1qqsrntgwhxmxuy6g2jwye7c7tl8lzrm3lv2ap7chza3vx78ymurluxczyqtuekymu22uptn978xnws9fmtvyaj9k6uzswy487p9w22zt974ejswshx9" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqsqw628qh4ujx868usgy8596az2u2e2lvjn6nnmyerlkzcxxpfjrwsqj9kd3&#39;&gt;nevent1q…9kd3&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2018-03-13&lt;br/&gt;📝 Original message:&lt;br/&gt;Hey everyone,&lt;br/&gt;&lt;br/&gt;disclaimer: as mentioned in my other mail (&lt;br/&gt;&lt;a href=&#34;https://lists.linuxfoundation.org/pipermail/lightning-dev/2018-March/001065.html&#34;&gt;https://lists.linuxfoundation.org/pipermail/lightning-dev/2018-March/001065.html&lt;/a&gt;&lt;br/&gt;) I am currently studying the revocation system of duplex micropayment&lt;br/&gt;channels in detail but I am also pretty new to the topic. So I hope the&lt;br/&gt;attack I am about to describe is not possible and it is just me overseeing&lt;br/&gt;some detail or rather my lack of understanding.&lt;br/&gt;That being said even after waiting one week upon discovery and double&lt;br/&gt;checking the assumptions I made I am still positive that the revocation&lt;br/&gt;system in its current form allows for a new form of a 51% attack. This&lt;br/&gt;attack seems to be way more harmful than a successful 51% attack on the&lt;br/&gt;bitcoin network. Afaik within the bitcoin network I could &amp;#39;only double&lt;br/&gt;spend&amp;#39; my own funds with a successful 51% attack. In the lightning case it&lt;br/&gt;seems that an attacker could steal an arbitrary amount of funds as long as&lt;br/&gt;the attacker has enough payment channels with enough balance open.&lt;br/&gt;&lt;br/&gt;The attack itself follows exactly the philosophy of lightning: &amp;#34;If a tree&lt;br/&gt;falls in the forest and no one is around to hear it. Does it make a sound?&amp;#34;&lt;br/&gt;In the context of the attack this would translate to: &amp;#34;If a 51% attacker&lt;br/&gt;secretly mines enough blocks after fraudulently spending old commitment&lt;br/&gt;transactions and no one sees it during the the *to_self_delay*  period,&lt;br/&gt;have the commitment transactions been spent? (How) Can they be revoked?&amp;#34;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;As for the technical details I quote from the spec of BOLT 3:&lt;br/&gt;&amp;#34;*To allow an opportunity for penalty transactions, in case of a revoked&lt;br/&gt;commitment transaction, all outputs that return funds to the owner of the&lt;br/&gt;commitment transaction (a.k.a. the &amp;#34;local node&amp;#34;) must be delayed for *&lt;br/&gt;*to_self_delay** blocks. This delay is done in a second-stage HTLC&lt;br/&gt;transaction (HTLC-success for HTLCs accepted by the local node,&lt;br/&gt;HTLC-timeout for HTLCs offered by the local node)*&amp;#34;&lt;br/&gt;&lt;br/&gt;Assume an attacker has 51% of the hash power she could open several&lt;br/&gt;lightning channels and in particular accept any incoming payment channel&lt;br/&gt;(the more balance is in her channels the more lucrative the 51% attack).&lt;br/&gt;Since the attacker already has a lot of hash power it is reasonable (but&lt;br/&gt;not necessary) to assume that the attacker already has a lot of bitcoins&lt;br/&gt;and is well known to honest nodes in the network which makes it even more&lt;br/&gt;likely to have many open channels.&lt;br/&gt;&lt;br/&gt;The attacker keeps track of her (revocable) commitment transactions in&lt;br/&gt;which the balance is mostly on the attackers side. Once the attacker knows&lt;br/&gt;enough of these (old) commitment transactions the attack is being executed&lt;br/&gt;in the following way:&lt;br/&gt;0.) The max value of to_self_delay is evaluated. Let us assume it is 72&lt;br/&gt;blocks (or half a day).&lt;br/&gt;1.) The attacker secretly starts mining on her own but does not broadcasts&lt;br/&gt;any successfully mined block. Since the attacker has 51% of the hash power&lt;br/&gt;she will most likely be faster than the network to mine the 72 blocks of&lt;br/&gt;the safety period in which fraudulent commitment transactions could be&lt;br/&gt;revoked.&lt;br/&gt;2.) The attacker spends all the fraudulent (old) commitment transactions in&lt;br/&gt;the first block of her secrete mining endeavor.&lt;br/&gt;3.) Meanwhile the attacker starts spending her own funds of her payment&lt;br/&gt;channels e.g on decentralized exchanges for any other (crypto)currency.&lt;br/&gt;4.) As soon as the attacker has mined enough blocks that the commitment&lt;br/&gt;transactions cannot be revoked she broadcasts her secretly minded&lt;br/&gt;blockchain which will be accepted by the network as it is the longest&lt;br/&gt;chain. (In Particular she includes all the other bitcoin transactions that&lt;br/&gt;are also in the original public blockchain so that other people don&amp;#39;t even&lt;br/&gt;realize something suspicious has happened.)&lt;br/&gt;&lt;br/&gt;Since according to the spec channels should never be balanced worse than&lt;br/&gt;99% to 1% the attacker could steal up to 99% of all the bitcoins allocated&lt;br/&gt;in the sum of all payment channels the attacker was connected to. This&lt;br/&gt;amount could obviously be way higher than just double spending her own&lt;br/&gt;funds. This attack would be interesting in particular for the power nodes&lt;br/&gt;created by the Barabasi-Albert model of lnd&amp;#39;s autopilot (c.f.:&lt;br/&gt;&lt;a href=&#34;https://github.com/lightningnetwork/lnd/issues/677&#34;&gt;https://github.com/lightningnetwork/lnd/issues/677&lt;/a&gt; ).&lt;br/&gt;&lt;br/&gt;I understand that with the growth of the bitcoin (mining) network a 51%&lt;br/&gt;attack becomes less and less likely. Also I am very happy to be proven&lt;br/&gt;false about the attack that I am describing.&lt;br/&gt;&lt;br/&gt;Another sad thing about this attack is that I currently do not see any&lt;br/&gt;(reasonable) way of preventing this form of a 51% attack (other than&lt;br/&gt;creating payment channels that don&amp;#39;t offer the possibility of revocation)&lt;br/&gt;as it is abusing exactly the core idea of lightning to do something in&lt;br/&gt;secret without broadcasting it.&lt;br/&gt;&lt;br/&gt;Best regards Rene&lt;br/&gt;&lt;br/&gt;---&lt;br/&gt;&lt;br/&gt;&lt;a href=&#34;http://www.rene-pickhardt.de&#34;&gt;http://www.rene-pickhardt.de&lt;/a&gt;&lt;br/&gt;-------------- next part --------------&lt;br/&gt;An HTML attachment was scrubbed...&lt;br/&gt;URL: &amp;lt;&lt;a href=&#34;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20180313/bb92bcf7/attachment-0001.html&amp;gt&#34;&gt;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20180313/bb92bcf7/attachment-0001.html&amp;gt&lt;/a&gt;;
    </content>
    <updated>2023-06-09T14:49:29&#43;02:00</updated>
  </entry>

  <entry>
    <id>https://nostr.ae/nevent1qqsxm7pqelf46tkqsqur3wp85htgu3r48yp8wp5chchxs2nahy5llhczyqtuekymu22uptn978xnws9fmtvyaj9k6uzswy487p9w22zt974ejjlymv9</id>
    
      <title type="html">📅 Original date posted:2022-01-11 📝 Original message:jack ...</title>
    
    <link rel="alternate" href="https://nostr.ae/nevent1qqsxm7pqelf46tkqsqur3wp85htgu3r48yp8wp5chchxs2nahy5llhczyqtuekymu22uptn978xnws9fmtvyaj9k6uzswy487p9w22zt974ejjlymv9" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqsyqzd9vags8z3wku0adt00az0eme27xy6jsr7x02q54u5fa5k09cqlashc6&#39;&gt;nevent1q…shc6&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2022-01-11&lt;br/&gt;📝 Original message:jack via bitcoin-dev &amp;lt;bitcoin-dev at lists.linuxfoundation.org&amp;gt; schrieb am&lt;br/&gt;Mi., 12. Jan. 2022, 01:35:&lt;br/&gt;&lt;br/&gt;&amp;gt; To Bitcoin Developers:&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Open-source developers, who are often independent, are especially&lt;br/&gt;&amp;gt; susceptible to legal pressure.&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;Will the fund eventually also help to educate developers about the risks&lt;br/&gt;they are facing and which measures can be taken to reduce such risks so&lt;br/&gt;that legal pressure might not even arise in the first place?&lt;br/&gt;&lt;br/&gt;The main purpose of this Fund is to defend developers from lawsuits&lt;br/&gt;&amp;gt; regarding their activities in the Bitcoin ecosystem, including finding and&lt;br/&gt;&amp;gt; retaining defense counsel, developing litigation strategy, and paying legal&lt;br/&gt;&amp;gt; bills. This is a free and voluntary option for developers to take advantage&lt;br/&gt;&amp;gt; of if they so wish.&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;Thank you!&lt;br/&gt;-------------- next part --------------&lt;br/&gt;An HTML attachment was scrubbed...&lt;br/&gt;URL: &amp;lt;&lt;a href=&#34;http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20220112/f8dc7cf8/attachment.html&amp;gt&#34;&gt;http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20220112/f8dc7cf8/attachment.html&amp;gt&lt;/a&gt;;
    </content>
    <updated>2023-06-08T01:02:10&#43;02:00</updated>
  </entry>

  <entry>
    <id>https://nostr.ae/nevent1qqspjrgk267a5lj2mk5lsssd5sxyt7xhv8muaaxklxnx5uydk3r9lhczyqtuekymu22uptn978xnws9fmtvyaj9k6uzswy487p9w22zt974ejneyl8c</id>
    
      <title type="html">📅 Original date posted:2021-05-15 📝 Original message:Hey ...</title>
    
    <link rel="alternate" href="https://nostr.ae/nevent1qqspjrgk267a5lj2mk5lsssd5sxyt7xhv8muaaxklxnx5uydk3r9lhczyqtuekymu22uptn978xnws9fmtvyaj9k6uzswy487p9w22zt974ejneyl8c" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqs8cj2w97gal29y5fxgk3m9m0s5m4krqsjrzhldvg98p3kxcpvhe8ghw9fvr&#39;&gt;nevent1q…9fvr&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2021-05-15&lt;br/&gt;📝 Original message:Hey Michael,&lt;br/&gt;&lt;br/&gt;First I think the idea of &amp;#34;do nothing in the first 9 minutes&amp;#34; will&lt;br/&gt;unfortunately not be useful as the computed work is mainly there to prevent&lt;br/&gt;miners from altering the history of previous blocks. Thus following your&lt;br/&gt;suggesting would probably drastically decease the security of the network&lt;br/&gt;as less work protects previously mined blocks allowing for lower cost to&lt;br/&gt;compute a reorg.&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;Let us assume the aforementioned point could somehow be resolved there&lt;br/&gt;would be another practical issue. It is hard / impossible to sync clocks in&lt;br/&gt;a distributed network which I think would be necessary for a system that&lt;br/&gt;you propose. (actually Bitcoin is one way of introducing a temporal&lt;br/&gt;ordering of events in a distributed network)&lt;br/&gt;&lt;br/&gt;Finally even if that was also resolved: How would you prevent miners to&lt;br/&gt;already compute the simpler difficulty problem directly after the block was&lt;br/&gt;found and publish their solution directly after minute 9? We would always&lt;br/&gt;have many people with a finished / competing solution.&lt;br/&gt;&lt;br/&gt;So while I appreciate the idea I have the feeling it would be impractical&lt;br/&gt;but maybe I missed something.&lt;br/&gt;&lt;br/&gt;Best Rene&lt;br/&gt;&lt;br/&gt;Michael Fuhrmann via bitcoin-dev &amp;lt;bitcoin-dev at lists.linuxfoundation.org&amp;gt;&lt;br/&gt;schrieb am Sa., 15. Mai 2021, 23:57:&lt;br/&gt;&lt;br/&gt;&amp;gt; Hello,&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Bitcoin should create blocks every 10 minutes in average. So why do&lt;br/&gt;&amp;gt; miners need to mine the 9 minutes after the last block was found? It&amp;#39;s&lt;br/&gt;&amp;gt; not necessary.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Problem: How to prevent &amp;#34;pre-mining&amp;#34; in the 9 minutes time window?&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Possible ideas for discussion:&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; - (maybe most difficult) global network timer sending a salted hash time&lt;br/&gt;&amp;gt; code after 9 minutes. this enables validation by nodes.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; - (easy attempt) mining jobs before 9 minutes have a 10 (or 100 or just&lt;br/&gt;&amp;gt; high enough) times higher difficulty. so everyone can mine any time but&lt;br/&gt;&amp;gt; before to 9 minutes are up there will be a too high downside. It is more&lt;br/&gt;&amp;gt; efficient to wait then paying high bills. The bitcoin will get a &amp;#34;puls&amp;#34;.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; I dont think I see all problems behind these ideas but if there is a&lt;br/&gt;&amp;gt; working solution to do so then the energy fud will find it&amp;#39;s end. Saving&lt;br/&gt;&amp;gt; energy without loosing rosbustness.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; :)&lt;br/&gt;&amp;gt; _______________________________________________&lt;br/&gt;&amp;gt; bitcoin-dev mailing list&lt;br/&gt;&amp;gt; bitcoin-dev at lists.linuxfoundation.org&lt;br/&gt;&amp;gt; &lt;a href=&#34;https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev&#34;&gt;https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev&lt;/a&gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;-------------- next part --------------&lt;br/&gt;An HTML attachment was scrubbed...&lt;br/&gt;URL: &amp;lt;&lt;a href=&#34;http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20210516/eac0b836/attachment.html&amp;gt&#34;&gt;http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20210516/eac0b836/attachment.html&amp;gt&lt;/a&gt;;
    </content>
    <updated>2023-06-08T00:53:24&#43;02:00</updated>
  </entry>

</feed>