<oembed><type>rich</type><version>1.0</version><author_name>npub19helcfnqgk2jrwzjex2aflq6jwfc8zd9uzzkwlgwhve7lykv23mq5zkvn4</author_name><author_url>https://nostr.ae/npub19helcfnqgk2jrwzjex2aflq6jwfc8zd9uzzkwlgwhve7lykv23mq5zkvn4</author_url><provider_name>njump</provider_name><provider_url>https://nostr.ae</provider_url><html>📅 Original date posted:2020-04-22&#xA;📝 Original message:&#xA;Hi Matt,&#xA;&#xA;&#xA;&gt; While this is somewhat unintuitive, there are any number of good anti-DoS&#xA;&gt; reasons for this, eg:&#xA;&#xA;None of these really strikes me as &#34;good&#34; reasons for this limitation, which&#xA;is at the root of this issue, and will also plague any more complex Bitcoin&#xA;contracts which rely on nested trees of transaction to confirm (CTV, Duplex,&#xA;channel factories, etc). Regarding the various (seemingly arbitrary) package&#xA;limits it&#39;s likely the case that any issues w.r.t computational complexity&#xA;that may arise when trying to calculate evictions can be ameliorated with&#xA;better choice of internal data structures.&#xA;&#xA;In the end, the simplest heuristic (accept the higher fee rate package) side&#xA;steps all these issues and is also the most economically rationale from a&#xA;miner&#39;s perspective. Why would one prefer a higher absolute fee package&#xA;(which could be very large) over another package with a higher total _fee&#xA;rate_?&#xA;&#xA;&gt; You&#39;ll note that B would be just fine if they had a way to safely monitor&#xA;the&#xA;&gt; global mempool, and while this seems like a prudent mitigation for&#xA;&gt; lightning implementations to deploy today, it is itself a quagmire of&#xA;&gt; complexity&#xA;&#xA;Is it really all that complex? Assuming we&#39;re talking about just watching&#xA;for a certain script template (the HTLC scipt) in the mempool to be able to&#xA;pull a pre-image as soon as possible. Early versions of lnd used the mempool&#xA;for commitment broadcast detection (which turned out to be a bad idea so we&#xA;removed it), but at a glance I don&#39;t see why watching the mempool is so&#xA;complex.&#xA;&#xA;&gt; Further, this is a really obnoxious assumption to hoist onto lightning&#xA;&gt; nodes - having an active full node with an in-sync mempool is a lot more&#xA;&gt; CPU, bandwidth, and complexity than most lightning users were expecting to&#xA;&gt; face.&#xA;&#xA;This would only be a requirement for Lightning nodes that seek to be a part&#xA;of the public routing network with a desire to _forward_ HTLCs. This isn&#39;t&#xA;doesn&#39;t affect laptops or mobile phones which likely mostly have private&#xA;channels and don&#39;t participate in HTLC forwarding. I think it&#39;s pretty&#xA;reasonable to expect a &#34;proper&#34; routing node on the network to be backed by&#xA;a full-node. The bandwidth concern is valid, but we&#39;d need concrete numbers&#xA;that compare the bandwidth over head of mempool awareness (assuming the&#xA;latest and greatest mempool syncing) compared with the overhead of the&#xA;channel update gossip and gossip queries over head which LN nodes face today&#xA;as is to see how much worse off they really would be.&#xA;&#xA;As detailed a bit below, if nodes watch the mempool, then this class of&#xA;attack assuming the anchor output format as described in the open&#xA;lightning-rfc PR is mitigated. At a glance, watching the mempool seems like&#xA;a far less involved process compared to modifying the state machine as its&#xA;defined today. By watching the mempool and implementing the changes in&#xA;#lightning-rfc/688, then this issue can be mitigated _today_. lnd 0.10&#xA;doesn&#39;t yet watch the mempool (but does include anchors [1]), but unless I&#39;m&#xA;missing something it should be pretty straight forward to add which mor or&#xA;less&#xA;resolves this issue all together.&#xA;&#xA;&gt; not fixing this issue seems to render the whole exercise somewhat useless&#xA;&#xA;Depends on if one considers watching the mempool a fix. But even with that a&#xA;base version of anchors still resolves a number of issues including:&#xA;eliminating the commitment fee guessing game, allowing users to pay less on&#xA;force close, being able to coalesce 2nd level HTLC transactions with the&#xA;same CLTV expiry, and actually being able to reliably enforce multi-hop HTLC&#xA;resolution.&#xA;&#xA;&gt; Instead of making the HTLC output spending more free-form with&#xA;&gt; SIGHASH_ANYONECAN_PAY|SIGHASH_SINGLE, we clearly need to go the other&#xA;&gt; direction - all HTLC output spends need to be pre-signed.&#xA;&#xA;I&#39;m not sure this is actually immediately workable (need to think about it&#xA;more). To see why, remember that the commit_sig message includes HTLC&#xA;signatures for the _remote_ party&#39;s commitment transaction, so they can&#xA;spend the HTLCs if they broadcast their version of the commitment (force&#xA;close). If we don&#39;t somehow also _gain_ signatures (our new HTLC signatures)&#xA;allowing us to spend HTLCs on _their_ version of the commitment, then if&#xA;they broadcast that commitment (without revoking), then we&#39;re unable to&#xA;redeem any of those HTLCs at all, possibly losing money.&#xA;&#xA;In an attempt to counteract this, we might say ok, the revoke message also&#xA;now includes HTLC signatures for their new commitment allowing us to spend&#xA;our HTLCs. This resolves things in a weaker security model, but doesn&#39;t&#xA;address the issue generally, as after they receive the commit_sig, they can&#xA;broadcast immediately, again leaving us without a way to redeem our HTLCs.&#xA;&#xA;I&#39;d need to think about it more, but it seems that following this path would&#xA;require an overhaul in the channel state machine to make presenting a new&#xA;commitment actually take at least _two phases_ (at least a full round trip).&#xA;The first phase would tender the commitment, but render them unable to&#xA;broadcast it. The second phase would then &lt;insert something something&#xA;scriptless scripts here&gt; enter a new sub-protocol which upon conclusion,&#xA;gives the commitment proposer valid HTLC signatures, and gives the responder&#xA;what they need to be able to broadcast their commitment and claim their&#xA;HTCLs in an atomic manner.&#xA;&#xA;-- Laolu&#xA;&#xA;[1]: https://github.com/lightningnetwork/lnd/pull/3821&#xA;-------------- next part --------------&#xA;An HTML attachment was scrubbed...&#xA;URL: &lt;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20200421/6cae2a06/attachment.html&gt;</html></oembed>