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