{"type":"rich","version":"1.0","title":"Anthony Towns [ARCHIVE] wrote","author_name":"Anthony Towns [ARCHIVE] (npub17r…x9l2h)","author_url":"https://yabu.me/npub17rld56k4365lfphyd8u8kwuejey5xcazdxptserx03wc4jc9g24stx9l2h","provider_name":"njump","provider_url":"https://yabu.me","html":"📅 Original date posted:2020-02-20\n📝 Original message:\nOn Thu, Feb 20, 2020 at 03:42:39AM +0000, ZmnSCPxj wrote:\n\u003e 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?\n\u003e \n\u003e 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.\n\u003e If the peer does not claim it, I cannot claim it in my incoming as well.\n\u003e I also cannot safely fail my incoming, as the outgoing peer can still claim it until the timelock expires.\n\nSuppose the channel state looks like:\n\n  Bob's balance:   $150\n  Carol's balance: $500\n  Bob to Carol:     $50, hash X, timelock +2016 blocks\n\nThe pre-signed close transaction will have already deducted maybe $1 in\nfees, say 50c from each balance.\n\nAt 5% pa, that's $50*0.05*2/52, so about 10 cents worth of \"holding\"\nfees, so that seems like it's worth just committing to up-front, ie:\n\n  Bob's balance:   $149.60 (-.50+.10)\n  Carol's balance: $499.40 (-.50-.10)\n  Bob to Carol:     $50, hash X, timelock +2016 blocks\n  Fees:              $1\n\nAnd that seems necessary anyway: if the channel does drop to the chain,\nthen the HTLC can't be cancelled, so if it never confirms, Bob will have\nhad to pay, say, 9.5c to Alice waiting for the timeout, and can then\nimmediately cancel the HTLC with Alice allowing it to finish unwinding.\n\nSo I think the idea would be not to accept a (rate, amount, timelock)\ntuple for an incoming HTLC unless the rate*amount*timelock product\nis substantially less than what you're putting towards the blockchain\nfees anyway, as otherwise you've got bad incentives for the other guy to\ndrop to the chain.\n\nNote the rate increases with number of hops, so if it's 1% pa per hop,\nthe 11th peer will be emitting 10% pa. I think that's probably okay,\nbecause BTC's deflationary nature probably means you don't need to earn\nmuch interest on it, and you can naturally choose the rate dynamically\nbased on how many HTLCs you currently have open and how much of your\nchannel funds are being used up by the HTLC?\n\nAlso, you'd presumably update your channel state every hundred blocks,\nreducing the 10c by half a cent or so each time, so you could have your\nrisk reduce. Maybe there could be some way of bumping the timelock across\na HTLC path so that the risk is capped, but if the HTLC is still being\npaid for it doesn't have to be cancelled?\n\nCheers,\naj"}
