<oembed><type>rich</type><version>1.0</version><author_name>npub1aslmpzentw224n3s6yccru4dq2qdlx7rfudfnqevfck637cjt6esswfqmx</author_name><author_url>https://nostr.ae/npub1aslmpzentw224n3s6yccru4dq2qdlx7rfudfnqevfck637cjt6esswfqmx</author_url><provider_name>njump</provider_name><provider_url>https://nostr.ae</provider_url><html>📅 Original date posted:2020-10-12&#xA;📝 Original message:&#xA;Hello list,&#xA;&#xA;Many discussions have taken place on this list on how to prevent undesired&#xA;use of the Lightning network. Spamming the network with HTLCs (for probing&#xA;purposes or otherwise) or holding HTLCs to incapacitate channels can be&#xA;done on today&#39;s network at very little cost to an attacker. So far this&#xA;doesn&#39;t seem to be happening in practice, but I believe that it is only a&#xA;matter of time before it will become a real issue.&#xA;&#xA;Rate limits and other limits such as the maximum number of in-flight HTLCs&#xA;increase the cost of an attack, but may also limit the capabilities of&#xA;honest users. It works as a mitigation, but it doesn&#39;t seem to be the ideal&#xA;solution.&#xA;&#xA;We&#39;ve looked at all kinds of trustless payment schemes to keep users&#xA;honest, but it appears that none of them is satisfactory. Maybe it is even&#xA;theoretically impossible to create a scheme that is trustless and has all&#xA;the properties that we&#39;re looking for. (A proof of that would also be&#xA;useful information to have.)&#xA;&#xA;Perhaps a small bit of trust isn&#39;t so bad. There is trust in Lightning&#xA;already. For example when you open a channel, you trust (or hope) that your&#xA;peer remains well connected, keeps charging reasonable fees, doesn&#39;t&#xA;force-close in a bad way, etc.&#xA;&#xA;What I can see working is a system where peers charge each other a hold fee&#xA;for forwarded HTLCs based on the actual lock time (not the maximum lock&#xA;time) and the htlc value. This is just for the cost of holding and separate&#xA;from the routing fee that is earned when the payment settles.&#xA;&#xA;This hold fee could be: lock_time * (fee_base + fee_rate * htlc_value).&#xA;fee_base is in there to compensate for the usage of an htlc slot, which is&#xA;a scarce resource too.&#xA;&#xA;I think the implementation of this is less interesting at this stage, but&#xA;some ideas are:&#xA;&#xA;A. Prepayment: node pays an amount to its channel peer (for example via&#xA;keysend) and the channel peer deducts the hold fees from that prepaid&#xA;balance until it is at zero. At that point it somehow (in the htlc fail&#xA;message?) communicates Lightning&#39;s version of http 402 to ask for more&#xA;money.&#xA;&#xA;B. Tightly integrated with the htlc add/fail/settle messages. When an htlc&#xA;is added, the maximum cost (based on maximum lock time) for holding is&#xA;deducted from the sender&#39;s channel balance. When the htlc settles, a refund&#xA;is given based on the actual lock time. An additional `update_fee`-like&#xA;message is added for peers to update their hold fee parameters (fee_base&#xA;and fee_rate).&#xA;&#xA;In both cases the sender needs to trust its peer to not steal the payment&#xA;and/or artificially delay the forwarding to inflate the hold fee. I think&#xA;that is acceptable given that there is a trust relation between peers&#xA;already anyway.&#xA;&#xA;A crucial thing is that these hold fees don&#39;t need to be symmetric. A new&#xA;node for example that opens a channel to a well-known, established routing&#xA;node will be forced to pay a hold fee, but won&#39;t see any traffic coming in&#xA;anymore if it announces a hold fee itself. Nodes will need to build a&#xA;reputation before they&#39;re able to command hold fees. Similarly, routing&#xA;nodes that have a strong relation may decide to not charge hold fees to&#xA;each other at all.&#xA;&#xA;This asymmetry is what is supposed to prevent channel jamming attacks. The&#xA;attacker needs to pay hold fees to send out the payment, but when it comes&#xA;back to the attacker after traversing a circular route, they won&#39;t be able&#xA;to charge a hold fee to cancel out the hold fee paid at the start of the&#xA;route. (Assuming the attacker node is not trusted.)&#xA;&#xA;A consequence for honest users is that payment attempts are no longer free.&#xA;The cost should however be negligible for fast-failing attempts. Also&#xA;senders will have to be a lot more selective when building a route.&#xA;Selecting a &#39;black hole&#39; hop (hop that doesn&#39;t forward nor fail) can be&#xA;costly.&#xA;&#xA;The hold fee scheme is a bit looser compared to previously proposed schemes&#xA;(as far as I know...). It is purely an arrangement between channel peers&#xA;and doesn&#39;t try to exactly compensate every hop for its costs. Instead&#xA;trust relations that arguably exist already are leveraged to present a bill&#xA;to the actor who deserves it.&#xA;&#xA;Interested to hear opinions about this proposal.&#xA;&#xA;I&#39;d also like to encourage everyone to prioritize this spam/jam issue and&#xA;dedicate more time to solving it. Obviously there is a lot more to do in&#xA;Lightning, but I am not sure if we can afford to wait for the real&#xA;adversaries to show up on this one.&#xA;&#xA;Cheers,&#xA;Joost&#xA;-------------- next part --------------&#xA;An HTML attachment was scrubbed...&#xA;URL: &lt;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20201012/c7943c5e/attachment.html&gt;</html></oembed>