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