<oembed><type>rich</type><version>1.0</version><author_name>npub1tcwr7j30p5q4sypnsw4arca9s2433s7wdcpt2z2sk7pkqfsntjds0pu5xp</author_name><author_url>https://nostr.ae/npub1tcwr7j30p5q4sypnsw4arca9s2433s7wdcpt2z2sk7pkqfsntjds0pu5xp</author_url><provider_name>njump</provider_name><provider_url>https://nostr.ae</provider_url><html>📅 Original date posted:2023-03-02&#xA;📝 Original message:&#xA;Hello,&#xA;&#xA;I think the local reputation is more important than upfront fees and should&#xA;be worked on first because 1) the most likely attack against the network&#xA;today is the slow jamming attack against which upfront fees are not very&#xA;effective (an attacker would only consider fast jamming if the network is&#xA;already resilient to slow jamming) and 2) I think that local reputation may&#xA;protect well enough against all types of jamming so that we don&#39;t even need&#xA;upfront fees to protect against fast jamming.&#xA;Regarding the formula itself, I would treat all scores as continuous values&#xA;between 0 and 1 instead of binary classes. My proposed formula is detailed&#xA;here:&#xA;https://docs.google.com/document/d/1hEt1EzyPFJ3gOY7PAvtm_XotTnlQO2r7LSF8Jx34qgc/edit?usp=sharing&#xA;However my proposal is compatible with Clara&#39;s one in that the only thing&#xA;that needs to be communicated to the peers is how confident we are that the&#xA;payment will succeed and all the rest is done locally and everyone can use&#xA;their own formula. I would just prefer this confidence value to be more&#xA;than one bit but my formula would work with anything, even zero bits. The&#xA;advantage of using more bits is that we can be more precise in which HTLCs&#xA;we reject and reduce the number of innocent casualties.&#xA;&#xA;Thomas&#xA;&#xA;Le jeu. 16 févr. 2023 à 22:29, Clara Shikhelman &lt;clara.shikhelman at gmail.com&gt;&#xA;a écrit :&#xA;&#xA;&gt; Hi List,&#xA;&gt;&#xA;&gt; We’re writing to seek early feedback on a draft for a neighbour reputation&#xA;&gt; setting recommendation as a jamming mitigation. The main idea is that&#xA;&gt; allowing full access to liquidity and slots in a channel can result in&#xA;&gt; jamming. To prevent this, we allow full access only to neighbours that&#xA;&gt; forward HTLC that resolve quickly and generate more profit than the damage&#xA;&gt; they can potentially create.&#xA;&gt;&#xA;&gt; The full suggested jamming mitigation solution includes upfront fees&#xA;&gt; together with reputation, see [1] for details.&#xA;&gt;&#xA;&gt; In the previous episodes:&#xA;&gt;&#xA;&gt; As presented here [1], we suggest a two part jamming mitigation strategy.&#xA;&gt; Reputation-based forwarding is aimed to solve “slow jamming”, where the&#xA;&gt; jamming transaction takes a long time to resolve.&#xA;&gt;&#xA;&gt; The main idea is that each node gives a binary reputation to its&#xA;&gt; neighbour. Each channel has a quota of liquidity and slots (say 50% of the&#xA;&gt; channel size and 50% of the slots in the channel) dedicated to transactions&#xA;&gt; coming from neighbours with reputation 0, or for transactions coming from&#xA;&gt; neighbours with reputation 1 that were not endorsed by the neighbour.&#xA;&gt;&#xA;&gt; For example, when Alice asks Bob to forward to Charlie then:&#xA;&gt;&#xA;&gt; If (Alice has reputation 1 with Bob) and (Alice endorses transaction):&#xA;&gt;&#xA;&gt; Forward and endorse&#xA;&gt;&#xA;&gt; Else:&#xA;&gt;&#xA;&gt; If (amount &lt; available liquidity quota) and (available slots in quota&gt;0):&#xA;&gt;&#xA;&gt; Forward HTLC without endorsing&#xA;&gt;&#xA;&gt; Reduce available liquidity and slots&#xA;&gt;&#xA;&gt; Else:&#xA;&gt;&#xA;&gt; Reject&#xA;&gt;&#xA;&gt; Reputation:&#xA;&gt;&#xA;&gt; The question we discuss here is how does Alice gain “good” reputation&#xA;&gt; (i.e., a score of 1). Alice starts at 0, and she gains and keeps her good&#xA;&gt; reputation of 1 by continuously paying more fees to Bob than the damage she&#xA;&gt; can inflict.&#xA;&gt;&#xA;&gt; The 3 main parameters for reputation that each node operator picks are S,L&#xA;&gt; and M. Our recommendations are as follows:&#xA;&gt;&#xA;&gt;    -&#xA;&gt;&#xA;&gt;    S should be chosen as the maximum time an HTLC can be unresolved in&#xA;&gt;    any of Bob’s channels.&#xA;&gt;    -&#xA;&gt;&#xA;&gt;    M is the revenue generated by Bob’s node in the time S, representing&#xA;&gt;    the damage Alice could inflict.&#xA;&gt;    -&#xA;&gt;&#xA;&gt;    L is the time in which Alice should generate M revenue for Bob for her&#xA;&gt;    to have a good reputation of 1. We suggest L=10S.&#xA;&gt;&#xA;&gt;&#xA;&gt; Alice has reputation 1 if, in the last L seconds, she has forwarded&#xA;&gt; payments that generated M satoshi in fees.&#xA;&gt;&#xA;&gt; As an example:&#xA;&gt;&#xA;&gt;    -&#xA;&gt;&#xA;&gt;    Bob has a maximum CLTV delta of 2 weeks [2]&#xA;&gt;    -&#xA;&gt;&#xA;&gt;    Over the last 2 weeks, he has earned 0.5 BTC in routing fees&#xA;&gt;    -&#xA;&gt;&#xA;&gt;    Alice will be considered to have good reputation if she has forwarded&#xA;&gt;    0.5 BTC of routing revenue to Bob over the last 20 weeks&#xA;&gt;&#xA;&gt;&#xA;&gt; Formally:&#xA;&gt;&#xA;&gt; Let t be the current time, and let S and L be constants.&#xA;&gt;&#xA;&gt; M is calculated to be the revenue of Bob in time [t-S,t]. The revenue of&#xA;&gt; Bob is the sum of fees from transactions forwarded by any neighbour besides&#xA;&gt; Alice + any payments received by Bob. Note that Bob can choose to also take&#xA;&gt; into account utility gained from sending payments or anything of value to&#xA;&gt; the node operator.&#xA;&gt;&#xA;&gt; Alice has reputation 1 if in the time [t-L,t] she has forwarded HTLCs&#xA;&gt; that paid M in normalized fees.&#xA;&gt;&#xA;&gt; We normalize fees by resolution time to reward payments that resolve&#xA;&gt; quickly and discount slow resolving payments. Here we assume 10 seconds is&#xA;&gt; the “normal” resolution time, this number can be bikesheded, and we round&#xA;&gt; up to avoid penalizing transactions resolved quicker than the “normal”.&#xA;&gt;&#xA;&gt; The fee from a single transaction is normalized by the time it took for&#xA;&gt; the HTLC to resolve, counted in slots of 10 seconds. That is:&#xA;&gt;&#xA;&gt; Normalized_fee = (fee)/[ceiling(time_to_resolve/10s)]&#xA;&gt;&#xA;&gt;&#xA;&gt;&#xA;&gt; Some notes&#xA;&gt;&#xA;&gt;    1.&#xA;&gt;&#xA;&gt;    The reputation management happens locally, that is, the only protocol&#xA;&gt;    change needed is the ability to signal endorsement as a TLV in&#xA;&gt;    UpdateAddHTLC. The various parameters can be selected for various risk&#xA;&gt;    preferences.&#xA;&gt;    2.&#xA;&gt;&#xA;&gt;    We currently suggest a binary reputation for simplicity. Having&#xA;&gt;    several buckets could be interesting to study, yet we don’t think that the&#xA;&gt;    complexity and the possible privacy issues are worth the potential benefits.&#xA;&gt;    3.&#xA;&gt;&#xA;&gt;    For most use cases, having reputation 0 is more than enough. If we&#xA;&gt;    send and receive transactions at a low rate, we usually don’t need the full&#xA;&gt;    liquidity and slots available in a channel. Reputation mostly comes into&#xA;&gt;    play only when a channel is under attack, and then not all transaction are&#xA;&gt;    allowed to go through.&#xA;&gt;    4.&#xA;&gt;&#xA;&gt;    Following this thread [3]: it is important to note that we are only&#xA;&gt;    giving reputation to our direct neighbours. An advantage of this is that we&#xA;&gt;    have repeated interactions with them. In practice, this is also the only&#xA;&gt;    clean data we have to use when deciding whether to forward an HTLC or not.&#xA;&gt;&#xA;&gt;&#xA;&gt; Best,&#xA;&gt;&#xA;&gt; Carla and Clara&#xA;&gt;&#xA;&gt;&#xA;&gt; [1]&#xA;&gt; https://lists.linuxfoundation.org/pipermail/lightning-dev/2022-November/003740.html&#xA;&gt; [2]&#xA;&gt; https://github.com/lightningnetwork/lnd/blob/de94a4ea5e81799330a72dfde111817b38565d99/htlcswitch/link.go#L51&#xA;&gt; [3]&#xA;&gt; https://lists.linuxfoundation.org/pipermail/lightning-dev/2023-February/003842.html&#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/20230302/47bf0566/attachment-0001.html&gt;</html></oembed>