<oembed><type>rich</type><version>1.0</version><author_name>npub13fccestrh5xf26m53n73xn5yly9z040a4n9vq30mernkj0cqszuq9tgaqs</author_name><author_url>https://nostr.ae/npub13fccestrh5xf26m53n73xn5yly9z040a4n9vq30mernkj0cqszuq9tgaqs</author_url><provider_name>njump</provider_name><provider_url>https://nostr.ae</provider_url><html>📅 Original date posted:2022-03-14&#xA;📝 Original message:&#xA;Hi Rene,&#xA;&#xA;On Mon, Mar 14, 2022 at 12:56:24PM +0100, René Pickhardt via Lightning-dev wrote:&#xA;&gt; &gt; 1) What&#39;s the reasoning behind combining parallel channels?&#xA;&gt; I think that should work and especially when including fees to the&#xA;&gt; cost function and considering how nodes handle routing requests on&#xA;&gt; parallel channels we might have to do so anyway.&#xA;&#xA;I think lnd accepts the minimum fee of all parallel channels, even if&#xA;a higher fee rate is configured for the channel that is actually used.&#xA;I&#39;m not too sure about this, though. Having parallel channels with&#xA;different fee settings seems weird to me, anyway.&#xA;&#xA;&gt; 1.1) A payment of size 2 needs to be split into 1+1 to fit through&#xA;&gt; However I believe in practice one cannot just send a 2 satoshi onion and&#xA;&gt; expect the routing node to split the amount  correctly / accordingly&#xA;&gt; between the two parallel channels. (I might be wrong here).&#xA;&#xA;Exactly. This kind of split could be possible in theory, but at least&#xA;lnd doesn&#39;t do it. I guess there are lots of interesting questions to&#xA;answer before this becomes reality (channel jamming?).&#xA;&#xA;&gt; So in that case&#xA;&gt; modelling and computing probabilities for parallel channels might be&#xA;&gt; necessary anyway though the math indicates that splitting liquidity in&#xA;&gt; parallel channels will get you selected less frequently for routing.&#xA;&#xA;Which is OK, as in reality it IS less likely to succeed.&#xA;&#xA;&gt; 1.2) The Mission Control information provided by lnd [...]&#xA;&gt; I think you talk a about a maximum available balance of a channel (and not&#xA;&gt; min available balance)?&#xA;&#xA;Yes, although MC also has information about &#34;known&#34; amounts (due to&#xA;failures that only happened further down the road).&#xA;&#xA;&gt; In the case of parallel channels I am not even sure if such information is&#xA;&gt; accurate as it is my understanding that the routing node may decide to use&#xA;&gt; the parallel channel to forward the amount even though the other channel&#xA;&gt; was specified in the onion.&#xA;&#xA;The routing node is free to pick any of the parallel channels, yes. The&#xA;MC data only reasons about pairs of nodes, though, not individual&#xA;channels.&#xA;&#xA;&gt; Assuming that routing nodes indeed do so we would have learnt that neither&#xA;&gt; channel has an effective capacity of N. So the combined virtual channel&#xA;&gt; could be seen as 2N-1.&#xA;&#xA;You mean 2(N-1) = 2N-2?&#xA;&#xA;&gt; However if routing nodes don&#39;t locally split a&#xA;&gt; forwarding request across both channels we would know that calaculating&#xA;&gt; with 2N-1 is bad as a request of N could not be fulfilled.&#xA;&#xA;Exactly, also for 2N-2. Only N-1 would be a reasonable assumption.&#xA;&#xA;Based on your responses I&#39;ll treat parallel channels individually, and&#xA;see how it works out.&#xA;&#xA;&gt; &gt; 3) Size of Piecewise Linearization&#xA;&gt; The main difference here is that a channel of 1 BTC is highly preferable&#xA;&gt; from a probabilistic payment delivery perspective over a channel of 0.01&#xA;&gt; BTC. Even approximating the 1 BTC channel with 1000 intervalls of 0.001 BTC&#xA;&gt; should still have a lower unit cost in all pieces of the first 0.01 BTC of&#xA;&gt; the liquidity than the first piece of the 0.01 BTC channel. So I think&#xA;&gt; splitting all channels in the equal number of pieces is pretty well&#xA;&gt; motivated but let me elaborate on this:&#xA;&#xA;OK great, got it.&#xA;&#xA;&gt; &gt; 4) Leftovers after Piecewise Linearization&#xA;&gt; I am not sure if I understand your question / issue here. The splitting&#xA;&gt; works by selecting N points on the domain of the function and splitting the&#xA;&gt; domain into segments at those points. This should never leave sats over.&#xA;&#xA;With quantization of 10,000 a channel of size 123,456 ends up as an arc&#xA;with a capacity of 12 units. Cutting this into 5 pieces gives us&#xA;5*2 with 2 units not ending up in any of those pieces. Or am I missing&#xA;something here, and we should split into 5 pieces of size 2.4 = 12/5?&#xA;&#xA;&gt; If the quantization however makes a channel so small  that we cannot&#xA;&gt; even create 5 (or N) disjoint segments then I guess the likelihood for&#xA;&gt; being included into the final result is too small anyway.&#xA;&#xA;It may not be very likely, but flat-out ignoring 20k sat (in my&#xA;contrived example above) or up to 4*quantization sats (which is the case&#xA;you described) doesn&#39;t feel right.&#xA;&#xA;&gt; Again this yield interesting pruning opportunities to reduce the seize of&#xA;&gt; the network before doing the expensive min cost flow computation. For&#xA;&gt; example I could prune channels with high unit costs on the first segment.&#xA;&gt; Especially if they are further away from the source and destination node.&#xA;&gt; This would overall reduce the size of the graph and improve runtime.&#xA;&#xA;Let&#39;s talk about optimizations later :)&#xA;&#xA;&gt; 5) Fees (and other properties?)&#xA;&gt;      arcs.append((src,dest,int(cap/(N*QUANTIZATION)),(i+1)*unit_cost +&#xA;&gt; mu*fee_rate_ppm))&#xA;&#xA;Great, that helps! Thanks alot!&#xA;&#xA;&gt; Note two things:&#xA;&gt; 1. the only requirement for the solver to work is that \mu*fee_rate_ppm&#xA;&gt; needs to be an integer. So in case \mu was smaller than 1 we could also&#xA;&gt; scale the term from the linearized log probabilities by putting a larger mu&#xA;&gt; to the feature arising from the cost of the uncertainty.&#xA;&#xA;Good to know!&#xA;&#xA;Bye,&#xA;Carsten&#xA;-- &#xA;Dr. Carsten Otto&#xA;carsten at c-otto.de&#xA;https://c-otto.de&#xA;-------------- next part --------------&#xA;A non-text attachment was scrubbed...&#xA;Name: signature.asc&#xA;Type: application/pgp-signature&#xA;Size: 195 bytes&#xA;Desc: not available&#xA;URL: &lt;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20220314/2418fb43/attachment.sig&gt;</html></oembed>