<oembed><type>rich</type><version>1.0</version><title>lisa neigut [ARCHIVE] wrote</title><author_name>lisa neigut [ARCHIVE] (npub1sp…s64t2)</author_name><author_url>https://yabu.me/npub1sprhp66c693av0c0n9had046hcdcckp2th25fnmphwstc5e4wg9qxs64t2</author_url><provider_name>njump</provider_name><provider_url>https://yabu.me</provider_url><html>📅 Original date posted:2020-02-10&#xA;📝 Original message:&#xA;I&#39;d like to propose that we add a second commitment requirement to the&#xA;PoDLE that JoinMarket uses, to limit the use of a commitment&#39;s validity to&#xA;be only between an initiator and a single peer. Otherwise you can enable&#xA;something I&#39;ll call the &#34;pouncing venus-flytrap attack&#34;[1].  Venus-flytrap&#xA;because they sit in wait for victims; pouncing because the venus-flytrap&#xA;then attacks other nodes using the provided fly/utxo bait.&#xA;&#xA;## The Attack&#xA;A malicious node sits and waits until another, honest, node initiates an&#xA;open with them. They wait until the honest initiator has sent them the&#xA;commitment and utxo proof. They then use the provided, non-blacklisted utxo&#xA;and commitment proof to attempt to open a channel with as many other nodes&#xA;as possible, simultaneously. They may either fail to respond or not fail&#xA;the original channel open. They fail every other open attempt,&#xA;simultaneously. Each of the nodes they&#39;ve griefed will blacklist the&#xA;provided UTXO; the honest initiator has now had their utxo blacklisted.&#xA;&#xA;## Mitigation&#xA;Have each initiator provide two commitments: one to the shared/global J&#xA;point and one to a point that is found from the hash of the non-initiating&#xA;node&#39;s node_id.[2]&#xA;&#xA;The global-point commitment is the one that is blacklisted; the node_id&#39;s&#xA;commitment prevents the other party from being able to re-use a commitment&#xA;in another channel, as they&#39;ll be unable to produce a valid commitment to&#xA;the point derived from the node_id of their victim (so the victim will know&#xA;the commitment has been re-used).&#xA;&#xA;This has implications for &#39;multi-channel opens&#39;, in that any node&#xA;initiating an open MUST provide at least one utxo of their own. This seems&#xA;like an acceptable limitation, imo.&#xA;&#xA;The protocol adjustments required for this are :&#xA;&#xA;- Add a second commitment to the TLV of `open_channel2`; two H2&#39;s, one for&#xA;the &#39;global J&#39; and one for the &#39;nodes J&#39;, with the global point commitment&#xA;always appearing first.&#xA;- The TLV type for the `tx_add_input` for the &#39;committed utxo&#39; will now&#xA;include an array of two `proof of dle&#39;s`, in commitment hash order.&#xA;&#xA;1. tlvs: `add_input_tlvs`&#xA;2. types:&#xA;    1. type: 1 (`proof_of_dle_array`)&#xA;    2. data:&#xA;        *[`2*proof_of_dle`]&#xA;&#xA;1. subtype (`proof_of_dle`)&#xA;        *[`64*byte`:`s||e`]&#xA;        *[`33*byte`:pubkey`]&#xA;        *[`33*byte`:pubkey2`]&#xA;&#xA;A node that provides a valid global point but an invalid &#39;local point&#39;&#xA;commitment should be immediately errored on and potentially blacklisted.&#xA;A failure of this type should *not* result in a blacklist of the global&#xA;commitment.&#xA;&#xA;[1] There&#39;s probably a better analogy here, but it&#39;s escaping me at the&#xA;moment.&#xA;[2] We reuse JoinMarket&#39;s NUMs point generation idea of appending a counter&#xA;to a hash until a valid positive-public key point is found, but without the&#xA;index.&#xA;&#xA;On Mon, Feb 10, 2020 at 5:11 PM lisa neigut &lt;niftynei at gmail.com&gt; wrote:&#xA;&#xA;&gt; Here&#39;s some thoughts I had on PoDLE&#39;s and lightning. An enormous&#xA;&gt; tip-of-the-hat is due to ZmnSCPxj for surfacing the work that JoinMarket&#xA;&gt; has done here already.&#xA;&gt;&#xA;&gt; - The initiating message (in the case of open channel, this would be&#xA;&gt; `open_channel2`) is extended to include an &#39;H2&#39; field in its TLV, a 32-byte&#xA;&gt; hash commitment to the P2 key.&#xA;&gt; - Only one H2 commitment is required.&#xA;&gt; - The `tx_add_input` message, as specified previously, is extended to an&#xA;&gt; include a TLV type. This must be present on the input addition that&#xA;&gt; corresponds with the UTXO used for the originally transmitted commitment&#xA;&gt; - The non-initiator SHOULD wait to send any `tx_add_input` messages of&#xA;&gt; their own until after receiving a `tx_add_input` message with a valid PoDLE&#xA;&gt; TLV extension.&#xA;&gt;&#xA;&gt; 1. tlvs: `add_input_tlvs`&#xA;&gt; 2. types:&#xA;&gt;     1. type: 1 (`proof_of_dle`)&#xA;&gt;     2. data:&#xA;&gt;         *[`64*byte`:`s||e`]&#xA;&gt;         *[`33*byte`:pubkey`]&#xA;&gt;         *[`33*byte`:pubkey2`]&#xA;&gt;&#xA;&gt; - If the proof is incorrect, the non-initiator MAY fail the transaction&#xA;&gt; collaboration or respond with `tx_complete`. There is no need for them to&#xA;&gt; publish the PoDLE.&#xA;&gt; - If the proof is correct, the non-initiator verifies that the commitment&#xA;&gt; (hash of pubkey2) has not been communicated to them via gossip.&#xA;&gt; - If the proof is not in their gossip store, the transaction collaboration&#xA;&gt; continues. It is considered &#39;safe&#39; for the non-initiator to send&#xA;&gt; `tx_add_input` to their peer.&#xA;&gt; - If the proof IS in their gossip store, the transaction collaboration&#xA;&gt; SHOULD reply with `tx_complete`. It is considered &#39;unsafe&#39; for the&#xA;&gt; non-initiator to send `tx_add_input`. (This allows errored/erroring&#xA;&gt; initiators to use blacklisted utxos, however it prevents them from privy to&#xA;&gt; any other nodes&#39; UTXO set.)&#xA;&gt; - The initiator MUST NOT remove the committed to UTXO from the&#xA;&gt; collaboration set.&#xA;&gt;&#xA;&gt; - If the transaction collaboration fails/is errored by the initiator,&#xA;&gt;     - the non-initiator SHOULD broadcast the original PoDLE commitment to&#xA;&gt; the gossip network.&#xA;&gt;     - the non-initiator MAY delay broadcast to allow the initiating node&#xA;&gt; to re-attempt the open.&#xA;&gt;&#xA;&gt; The gossip message for a PoDLE blacklist entry is as follows:&#xA;&gt;&#xA;&gt; 1. type: 259 (`podle_blacklist`)&#xA;&gt; 2. data:&#xA;&gt;     *[`signature`:`signature`]&#xA;&gt;     *[`32*byte`:`H2`]&#xA;&gt;     *[`point`:`node_id`]&#xA;&gt;     *[`u32`:`timestamp`]&#xA;&gt;&#xA;&gt; Note that the `node_id` is the id of the node that signs (and broadcasts)&#xA;&gt; the blacklisted PoDLE. h/t to ZmnSCPxj for the gossip construction.&#xA;&gt; The timestamp is added as a convenience for peers to trim/discard&#xA;&gt; blacklist participants as they wish depending on time/staleness.&#xA;&gt;&#xA;&gt; ## Some Notes:&#xA;&gt; - The JoinMarket protocol allows nodes to use any of a range of secondary&#xA;&gt; points for J. Since the lightning version of this allows blacklisted UTXOs&#xA;&gt; to still open channels, albeit without participation from the peer, it&#xA;&gt; seems unnecessary to allow for more than one valid J point. I&#39;d propose&#xA;&gt; fixing the J the same zero-index point used by JoinMarket. This reduces the&#xA;&gt; number of valid H2&#39;s that are available for any given utxo set, while also&#xA;&gt; keeping blacklisted H2&#39;s compatible with the blacklist set generated by&#xA;&gt; JoinMarket implementations.&#xA;&gt; - The blacklist originates from the &#39;non-initiating&#39; peer, and does not&#xA;&gt; reveal the offending node&#39;s id.&#xA;&gt; - Assuming that every node honestly participates in the blacklist, only&#xA;&gt; verified H2&#39;s will be submitted to the blacklist&#xA;&gt; - A malicious non-initiator can only prevent an honest initiator from&#xA;&gt; using the committed UTXO for collaborative transactions; they won&#39;t prevent&#xA;&gt; them from successfully initiating a one-sided transaction with honest peers.&#xA;&gt; - Only nodes that have at least one public channel will be able to&#xA;&gt; contribute to the public PoDLE blacklist. This means it&#39;s possible for a&#xA;&gt; malicious initiator to grief non-public nodes without much consequence,&#xA;&gt; however this requires the ability to send inbound messages to private&#xA;&gt; nodes, i.e. more likely for a close or splice interaction.&#xA;&gt; - As ZmnSCPxj has pointed out elsewhere, a malicious peer could broadcast&#xA;&gt; junk H2&#39;s; it is acceptable to rate-limit the number of PoDLE blacklists&#xA;&gt; generated by a peer.peer&#xA;&gt; - It is possible for a malicious peer to fail to relay their `H2` entries&#xA;&gt; in the blacklisted gossip set.&#xA;&gt; - Duplicate H2 gossip should replace older timestamped versions.&#xA;&gt; - Elsewhere we&#39;ve had a discussion/concern over floods of PoDLE blacklist&#xA;&gt; messages. It&#39;s possible for gossip message floods to originate from a&#xA;&gt; malicious peer; they also might signal an ongoing probe attempt. Given a&#xA;&gt; timestamp and a rough measure of the number of utxos&#39; currently outstanding&#xA;&gt; in the mempool, however, it should be possible to distinguish the two.&#xA;&gt;&#xA;&gt; ## Open Questions:&#xA;&gt; - Should PoDLE be required for every collaborative transaction (opens,&#xA;&gt; splices + closes), or only for opens? It seems reasonable to limit them&#xA;&gt; just to opens, as for all others you&#39;ll already have a shared UTXO with the&#xA;&gt; peer.&#xA;&gt; - Is fixing the generator point too restrictive? JoinMarket allows for a&#xA;&gt; range of acceptable NUMS (J) points (up to 256). The smaller the pool of&#xA;&gt; eligible J&#39;s, the smaller the pool of potential blacklisted PoDLE&#39;s (up to&#xA;&gt; no. NUMs * current utxo count). One upside to allowing a larger pool of J&#39;s&#xA;&gt; means that the same UTXO can be retried on failure. One downside to&#xA;&gt; allowing a pool of J&#39;s means that a single UTXO can be validly retried in a&#xA;&gt; probe attack against a variety of peers.&#xA;&gt;&#xA;&gt; On Thu, Jan 30, 2020 at 5:32 PM ZmnSCPxj &lt;ZmnSCPxj at protonmail.com&gt; wrote:&#xA;&gt;&#xA;&gt;&gt; Good morning darosior, ariard, niftynei, and list,&#xA;&gt;&gt;&#xA;&gt;&gt; &gt; We could also consider PoDLE as used in JoinMarket, which solves a&#xA;&gt;&gt; similar problem.&#xA;&gt;&gt; &gt;&#xA;&gt;&gt; https://gist.github.com/AdamISZ/9cbba5e9408d23813ca8#defence-2-committing-to-a-utxo-in-publicplaintext-at-the-start-of-the-handshake&#xA;&gt;&gt; &gt; Basically, a PoDLE commits to a UTXO, without being trivially grindable&#xA;&gt;&gt; from the UTXO set and also including a proof that the creator of the PoDLE&#xA;&gt;&gt; knows the secret key behind it.&#xA;&gt;&gt; &gt; It can later be opened to reveal which UTXO the opener allocated.&#xA;&gt;&gt; &gt; If the opener aborts (i.e. does not provide its signatures to the&#xA;&gt;&gt; funding transaction) then the acceptor can gossip the UTXO and the revealed&#xA;&gt;&gt; PoDLE as well to the rest of Lightning, so that the opener at least cannot&#xA;&gt;&gt; reuse the same UTXO to probe other potential acceptors.&#xA;&gt;&gt; &gt; (though, my understanding, there is no clear way to determine when we&#xA;&gt;&gt; can safely delete old PoDLEs: maybe each node can keep it around for a&#xA;&gt;&gt; month, which might be good enough to limit the practical ability of a snoop&#xA;&gt;&gt; to probe other nodes)&#xA;&gt;&gt; &gt; I believe JoinMarket also has solved the issue of allowing a UTXO to be&#xA;&gt;&gt; used at most N times (for example due to &#34;honest&#34; failures, such as&#xA;&gt;&gt; connectivity interruptions which might cause an abort of the protocol); I&#xA;&gt;&gt; think it involves appending a single byte to something that is hashed, and&#xA;&gt;&gt; ensuring its value is less than N, so that it can only be used from 0 to N&#xA;&gt;&gt; - 1 (and thus allow a UTXO to be used at most N times).&#xA;&gt;&gt; &gt;&#xA;&gt;&gt; &gt; Getting into contact with waxwing / Adam Gibson for this might be&#xA;&gt;&gt; useful to fill out how PoDLE works and so on; basically, I believe this&#xA;&gt;&gt; issue is a practically solved problem already for JoinMarket, though&#xA;&gt;&gt; waxwing may be able to provide a more nuanced opinion.&#xA;&gt;&gt;&#xA;&gt;&gt; I communicated with waxwing, and he said:&#xA;&gt;&gt;&#xA;&gt;&gt; * See also: https://joinmarket.me/blog/blog/poodle \[sic\].&#xA;&gt;&gt; * The counter I mentioned is implemented using the second generator point.&#xA;&gt;&gt;   * The PoDLE construction requires the standard base point `G`, and&#xA;&gt;&gt; another generator point `J`.&#xA;&gt;&gt;   * To create the generator point `J`, JoinMarket appends the counter&#xA;&gt;&gt; byte (the one used to limit N number of uses of the same UTXO) to `G`,&#xA;&gt;&gt; hashes it, then uses a coerce-to-point.&#xA;&gt;&gt; * PoDLE is sometimes called DLEQ elsewhere.&#xA;&gt;&gt; * There is no concrete answer on &#34;when to delete old PoDLE&#34;; JoinMarket&#xA;&gt;&gt; never deletes (though they might if throughput increases).&#xA;&gt;&gt; * Watermarks like `nLockTime`, `nSequence`, `nVersion` are currently&#xA;&gt;&gt; fixed values; JoinMarket sees no reason to change this since equal-valued&#xA;&gt;&gt; CoinJoins are otherwise obvious to chain analysis anyway.&#xA;&gt;&gt;   * But note: JoinMarket implements PayJoin, which is not otherwise&#xA;&gt;&gt; obvious onchain, and does indeed do anti-fee-sniping emulation for PayJoin.&#xA;&gt;&gt;   * JoinMarket also strives to make similar feerates across users.&#xA;&gt;&gt;&#xA;&gt;&gt; In any case, for myself, my thoughts are:&#xA;&gt;&gt;&#xA;&gt;&gt; * I observe that our use-case is quite similar to a PayJoin:&#xA;&gt;&gt;   * The opener proposes to make a payment (to a channel between the&#xA;&gt;&gt; opener and the acceptor, rather than outright giving control to the&#xA;&gt;&gt; acceptor as in PayJoin).&#xA;&gt;&gt;   * The acceptor adds some UTXOs which will contribute to the payment&#xA;&gt;&gt; output (i.e. the channel).&#xA;&gt;&gt;   * This probably does mean we want to later consider `nLockTime`&#xA;&gt;&gt; anti-fee-sniping as well in multi-funded channel opens.&#xA;&gt;&gt; * Speaking of multi-funded channel opens, it seems to me this interactive&#xA;&gt;&gt; tx construction mechanism as well can be later used for channel factories.&#xA;&gt;&gt;   * Similarly, PoDLE techniques would be useful as well to multi-funded&#xA;&gt;&gt; channel factories.&#xA;&gt;&gt; * It would probably be a good idea to share PoDLE format with JoinMarket&#xA;&gt;&gt; so we can share PoDLE with them (there could be bridges that share PoDLE&#xA;&gt;&gt; between a JoinMarket maker and a Lightning node, and each network already&#xA;&gt;&gt; has its own gossip protocols, so LN just needs a gossip protocol for&#xA;&gt;&gt; sharing PoDLEs as well).&#xA;&gt;&gt; * Probably we can mandate in some BOLT spec to retain PoDLE for at least&#xA;&gt;&gt; a year or a month or two weeks or so, which should be enough to slow down&#xA;&gt;&gt; probe attempts.&#xA;&gt;&gt;&#xA;&gt;&gt; Regards,&#xA;&gt;&gt; ZmnSCPxj&#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/20200210/f584936f/attachment-0001.html&gt;</html></oembed>