<oembed><type>rich</type><version>1.0</version><author_name>npub1vjzmc45k8dgujppapp2ue20h3l9apnsntgv4c0ukncvv549q64gsz4x8dd</author_name><author_url>https://nostr.ae/npub1vjzmc45k8dgujppapp2ue20h3l9apnsntgv4c0ukncvv549q64gsz4x8dd</author_url><provider_name>njump</provider_name><provider_url>https://nostr.ae</provider_url><html>📅 Original date posted:2020-10-15&#xA;📝 Original message:&#xA;Hi Joost,&#xA;&#xA;Thanks for your proposal, please find my following opinion which is&#xA;deliberately on a high-level as IMO defining better threats model and&#xA;agreeing on expected network dynamics resulting from any solution&#xA;trade-offs sounds required before to work on any solution.&#xA;&#xA;&gt; We&#39;ve looked at all kinds of trustless payment schemes to keep users&#xA;&#xA;&gt; honest, but it appears that none of them is satisfactory. Maybe it is&#xA;even&#xA;&gt; theoretically impossible to create a scheme that is trustless and has all&#xA;&#xA;&gt; the properties that we&#39;re looking for. (A proof of that would also be&#xA;&#xA;&gt; useful information to have.)&#xA;&#xA;I don&#39;t think anyone has drawn yet a formal proof of this, but roughly a&#xA;routing peer Bob, aiming to prevent resource abuse at HTLC relay is seeking&#xA;to answer the following question &#34;Is this payment coming from Alice and&#xA;going to Caroll will compensate for my resources consumption ?&#34;. With the&#xA;current LN system, the compensation is conditional on payment settlement&#xA;success and both Alice and Caroll are distrusted yet discretionary on&#xA;failure/success. Thus the underscored question is undecidable for a routing&#xA;peer making relay decisions only on packet observation.&#xA;&#xA;One way to mitigate this, is to introduce statistical observation of&#xA;sender/receiver, namely a reputation system. It can be achieved through a&#xA;scoring system, web-of-trust, or whatever other solution with the same&#xA;properties.&#xA;But still it must be underscored that statistical observations are only&#xA;probabilistic and don&#39;t provide resource consumption security to Bob, the&#xA;routing peer, in a deterministic way. A well-scored peer may start to&#xA;suddenly misbehave.&#xA;&#xA;In that sense, the efficiency evaluation of a reputation-based solution to&#xA;deter DoS must be evaluated based based on the loss of the reputation&#xA;bearer related to the potential damage which can be inflicted. It&#39;s just&#xA;reputation sounds harder to compute accurately than a pure payment-based&#xA;DoS protection system.&#xA;&#xA;&gt; Perhaps a small bit of trust isn&#39;t so bad. There is trust in Lightning&#xA;&#xA;&gt; already. For example when you open a channel, you trust (or hope) that&#xA;your&#xA;&gt; peer remains well connected, keeps charging reasonable fees, doesn&#39;t&#xA;&#xA;&gt; force-close in a bad way, etc.&#xA;&#xA;That&#39;s a good recall, obviously we should avoid getting stuck in a false&#xA;trust-vs-trustlessness dichotomy but always bound the discussion to a&#xA;specific situation. Even the base layer involved some trust assumptions,&#xA;like fetching your initial p2p peers from DNS seeds, all the matter is how&#xA;do you minimize this assumption. You might not have the same expectation&#xA;when it&#39;s miners which might completely screw up the safety of your coin&#xA;stack than routing nodes which might only make your loss a tiny routing&#xA;fee, a minor nuisance.&#xA;&#xA;&gt; What I can see working is a system where peers charge each other a hold&#xA;fee&#xA;&gt; for forwarded HTLCs based on the actual lock time (not the maximum lock&#xA;&#xA;&gt; time) and the htlc value. This is just for the cost of holding and&#xA;separate&#xA;&gt; from the routing fee that is earned when the payment settles&#xA;&#xA;Yes I guess any solution will work as long as it enforces an asymmetry&#xA;between the liquidity requester and a honest routing peer. This asymmetry&#xA;can be defined as guaranteeing that the routing peer&#39;s incoming/outgoing&#xA;balance is always increasing, independently of payment success. Obviously&#xA;this increase should be materialized by a payment, while minding it might&#xA;be discounted based on requester reputation (&#34;pay-with-your-reputation&#34;).&#xA;This reputation evaluation can be fully delegated to the routing node&#xA;policy, without network-wise guidance.&#xA;&#xA;That said, where I&#39;m skeptical on any reputation-heavy system is on the&#xA;long-term implications.&#xA;&#xA;Either, due to the wants of a subset of actors deliberately willingly to&#xA;trade satoshis against discounted payment flow by buying well-scored&#xA;pubkeys, we see the emergence of a reputation market. Thus enabling&#xA;reputation to be fungible to satoshis, but with now a weird &#34;reputation&#34;&#xA;token to care about.&#xA;&#xA;Or, reputation is too hard to make liquid (e.g hard to disentangle pubkeys&#xA;from channel ownership or export your score across routing peers) and thus&#xA;you now have reputation scarcity which is introducing a bias from a &#34;purer&#34;&#xA;market, where agents are only routing based on advertised fees. IMO, we&#xA;should strive for the more liquid Lightning market we can, as it avoids&#xA;bias towards past actors and thus may contain centralization inertia. I&#39;m&#xA;curious about your opinion on this last point.&#xA;&#xA;Moving forward, I think t-bast is working on gathering materials to&#xA;checkbox the first step, establishing a fully-fledged threat model.&#xA;&#xA;Cheers,&#xA;&#xA;Antoine&#xA;&#xA;Le lun. 12 oct. 2020 à 07:04, Joost Jager &lt;joost.jager at gmail.com&gt; a écrit :&#xA;&#xA;&gt; Hello list,&#xA;&gt;&#xA;&gt; Many discussions have taken place on this list on how to prevent undesired&#xA;&gt; use of the Lightning network. Spamming the network with HTLCs (for probing&#xA;&gt; purposes or otherwise) or holding HTLCs to incapacitate channels can be&#xA;&gt; done on today&#39;s network at very little cost to an attacker. So far this&#xA;&gt; doesn&#39;t seem to be happening in practice, but I believe that it is only a&#xA;&gt; matter of time before it will become a real issue.&#xA;&gt;&#xA;&gt; Rate limits and other limits such as the maximum number of in-flight HTLCs&#xA;&gt; increase the cost of an attack, but may also limit the capabilities of&#xA;&gt; honest users. It works as a mitigation, but it doesn&#39;t seem to be the ideal&#xA;&gt; solution.&#xA;&gt;&#xA;&gt; We&#39;ve looked at all kinds of trustless payment schemes to keep users&#xA;&gt; honest, but it appears that none of them is satisfactory. Maybe it is even&#xA;&gt; theoretically impossible to create a scheme that is trustless and has all&#xA;&gt; the properties that we&#39;re looking for. (A proof of that would also be&#xA;&gt; useful information to have.)&#xA;&gt;&#xA;&gt; Perhaps a small bit of trust isn&#39;t so bad. There is trust in Lightning&#xA;&gt; already. For example when you open a channel, you trust (or hope) that your&#xA;&gt; peer remains well connected, keeps charging reasonable fees, doesn&#39;t&#xA;&gt; force-close in a bad way, etc.&#xA;&gt;&#xA;&gt; What I can see working is a system where peers charge each other a hold&#xA;&gt; fee for forwarded HTLCs based on the actual lock time (not the maximum lock&#xA;&gt; time) and the htlc value. This is just for the cost of holding and separate&#xA;&gt; from the routing fee that is earned when the payment settles.&#xA;&gt;&#xA;&gt; This hold fee could be: lock_time * (fee_base + fee_rate * htlc_value).&#xA;&gt; fee_base is in there to compensate for the usage of an htlc slot, which is&#xA;&gt; a scarce resource too.&#xA;&gt;&#xA;&gt; I think the implementation of this is less interesting at this stage, but&#xA;&gt; some ideas are:&#xA;&gt;&#xA;&gt; A. Prepayment: node pays an amount to its channel peer (for example via&#xA;&gt; keysend) and the channel peer deducts the hold fees from that prepaid&#xA;&gt; balance until it is at zero. At that point it somehow (in the htlc fail&#xA;&gt; message?) communicates Lightning&#39;s version of http 402 to ask for more&#xA;&gt; money.&#xA;&gt;&#xA;&gt; B. Tightly integrated with the htlc add/fail/settle messages. When an htlc&#xA;&gt; is added, the maximum cost (based on maximum lock time) for holding is&#xA;&gt; deducted from the sender&#39;s channel balance. When the htlc settles, a refund&#xA;&gt; is given based on the actual lock time. An additional `update_fee`-like&#xA;&gt; message is added for peers to update their hold fee parameters (fee_base&#xA;&gt; and fee_rate).&#xA;&gt;&#xA;&gt; In both cases the sender needs to trust its peer to not steal the payment&#xA;&gt; and/or artificially delay the forwarding to inflate the hold fee. I think&#xA;&gt; that is acceptable given that there is a trust relation between peers&#xA;&gt; already anyway.&#xA;&gt;&#xA;&gt; A crucial thing is that these hold fees don&#39;t need to be symmetric. A new&#xA;&gt; node for example that opens a channel to a well-known, established routing&#xA;&gt; node will be forced to pay a hold fee, but won&#39;t see any traffic coming in&#xA;&gt; anymore if it announces a hold fee itself. Nodes will need to build a&#xA;&gt; reputation before they&#39;re able to command hold fees. Similarly, routing&#xA;&gt; nodes that have a strong relation may decide to not charge hold fees to&#xA;&gt; each other at all.&#xA;&gt;&#xA;&gt; This asymmetry is what is supposed to prevent channel jamming attacks. The&#xA;&gt; attacker needs to pay hold fees to send out the payment, but when it comes&#xA;&gt; back to the attacker after traversing a circular route, they won&#39;t be able&#xA;&gt; to charge a hold fee to cancel out the hold fee paid at the start of the&#xA;&gt; route. (Assuming the attacker node is not trusted.)&#xA;&gt;&#xA;&gt; A consequence for honest users is that payment attempts are no longer&#xA;&gt; free. The cost should however be negligible for fast-failing attempts. Also&#xA;&gt; senders will have to be a lot more selective when building a route.&#xA;&gt; Selecting a &#39;black hole&#39; hop (hop that doesn&#39;t forward nor fail) can be&#xA;&gt; costly.&#xA;&gt;&#xA;&gt; The hold fee scheme is a bit looser compared to previously proposed&#xA;&gt; schemes (as far as I know...). It is purely an arrangement between channel&#xA;&gt; peers and doesn&#39;t try to exactly compensate every hop for its costs.&#xA;&gt; Instead trust relations that arguably exist already are leveraged to&#xA;&gt; present a bill to the actor who deserves it.&#xA;&gt;&#xA;&gt; Interested to hear opinions about this proposal.&#xA;&gt;&#xA;&gt; I&#39;d also like to encourage everyone to prioritize this spam/jam issue and&#xA;&gt; dedicate more time to solving it. Obviously there is a lot more to do in&#xA;&gt; Lightning, but I am not sure if we can afford to wait for the real&#xA;&gt; adversaries to show up on this one.&#xA;&gt;&#xA;&gt; Cheers,&#xA;&gt; Joost&#xA;&gt;&#xA;&gt; _______________________________________________&#xA;&gt; Lightning-dev mailing list&#xA;&gt; Lightning-dev at lists.linuxfoundation.org&#xA;&gt; https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&#xA;&gt;&#xA;-------------- next part --------------&#xA;An HTML attachment was scrubbed...&#xA;URL: &lt;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20201015/75e1091b/attachment.html&gt;</html></oembed>