<oembed><type>rich</type><version>1.0</version><title>Lloyd Fournier [ARCHIVE] wrote</title><author_name>Lloyd Fournier [ARCHIVE] (npub1kh…y05yp)</author_name><author_url>https://yabu.me/npub1khlhcuz0jrjwa0ayznq2q9agg4zvxfvx5x7jljrvwnpfzngrcf0q7y05yp</author_url><provider_name>njump</provider_name><provider_url>https://yabu.me</provider_url><html>📅 Original date posted:2021-01-04&#xA;📝 Original message:&#xA;Happy New Year Lightning Developers,&#xA;&#xA;I&#39;ve recently been closely looking at the dual funding proposal [1] because&#xA;it uses a DLEQ proof (PoDLE) which we are also working on specifying as&#xA;part of DLC ECDSA adaptor signatures [2].&#xA;While reading it I had some queries and ideas that I thought were worth&#xA;sharing (even though they are very very late).&#xA;&#xA;# Background&#xA;&#xA;Lisa posted a draft proposal [1] which includes the PoDLE and explained it&#xA;in [3] along with a good list of its weaknesses.&#xA;The original discussion thread where the idea was conceived is [4] and&#xA;there is an excellent summary in the following optech [5] which I post&#xA;below:&#xA;&#xA;&gt; Another proposal was to use PoDLE, which was originally developed for&#xA;JoinMarket based on a suggestion by Gregory Maxwell. This protocol allows&#xA;an initiating user such as Mallory to commit to a UTXO in a way that&#xA;prevents anyone from identifying that UTXO. The participating user, such as&#xA;Bob, publishes the commitment across the network (e.g. the JoinMarket&#xA;network) so that nobody else will start a session with Mallory while she’s&#xA;using that particular UTXO. Then Bob asks Mallory to identify her UTXO and,&#xA;if it’s a valid UTXO that matches her commitment, Bob discloses his UTXO to&#xA;Mallory so that they can proceed with the protocol (e.g. a coinjoin). If&#xA;Mallory aborts the protocol before completion, the commitment previously&#xA;published across the network prevents her from being able to start a new&#xA;session with any other user and so learn their UTXO. Mallory’s only option&#xA;is to spend her coins from herself to herself in order to generate a new&#xA;UTXO—a process that costs her money and so limits her ability to spy on&#xA;users. (Note, though, that PoDLE as implemented in JoinMarket allows&#xA;Mallory up to three retries by default so honest users aren’t penalized for&#xA;occasional accidental failures, such as a loss of network connectivity.)&#xA;The idea is to adapt this protocol for LN in order to prevent attackers&#xA;from learning which available UTXOs are controlled by LN users.&#xA;&#xA;Especially relevant to this post is the idea posted by Darosior here [6]&#xA;which was summarized as follows:&#xA;&#xA;&gt; One proposal to fix this would require the person proposing to open the&#xA;channel (e.g. Mallory) to provide their UTXO(s) in a ready-to-spend state&#xA;so that probing would cost money (e.g. transaction fees). A downside of&#xA;this approach is that the construction proposed would be easily&#xA;identifiable by block chain analysis, making it easy to determine when a&#xA;dual-funded channel was opened&#xA;&#xA;The goals of this post is to (i) see if I understand the PoDLE idea&#xA;correctly, to (ii) refine Darosior&#39;s idea and to (iii) propose a minimal&#xA;alternative idea.&#xA;&#xA;#  Requirements&#xA;&#xA;Informally, here are the desirable properties I came up with for a dual&#xA;funding protocol:&#xA;&#xA;1. If a malicious initiator learns a peer UTXO, then the initiator should&#xA;have to spend their UTXOs before reusing them against the next peer (should&#xA;be forced to spend them to repeat attack -- *if attacking sequentially*).&#xA;2. A malicious initiator should not be able to use the same UTXOs in&#xA;parallel with multiple peers (to learn the UTXOs of multiple makers with a&#xA;single UTXO).&#xA;3. An honest initiator should not have to spend their UTXOs if they execute&#xA;with a malicious peer.&#xA;4. dual-funded opening transactions should not have any distinguishing&#xA;features (i.e. sighash flags).&#xA;5. An honest but intermittently failing initiator should not have their&#xA;UTXO details sent by an honest peer to other parties.&#xA;&#xA;Note I am going to ignore property (2) because of proposals below can turn&#xA;their protection against sequential attacks (1) into protection against&#xA;parallel attacks (2) by having the peer choose a random time delay and see&#xA;if anything is gossiped to them that would indicate malicious behavior by&#xA;the initiator in some other channel.&#xA;&#xA;# PoDLEs&#xA;&#xA;To solve this problem in JoinMarket, Waxwing had the idea [8] of turning&#xA;knowledge of a secret key for a particular UTXO into a kind of unlinkable&#xA;credential.&#xA;Given a UTXO public key P1, the initiator projects their private key onto a&#xA;different generator J to produce P2.&#xA;P2 is unlinkable to P1 (without a proof) but is fully determined by P1.&#xA;This allows participants to maintain a blacklist of P2s without learning&#xA;the P1s.&#xA;Having the P1s in the blacklist would make the blacklist itself useful for&#xA;chain analysis because it contains a list of UTXOs that tried to open&#xA;channels (but perhaps accidentally failed).&#xA;&#xA;The idea is like this:&#xA;1. Taker asks some maker&#39;s if they want to do a coinjoin and sends them all&#xA;SHA256(P2)&#xA;2. When they find the maker they want to proceed with they reveal P2 and&#xA;prove DLEQ((P1, G), (P2, J)) i.e. P1 and P2 have the same private key just&#xA;different base points.&#xA;3. If they haven&#39;t received SHA256(P2)from the gossip network (i.e. it&#39;s&#xA;not in the blacklist), the maker then sends their own UTXO data AND gossips&#xA;SHA256(P2)&#xA;4. They carry on the protocol.&#xA;&#xA;The current lightning proposal [1] follows the same logic except that it&#xA;only gossips SHA256(P2) in case of malicious behavior (this seems sensible).&#xA;If I understood it correctly, then it achieves properties (1,4,5).&#xA;&#xA;The main downside is that it introduces a new gossip message. The&#xA;difficulties associated with this are listed in [3].&#xA;Notably it is missing property (3) - protection against malicious peers who&#xA;gossip SHA256(P2) even when there was no wrongdoing.&#xA;&#xA;A question I have is why is SHA256(P2) sent up front? I think that P2 can&#xA;just be sent along with the proof later on in the case of dual funding.&#xA;Waxwing gave an explanation of it in the case of joinmarket in [7] but I&#xA;didn&#39;t grasp it.&#xA;&#xA;# Darosior&#39;s SIGHASH_SINGLE|SIGHASH_ANYONECANPAY&#xA;&#xA;The proposal from Darosior [6] is to have the taker provide their inputs in&#xA;a ready to broadcast state using SIGHASH_SIGNLE|SIGHASH_ANYONECANPAY.&#xA;This way the peer never needs to send their inputs directly to the&#xA;initiator (the initiator will only find out about them when the transaction&#xA;is broadcast).&#xA;I encourage the reader to look at [6] which has nice diagrams and is very&#xA;short and to the point.&#xA;This achieves all properties except for (4 - distinguishable on-chain)&#xA;which is why it was dismissed.&#xA;&#xA;I think it is possible to extend the idea to achieve (4) and therefore&#xA;obtain all desired properties.&#xA;Simply put peers can just use the SINGLE|ANYONECANPAY signature as back ups&#xA;in case of abort. Here&#39;s how it could work in my mind:&#xA;&#xA;1. Initiator requests dual-funding and provides a TX_temp spending their&#xA;input set to a main output and a change output (does not sign it yet). They&#xA;also provide a sighash SIGNLE|ANYONECANPAY signature on the main output&#xA;spending into TX_backup-fund and a signature on the first commitment&#xA;transaction spending from TX_backup-fund (exactly as in [6]).&#xA;2. Peer responds with commitment TX signature for TX_backup-fund.&#xA;3. Initiator responds with the signatures for TX_temp.&#xA;*Peer now has a fully functional transaction chain with which to open the&#xA;channel -- now they can attempt to upgrade to a SIGHASH_ALL opening*.&#xA;4. Peer (if possible) checks there are no existing transactions in the&#xA;chain or mempool spending from the taker&#39;s inputs. If not it responds with&#xA;its inputs, change and commitment tx signature for a SIGHASH_ALL TX_fund.&#xA;5. Initiator responds with commitment TX signature and TX_fund input&#xA;signatures.&#xA;6. Peer broadcasts TX_fund.&#xA;*If at any point after step 3 Initiator does not respond for ~2 seconds&#xA;they broadcast TX_temp and TX_backup-funding*&#xA;&#xA;We have (4) because the SINGLE|ANYONECANPAY signature only appears on-chain&#xA;in case of abort (i.e. TX_backup-funding makes it on-chain).&#xA;It appears to be pretty close to the ideal solution in terms of privacy and&#xA;security.&#xA;If the malicious initiator learns an output they will always have to spend&#xA;one of their inputs otherwise they will quickly get hit by the TX_temp +&#xA;TX_backup-funding.&#xA;Note that it is possible the node is just slow in which case even if step&#xA;TX_backup-funding makes it in both parties should just carry on with the&#xA;channel.&#xA;&#xA;The downsides are that it involves six rounds of communication and cannot&#xA;use the &#34;interactive tx building&#34; protocol developed for the original&#xA;proposal&#xA;&#xA;# Signaling Transactions&#xA;&#xA;Finally I present a simple but unintuitive protocol that achieves roughly&#xA;the same properties as the PoDLE protocol but without lightning gossip&#xA;messages.&#xA;&#xA;Whenever the initiator adds an input in the interactive tx building they&#xA;provide signatures on a &#34;signaling&#34; transaction spending that input (and&#xA;any inputs they have added so far).&#xA;The signaling transactions will typically spend the funds back to the&#xA;initiator&#39;s wallet.&#xA;Before revealing any of their inputs, the peer checks that none of the&#xA;inputs added by the initiator are in their mempool/chain.&#xA;If the initiator aborts the protocol after learning one of the peer&#39;s&#xA;inputs the peer broadcasts one of the signaling transactions.&#xA;&#xA;Like the PoDLE proposal this doesn&#39;t achieve (3) since a malicious peer&#xA;could broadcast the signaling transaction making the honest initiator pay a&#xA;transaction fee before using the input in another session.&#xA;To mitigate this a bit, the transactions could be RBF and have a 1&#xA;sat-per-byte feerate to give the initiator a decent amount of time to use&#xA;their input productively before the tx confirms (and paying a low fee if it&#xA;ever does confirm).&#xA;&#xA;The advantages of signaling transactions over PoDLE is that it doesn&#39;t&#xA;involve any wonky crypto or new gossip messages.&#xA;The advantage of the PoDLE proposal over this is that a malicious peer can&#xA;only blacklist the UTXO (not necessarily force you to spend it).&#xA;&#xA;# Summary&#xA;&#xA;The preference of protocol depends on how you weigh the importance of a&#xA;malicious non-initiating peer griefing the initiator.&#xA;To protect fully, the extended version of Darosior&#39;s protocol does not&#xA;allow griefing.&#xA;There is always a lot to be said for ruling out a class of attack even if&#xA;it costs you a few rounds of communication.&#xA;&#xA;Is griefing a real concern though? Layer-2 is full of opportunities to&#xA;grief your counterparty and the ones presented here are hardly the worst.&#xA;If you&#39;re opening channels with someone who wants to grief you, you are&#xA;already in trouble.&#xA;PoDLEs have very weak griefing in the form of unfairly adding your UTXO to&#xA;the blacklist but comes at the cost of complexity and a few difficult to&#xA;answer questions.&#xA;I think the simplicity of signaling transactions may be worth the extra&#xA;griefing capabilities it offers a malicious peer given they are hardly as&#xA;bad as the griefing capabilities they will have if you open a channel to&#xA;them!&#xA;&#xA;Cheers,&#xA;&#xA;LL&#xA;&#xA;[1] https://github.com/niftynei/lightning-rfc/pull/1&#xA;&lt;https://github.com/lightningnetwork/lightning-rfc/pull/524&gt;&#xA;[2] https://github.com/discreetlogcontracts/dlcspecs/pull/114&#xA;[3]&#xA;https://lists.linuxfoundation.org/pipermail/lightning-dev/2020-February/002516.html&#xA;[4]&#xA;https://lists.linuxfoundation.org/pipermail/lightning-dev/2020-January/002466.html&#xA;[5]&#xA;https://bitcoinops.org/en/newsletters/2020/02/05/#interactive-construction-of-ln-funding-transactions&#xA;[6]&#xA;https://lists.linuxfoundation.org/pipermail/lightning-dev/2020-January/002475.html&#xA;[7]&#xA;https://lists.linuxfoundation.org/pipermail/lightning-dev/2020-February/002522.html&#xA;[8] https://joinmarket.me/blog/blog/poodle/&#xA;-------------- next part --------------&#xA;An HTML attachment was scrubbed...&#xA;URL: &lt;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20210104/08adc787/attachment.html&gt;</html></oembed>