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