<oembed><type>rich</type><version>1.0</version><title>Anthony Towns [ARCHIVE] wrote</title><author_name>Anthony Towns [ARCHIVE] (npub17r…x9l2h)</author_name><author_url>https://yabu.me/npub17rld56k4365lfphyd8u8kwuejey5xcazdxptserx03wc4jc9g24stx9l2h</author_url><provider_name>njump</provider_name><provider_url>https://yabu.me</provider_url><html>📅 Original date posted:2020-02-20&#xA;📝 Original message:&#xA;On Thu, Feb 20, 2020 at 03:42:39AM +0000, ZmnSCPxj wrote:&#xA;&gt; A thought that arises here is, what happens if I have forwarded a payment, then the outgoing channel is dropped onchain and that peer disconnects from me?&#xA;&gt; &#xA;&gt; Since the onchain HTLC might have a timelock of, say, a few hundred blocks from now, the outgoing peer can claim it up until the timelock.&#xA;&gt; If the peer does not claim it, I cannot claim it in my incoming as well.&#xA;&gt; I also cannot safely fail my incoming, as the outgoing peer can still claim it until the timelock expires.&#xA;&#xA;Suppose the channel state looks like:&#xA;&#xA;  Bob&#39;s balance:   $150&#xA;  Carol&#39;s balance: $500&#xA;  Bob to Carol:     $50, hash X, timelock +2016 blocks&#xA;&#xA;The pre-signed close transaction will have already deducted maybe $1 in&#xA;fees, say 50c from each balance.&#xA;&#xA;At 5% pa, that&#39;s $50*0.05*2/52, so about 10 cents worth of &#34;holding&#34;&#xA;fees, so that seems like it&#39;s worth just committing to up-front, ie:&#xA;&#xA;  Bob&#39;s balance:   $149.60 (-.50+.10)&#xA;  Carol&#39;s balance: $499.40 (-.50-.10)&#xA;  Bob to Carol:     $50, hash X, timelock +2016 blocks&#xA;  Fees:              $1&#xA;&#xA;And that seems necessary anyway: if the channel does drop to the chain,&#xA;then the HTLC can&#39;t be cancelled, so if it never confirms, Bob will have&#xA;had to pay, say, 9.5c to Alice waiting for the timeout, and can then&#xA;immediately cancel the HTLC with Alice allowing it to finish unwinding.&#xA;&#xA;So I think the idea would be not to accept a (rate, amount, timelock)&#xA;tuple for an incoming HTLC unless the rate*amount*timelock product&#xA;is substantially less than what you&#39;re putting towards the blockchain&#xA;fees anyway, as otherwise you&#39;ve got bad incentives for the other guy to&#xA;drop to the chain.&#xA;&#xA;Note the rate increases with number of hops, so if it&#39;s 1% pa per hop,&#xA;the 11th peer will be emitting 10% pa. I think that&#39;s probably okay,&#xA;because BTC&#39;s deflationary nature probably means you don&#39;t need to earn&#xA;much interest on it, and you can naturally choose the rate dynamically&#xA;based on how many HTLCs you currently have open and how much of your&#xA;channel funds are being used up by the HTLC?&#xA;&#xA;Also, you&#39;d presumably update your channel state every hundred blocks,&#xA;reducing the 10c by half a cent or so each time, so you could have your&#xA;risk reduce. Maybe there could be some way of bumping the timelock across&#xA;a HTLC path so that the risk is capped, but if the HTLC is still being&#xA;paid for it doesn&#39;t have to be cancelled?&#xA;&#xA;Cheers,&#xA;aj</html></oembed>