<oembed><type>rich</type><version>1.0</version><title>ZmnSCPxj [ARCHIVE] wrote</title><author_name>ZmnSCPxj [ARCHIVE] (npub1g5…3ms3l)</author_name><author_url>https://yabu.me/npub1g5zswf6y48f7fy90jf3tlcuwdmjn8znhzaa4vkmtxaeskca8hpss23ms3l</author_url><provider_name>njump</provider_name><provider_url>https://yabu.me</provider_url><html>📅 Original date posted:2020-12-15&#xA;📝 Original message:&#xA;Good morning LL,&#xA;&#xA;&#xA;&gt; - What do you do if the channel state has HTLCs in flight? I don&#39;t know -- I guess you can just put them onto the settlement tx? That way it&#39;s possible the payment could still go through. Alternatively you could just gift the money to the party offering the recovery settlement.&#xA;&#xA;Gifting the money is not a good option --- we allow HTLCs to be almost as high as the total channel value minus fees and reserve.&#xA;Thus all the claimable value could potentially be in an outgoing HTLC.&#xA;Worse, if our node is a forwarding node, it would be easy for a third party to arrange to have our funds in various HTLCs.&#xA;&#xA;If we allow HTLCs to keep going on even while we are in recovery, we need to be able to &#34;bind&#34; as well incoming and outgoing HTLCs if our node was a forwarding node.&#xA;&#xA;In particular, consider this situation:&#xA;&#xA;* We are a forwarding node.&#xA;* We forward a payment whose outgoing expires in 1 day and whose incoming expires in 2 days.&#xA;  * This means we have at least two channels, one with the incoming HTLC and another with the outgoing HTLC.&#xA;* We hit our head and get amnesia.&#xA;* It takes us a day to realize we were formerly a Lightning Network forwarding node.&#xA;* The peer with the outgoing HTLC knows or learns the preimage.&#xA;  * Since we were unresponsive (i.e. still recovering from whatever gave us amnesia) that peer has dropped the channel onchain.&#xA;  * The peer has resolved the onchain HTLC with the hashlock branch.&#xA;* Because the outgoing peer has resolved everything it cares about, it forgets about the channel.&#xA;* We call all public nodes and ask about channels we might have with them.&#xA;* The incoming peer claims we have a channel with them containing an HTLC going to us.&#xA;* The outgoing peer has forgotten about us and does not tell us about the channel.&#xA;&#xA;Thus, we cannot recover the outgoing channel, since the peer has already closed it and resolved everything it is interested in.&#xA;(let us suppose that the `to_self_delay` is smaller than our `cltv_delta` setting)&#xA;&#xA;Using static-key channels (i.e. channel keys are our node keys) allows us to recover even the outgoing channel with outgoing HTLC that has been forgotten by the outgoing peer.&#xA;&#xA;Using static-key channels does have slightly weaker privacy:&#xA;&#xA;* Published nodes reveal all their channels with other published nodes on the blockchain.&#xA;  * While it is true that published nodes already reveal their channels with published nodes, they are currently only revealed on the LN gossip network, which is not archived; historical channels that are now closed are not informed to current surveillors.&#xA;    * On the other hand, all it takes is one &#34;LN wayback machine&#34; to record all LN gossip, which are self-attesting and include a signature from the node.&#xA;* Unpublished nodes risk revealing their channels with published nodes via the blockchain.&#xA;  * Invoices created by unpublished nodes currently reveal their public key.&#xA;    Payers can then uncover all the channels of that node.&#xA;  * An unpublished node could use a faked node id, by combining the payment hash/point with its privkey to generate a new keypair to use as faked node id (I AM NOT A CRYPTOGRAPHER AND THIS TECHNIQUE IS POTENTIALLY GOING TO LOSE ALL YOUR FUNDS AND PRIVACY AND KILL YOUR DOG).&#xA;    On receiving an unparseable onion, it could try combining its privkey with the payment hash/point and try to open the onion that way, in case it is an incoming payment with the faked node id.&#xA;&#xA;&#xA;Regards,&#xA;ZmnSCPxj</html></oembed>