{"type":"rich","version":"1.0","title":"Gleb Naumenko [ARCHIVE] wrote","author_name":"Gleb Naumenko [ARCHIVE] (npub1fl…94tkz)","author_url":"https://yabu.me/npub1fldyzvpmt2yx6a4tu8asjpkrrn0xy3daht37549g7yzlrm65l7dsq94tkz","provider_name":"njump","provider_url":"https://yabu.me","html":"📅 Original date posted:2020-11-27\n📝 Original message:\nThank you for your interest :)\n\n\u003e Quick question: if I am a routing node and receive a valid stake certificate, can I reuse this stake certificate on my own outgoing payments?\n\nThat probably should be avoided, otherwise a mediocre routing node gets a lot of jamming opportunities for no good.\n\nYou are right, that’s a strong argument for proof “interactivity”: every Certificate should probably commit to *at least* public key of the routing node it is generated for.\n\n– gleb\nOn Nov 27, 2020, 2:16 AM +0200, ZmnSCPxj \u003cZmnSCPxj at protonmail.com\u003e, wrote:\n\u003e Good morning Gleb and Antoine,\n\u003e\n\u003e This is certainly interesting!\n\u003e\n\u003e Quick question: if I am a routing node and receive a valid stake certificate, can I reuse this stake certificate on my own outgoing payments?\n\u003e\n\u003e It seems to me that the proof-of-stake-certificate should also somehow integrate a detail of the current payment (such as payment hash/point) so it cannot be reused by routing nodes for their own outgoing payments.\n\u003e\n\u003e For example, looking only at your naive privacy-broken proposal, the signature must use a `sign-to-contract` where the `R` in the signature is actually `R' + h(R' | payment_hash)` with the `R'` also revealed.\n\u003e\n\u003e Regards,\n\u003e ZmnSCPxj\n\u003e\n\u003e \u003e Hello list,\n\u003e \u003e\n\u003e \u003e In this post, we explore a different approach to channel jamming mitigation.\n\u003e \u003e We won’t talk about the background here, for the problem description as well as some proposed solutions (mainly upfront payment schemes), see [1].\n\u003e \u003e\n\u003e \u003e We’re suggesting using UTXO ownership proofs (a.k.a. Stake Certificates) to solve this problem. Previously, these proofs were only used in the Lightning Network at channel announcement time to prevent malicious actors from announcing channels they don’t control. One can think of it as a “fidelity bond” (as a scarce resource) as a requirement for sending HTLCs.\n\u003e \u003e\n\u003e \u003e We start by overviewing issues with other solutions, and then present a naive, privacy-broken Stake Certificates. Then we examine designing a privacy-preserving version, evaluating them. At the end, we talk about non-trivial design decisions and open questions.\n\u003e \u003e\n\u003e \u003e ## Issues with other proposals\n\u003e \u003e\n\u003e \u003e We find unsatisfying that upfront payment schemes come at a cost of new fees (forward and/or backward), thus inflating payment cost for *any* payment.\n\u003e \u003e In the future, the upfront base fee might even make “micropayments” economically infeasible by exceeding the value they transfer. Thus, a good solution should not inflate payment cost while still requiring “burning” a scarce resource (so that the attack is not free).\n\u003e \u003e\n\u003e \u003e Another issue with upfront payments is a circular trust dependency. Ideally, we shouldn’t introduce anything less trust-minimized than the Lightning Network itself.\n\u003e \u003e Upfront payment schemes are not like that, because they in one way or another rely on the honest behavior of route participants.\n\u003e \u003e\n\u003e \u003e We believe Stake Certificates we are going to introduce are satisfactory in both of these directions: they don’t inflate payment costs for honest users and don’t require trust. The main disadvantage of Stake Certificates seems to be the novel cryptography required.\n\u003e \u003e See more details in the “Evaluation” section.\n\u003e \u003e\n\u003e \u003e ## Channel Ownership Proofs as Routing Credit Balance\n\u003e \u003e\n\u003e \u003e Let’s say Alice wants to relay an HTLC to Carol through Bob. Per the Stake Certificates scheme, she has to commit to a particular channel UTXO by embedding an ownership proof in the onion packet while sending an HTLC to Bob.\n\u003e \u003e\n\u003e \u003e Bob then unwraps the onion and verifies:\n\u003e \u003e 1) the channel identifier is pointing unambiguously to an on-chain UTXO;\n\u003e \u003e 2) the ownership proof (e.g., a signature) is valid against the previously disclosed UTXO witness script.\n\u003e \u003e\n\u003e \u003e If all those checks succeed, Bob should see if Alice hasn’t exceeded her credit balance. In case she hasn’t, Bob has to “decrement Alice’s credit balance” and relay the HTLC to Carol.\n\u003e \u003e Decrementing credit balance unconditionally of packet success or failure bounds liquidity abuse by malicious HTLC senders.\n\u003e \u003e Since there is no credit assigned initially, “decrementing the credit balance” means just remembering that “Alice spent X out of Y of the credit she received for her Stake Certificates”.\n\u003e \u003e\n\u003e \u003e Unfortunately, this naive protocol is a privacy nightmare, because routing nodes can now easily assign every HTLC they forward to the sender’s UTXO.\n\u003e \u003e\n\u003e \u003e Let’s first define the terms here one more time, and then proceed to the non-naive, private Stake Certificates.\n\u003e \u003e\n\u003e \u003e - Stake Certificate. Either means a solution we’re proposing or the primitive it is based on, namely proof of UTXO ownership. As we will argue later, it actually makes sense to use proof of LN channel UTXO ownership specifically rather than any funds ownership.\n\u003e \u003e - Stake Certificate value. An amount of the corresponding UTXO or a ballpark this amount provably  belongs to.\n\u003e \u003e - Credit balance. When Alice provides a routing node Bob with a Stake Certificate, Bob should increase Alice’s routing credit balance. Alice is then limited in her payments by this balance, and this rule is enforced by routing nodes to prevent free channel jamming in the network. Note that ideally “Alice’s credit balance“ should be virtual and only known to Alice, while routing nodes should only observe per-UTXO credit balance. We currently assume that each routing node keeps track of per-UTXO credit balance separately, see “Design decisions” for more details.\n\u003e \u003e - Stake-to-credit function defines how much credit balance is given per a Stake Certificate of a given value. This function is a policy of a routing node, and it should be announced.\n\u003e \u003e - Credit-to-value-transferred function defines how much value a sender can transfer along a given channel considering how much credit they might claim. The function may also consider different factors (e.g., the available capacity of a channel being used) to provide extra robustness.\n\u003e \u003e\n\u003e \u003e ## Privacy-preserving Stake Certificates\n\u003e \u003e\n\u003e \u003e The presented scheme could preserve privacy if it relied on zero-knowledge proofs of UTXO ownership by avoiding pointing to a particular UTXO.\n\u003e \u003e More specifically, the verifier should be able to check that:\n\u003e \u003e a) The staked UTXO is an element of the current UTXO set\n\u003e \u003e b) The prover knows the witness script committed by the UTXO witness program\n\u003e \u003e c) The prover knows a valid witness for the witness script\n\u003e \u003e d) The staked UTXO was not used to produce a different Stake Certificate which is currently in use as well.\n\u003e \u003e\n\u003e \u003e The verifier should also have a way to see a Stake Certificate value to properly account for the credit. This can be achieved by restricting the UTXO set being proved upon to only those UTXOs with a specific range of values: “I will prove that I own a UTXO among all UTXOs between 0.5 BTC and 1 BTC”.\n\u003e \u003e\n\u003e \u003e Unfortunately, steps (b) and (c) require zero-knowledge protocols for general statements, which are more experimental primitives than most of the stuff we have in Bitcoin protocols,\n\u003e \u003e although we assume it’s feasible to consider them for non-consensus stuff.\n\u003e \u003e\n\u003e \u003e ## Evaluation\n\u003e \u003e\n\u003e \u003e Stake Certificates, upfront payment schemes, and other potential solutions (given a particular configuration) may be compared along the following axis:\n\u003e \u003e 1) Economic feasibility\n\u003e \u003e 1a) What is the cost of overcoming the protection for an attacker? Likely a non-linear function: sats_spent =f(channels_to_jam, […])\n\u003e \u003e 1b) How does this solution limit honest users?\n\u003e \u003e 2) How sophisticated is this solution in terms of integration and making good UX?\n\u003e \u003e 3) How complex is this solution in terms of protocol design/implementation?\n\u003e \u003e\n\u003e \u003e When it comes to (1a), both Stake Certificates and upfront payments are probably equal, in a way that they’re just best-effort ideas to increase the attack cost. Unfortunately, we currently don’t know how to design something as economically powerful as PoW in Bitcoin [3].\n\u003e \u003e This aspect can be properly evaluated by applying these ideas to different hypothetical kinds of LN in a simulation and observing the resulting trade-off between (1a) and (1b) considering different attack strategies.\n\u003e \u003e\n\u003e \u003e In the previous sections of this post, we have argued that Stake Certificates may provide a much better (1b) for the cost of (3) because it relies on zero-knowledge.\n\u003e \u003e When it comes to (2), the design of Stake Certificates may vary in terms of UX burden, from completely automatic to requiring custom actions with private keys from users.\n\u003e \u003e\n\u003e \u003e Some of these trade-offs along with other interesting questions are discussed in the following section.\n\u003e \u003e\n\u003e \u003e ## Design decisions and questions\n\u003e \u003e\n\u003e \u003e #### Should the credit spending be gossipped across the entire network, or should only the routing nodes involved in the payment know?\n\u003e \u003e\n\u003e \u003e Economically, these two approaches are likely to be equivalent, and it’s just a matter of stake-to-credit ratio.\n\u003e \u003e However, announcing credit spending to the network results in a privacy leak. It also imposes bandwidth and CPU overhead on the routing nodes.\n\u003e \u003e\n\u003e \u003e #### Which zero-knowledge system should be used for Stake Certificates?\n\u003e \u003e\n\u003e \u003e Choosing a ZK system boils down to picking the right trade-offs of proving and verifying time, and assumptions. As we mentioned previously, we would need proving general statements.\n\u003e \u003e At the same time, we need something cheap in both proving and verification, because Lightning is supposed to be fast.\n\u003e \u003e At the same time, the setup probably doesn’t matter, because proofs are supposed to be verified only by one participant, a routing node this proof is generated for.\n\u003e \u003e Perhaps we can also pick any cryptographic assumptions we want since this stuff is not mission-critical and can be easily updated if someone breaks a cryptographic assumption and we observe an attack.\n\u003e \u003e\n\u003e \u003e #### Should we allow holding *any* Bitcoins (not just LN channels) for Stake Certificates?\n\u003e \u003e\n\u003e \u003e This idea might make sense if we’re worried that some LN users might want to send more payments than they can afford per their credit. However, we believe that allowing any UTXO would give an attacker more opportunities to use their cold funds for this attack, or even have a secondary market where holders sell their proofs (they have nothing to loose).\n\u003e \u003e Instead, we should a) design the credit-to-stake-functions better; b) encourage users send payments across different routing nodes (since credits are not tracked globally) [4].\n\u003e \u003e\n\u003e \u003e #### What’s the best credit-to-value-transferred function?\n\u003e \u003e\n\u003e \u003e We reckon that this function should be not just linear to provide maximum security against malicious channel jammers. For example, we can charge more credit for the last 20% of the capacity of the *channel used for routing*. Alternatively, we could discourage making too many payments from the same UTXO within a short period of time by charging more credit in this case.\n\u003e \u003e\n\u003e \u003e #### What about the interactivity and lifetime of Stake Certificates?\n\u003e \u003e\n\u003e \u003e Interactive proofs mean that they are constructed on demand of a routing node, non-interactive means constructed by a payment sender ahead of time.\n\u003e \u003e Both interactivity and lifetime have something to do with the ease of producing proof and accessing keys.\n\u003e \u003e We will omit the details of the trade-off we consider, but it remains an open question.\n\u003e \u003e\n\u003e \u003e #### If Stake Certificates are valid for N blocks after proof generation, does it mean that if the UTXO is spent during those N blocks, new proof can be generated from the same coins without invalidating the old proof?\n\u003e \u003e\n\u003e \u003e Yes, but an attacker would, first of all, have to pay an on-chain fee for this. If we’re still worried about this problem, there are workaround ideas.\n\u003e \u003e For example, we could have epochs of 100 blocks (every epoch starts at #XYZXYZ00 block). If at the start of an epoch, a channel wasn’t in the UTXO set, it provides very little credit.\n\u003e \u003e Alternatively, we could expand the zero-knowledge part to proving that the coins were not yet spent.\n\u003e \u003e\n\u003e \u003e #### Should spending a UTXO reveal all Stake Certificates generated from it?\n\u003e \u003e\n\u003e \u003e This would also solve the problem in the previous question, but it would mean a retrospective privacy leak again. To avoid a privacy leak, we should prevent this.\n\u003e \u003e\n\u003e \u003e #### What if malicious Sybil *routing* nodes failing payments causing other honest routing nodes to reduce the credit of an honest payment sender?\n\u003e \u003e\n\u003e \u003e Both Stake Certificates and upfront payment schemes suffer from malicious routing nodes failing the payments and “wasting” the sender’s credit or fees. This problem even applies out of the channel jamming context, when considering payment failure rate.\n\u003e \u003e This problem can be addressed by reducing the reputation of faulty links and routing nodes on the payment sender node. When payment routing becomes a for-profit activity, this would encourage routing nodes to sanitize their links.\n\u003e \u003e The mitigation can be even stronger by using “provable blaming” introduced in [2].\n\u003e \u003e\n\u003e \u003e ## Conclusion\n\u003e \u003e\n\u003e \u003e We propose Stake Certificates, a new solution to channel jamming. Perhaps, it might not be the best near-term solution due to the complexity, but the zero satoshi overhead for honest payments is an appealing argument to switch to it in the future.\n\u003e \u003e This proposal also illustrates how stake-based protocols can solve Sybil challenges in the Bitcoin ecosystem. Since this might be useful in other contexts (Sybil-resistance of many kinds, proof-of-ownership), discussing Stake Certificates is even more useful.\n\u003e \u003e The next step is a discussion of Stake Certificates. If the community finds it interesting, then we should discuss the design questions mentioned above, and choose a cryptosystem.\n\u003e \u003e\n\u003e \u003e Cheers,\n\u003e \u003e Gleb Naumenko and Antoine Riard\n\u003e \u003e\n\u003e \u003e ———\n\u003e \u003e\n\u003e \u003e References and footnotes:\n\u003e \u003e 1. https://github.com/t-bast/lightning-docs/blob/master/spam-prevention.md\n\u003e \u003e 2. https://lists.linuxfoundation.org/pipermail/lightning-dev/2015-August/000135.html\n\u003e \u003e 3. We don’t actually suggest PoW to solve these issues, because a) the trade-off between honest user cost and attacker cost is misaligned due to specialized hardware and b) smartphones would die too fast if they have to compute PoW; PoW is just an unreachable example of system robustness due to well-aligned game theory.\n\u003e \u003e 4. Secondary markets are still possible even if we restrict acceptable proofs to only LN channels, but supply would be much smaller, and markets would work much worse for an attacker.\n\u003e\n\u003e\n-------------- next part --------------\nAn HTML attachment was scrubbed...\nURL: \u003chttp://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20201127/b8659b5f/attachment-0001.html\u003e"}
