<oembed><type>rich</type><version>1.0</version><author_name>npub19helcfnqgk2jrwzjex2aflq6jwfc8zd9uzzkwlgwhve7lykv23mq5zkvn4</author_name><author_url>https://nostr.ae/npub19helcfnqgk2jrwzjex2aflq6jwfc8zd9uzzkwlgwhve7lykv23mq5zkvn4</author_url><provider_name>njump</provider_name><provider_url>https://nostr.ae</provider_url><html>📅 Original date posted:2018-05-07&#xA;📝 Original message:&#xA;Hi Pedro,&#xA;&#xA;Very cool stuff! When I originally discovered the Lindell&#39;s technique, my&#xA;immediate thought was the we could phase this in as a way to _immediately_&#xA;(no&#xA;additional Script upgrades required), replace the regular 2-of-2 mulit-sig&#xA;with&#xA;a single p2wkh. The immediate advantages of this would: be lower fees for&#xA;opening/closing channels (as the public key script, and witness are&#xA;smaller),&#xA;openings and cooperative close transactions would blend in with the&#xA;anonymity&#xA;set of regular p2wkh transactions, and finally the htlc timeout+success&#xA;transactions can be made smaller as we can remove the multi-sig. The second&#xA;benefit is nerfed a bit if the channel are advertised, but non-advertised&#xA;channels would be able to take advantage of this &#34;stealth&#34; feature.&#xA;&#xA;The upside of the original application I hand in mind is that it wouldn&#39;t&#xA;require any end-to-end changes, as it would only be a link level change&#xA;(diff&#xA;output for the funding transaction). If we wanted to allow these styles of&#xA;channels to be used outside of non-advertised channels, then we would need&#xA;to&#xA;update the way channels are verified in the gossip layer.&#xA;&#xA;Applying this to the realm of allowing us to use randomized payment&#xA;identifiers&#xA;across the route is obviously much, much doper. So then the question would&#xA;be&#xA;what the process of integrating the scheme into the existing protocol would&#xA;look like. The primary thing we&#39;d need to account for is the additional&#xA;cryptographic overhead this scheme would add if integrated. Re-reviewing the&#xA;paper, there&#39;s an initial setup and verification phase (which was omitted&#xA;from&#xA;y&#39;alls note for brevity) where both parties need to complete before the&#xA;actually signing process can take place. Ideally, we can piggy-back this&#xA;setup&#xA;on top of the existing accept_channel/open_channel dance both sides need to&#xA;go&#xA;through in order to advance the channel negotiation process today.&#xA;&#xA;Conner actually started to implement this when we first discovered the&#xA;scheme,&#xA;so we have a pretty good feel w.r.t the implementation of the initial set of&#xA;proofs. The three proofs required for the set up phase are:&#xA;&#xA;  1. A proof that that the Paillier public key is well formed. In the paper&#xA;  they only execute this step for the party that wishes to _obtain_ the&#xA;  signature. In our case, since we&#39;ll need to sign for HTLCs in both&#xA;  directions, but parties will need to execute this step.&#xA;&#xA;  2. A dlog proof for the signing keys themselves. We already do this more&#xA;or&#xA;  less, as if the remote party isn&#39;t able to sign with their target key,&#xA;then&#xA;  we won&#39;t be able to update the channel, or even create a valid commitment&#xA;in&#xA;  the first place.&#xA;&#xA;  3. A proof that value encrypted (the Paillier ciphertext) is actually the&#xA;  dlog of the public key to be used for signing. (as an aside this is the&#xA;part&#xA;  of the protocol that made me do a double take when first reading it:&#xA;using one&#xA;  cryptosystem to encrypt the private key of another cryptosystem in order&#xA;to&#xA;  construct a 2pc to allow signing in the latter cryptosystem! soo clever!)&#xA;&#xA;First, we&#39;ll examine the initial proof. This only needs to be done once by&#xA;both&#xA;parties AFAICT. As a result, we may be able to piggyback this onto the&#xA;initial&#xA;channel funding steps. Reviewing the paper cited on the Lindell paper [1],&#xA;it&#xA;appears this would take 1 RTT, so this shouldn&#39;t result in any additional&#xA;round&#xA;trips during the funding process. We should be able to use a Paillier&#xA;modulos&#xA;of 2048 bits, so nothing too crazy. This would just result in a slightly&#xA;bigger&#xA;opening message.&#xA;&#xA;Skipping the second proofs as it&#39;s pretty standard.&#xA;&#xA;The third proof as described (Section 6 of the Lindell paper) is&#xA;interactive.&#xA;It also contains a ZK range proof as a sub-protocol which as described in&#xA;Appendix A is also interactive. However, it was pointed out to us by Omer&#xA;Shlomovits on the lnd slack, that we can actually replace their custom range&#xA;proofs with Bulletproofs. This would make this section non-interactive,&#xA;allowing the proof itself to take 1.5 RTT AFAICT. Additionally, this would&#xA;only&#xA;need to be done once at the start, as AFIACT, we can re-use the encryption&#xA;of&#xA;the secp256k1 private key of both parties.&#xA;&#xA;The current channel opening process requires 2 RTT, so it seems that we&#39;d be&#xA;able to easily piggy back all the opening proofs on top of the existing&#xA;funding&#xA;protocol. The main cost would be the increased size of these opening&#xA;messages,&#xA;and also the additional computational cost of operations within the Paillier&#xA;modulus and the new range proof.&#xA;&#xA;The additional components that would need to be modified are the process of&#xA;adding+settling an HTLC, and also the onion payload that drops off the point&#xA;whose dlog is r_1*alpha. Within the current protocol, adding and settling an&#xA;HTLC are more or less non-interactive, we have a single message for each,&#xA;which&#xA;is then staged to be committed in new commitments for both parties. With&#xA;this&#xA;new scheme (if I follow it correctly), adding an HTLC now requires N RTT:&#xA;  1. Alice sends A = G*alpha to Bob. Here alpha is the payment secret.&#xA;  2. Bob sends R_3 = (G*alpha)*r_2 (along w/ a proof of knowledge of r_2 and&#xA;  relation to A)&#xA;  3. Alice sends R_3&#39; = (G*alpha)*r_3 (along with a similar proof as above)&#xA;4.&#xA;  Bob then computes c3 (the encrypted partial sig which when completed will&#xA;  reveal a) to Alice.&#xA;  5. Alice decrypts c3 to get the plaintext partial sig (s&#39;), then finalizes&#xA;  the set up by sending s&#39;&#39; to Bob.&#xA;&#xA;This process takes 2.5 RTT, and would require re-working the state machine&#xA;slightly to only actually commit an HTLC after step 5 has been completed.&#xA;When&#xA;Bob obtains a from the next party in the path, we Alice can then then over&#xA;the&#xA;signature, from which Alice can extract alpha. So adding HTLCs is now a bit&#xA;more interactive, but settling them is the same a before.&#xA;&#xA;Finally, the onion payload would need to be re-interpreted in order to&#xA;encode&#xA;G*alpha which takes 33 bytes. We can shave this down to 32 by selecting the&#xA;x&#xA;coordinate (at the sender) to always be either even or odd. Currently, we&#xA;have&#xA;12 unused bytes in the onion payload. The HMAC is currently 32 bytes. One&#xA;path&#xA;would be to allocate a portion of HMAC space to encoding this point. A&#xA;16-byte&#xA;HMAC would probably have been enough in the beginning, so we can drop down&#xA;to&#xA;that. However, that still leaves 4 bytes somewhere that has to give...one&#xA;could&#xA;either obtain these extra bytes from the CLTV and Amount fields, or just&#xA;have&#xA;each hop consume an extra payload. The latter path would mean that the new&#xA;upper hop limit is actually 10.&#xA;&#xA;However, given that we would need need a new global feature bit in order to&#xA;roll this out, it may make sense to re-work the onion format all together&#xA;which&#xA;would mean that we wouldn&#39;t need to hack the old format a bit to accommodate&#xA;this additional data. One aspect of introducing a new end-to-end contract&#xA;type&#xA;which I hadn&#39;t considered before is that each new type effectively&#xA;partitions&#xA;the network. This is due to the fact that these HTLCs will now only be able&#xA;to&#xA;be carried along paths that understand this new feature. As a result,&#xA;plausible&#xA;path diversity takes as we can no longer utilize all channels on the network&#xA;for routing. This would suggest that introducing new end to end contract&#xA;types&#xA;(if one wishes to use them widely across arbitrary channels and not for&#xA;specific contract protocols) may be a strong point of synchronization w.r.t&#xA;updates across the network. As a result, we may need to be a bit more&#xA;discerning w.r.t new candidates for e2e contracts given the coordination&#xA;costs.&#xA;&#xA;So the takeaways are:&#xA;  * we can probably piggy back the extra proofs onto the channel opening&#xA;    process&#xA;      * one of the subproofs can use bulletproofs to make the proof shorter&#xA;and&#xA;        also non-interactive&#xA;  * adding an HTLC would take 2.5 RTT&#39;s, but settling is just as quick as&#xA;    before&#xA;  * the onion payload would either need to be hacked, or extended to support&#xA;    packaging the point.&#xA;  * the utility of the scheme won&#39;t shine until all/most of the network&#xA;uses it&#xA;  * we could start w/ just the introduction of the OG 2PC scheme as a&#xA;multi-sig&#xA;    replacement&#xA;&#xA;&#xA;[1]: https://eprint.iacr.org/2011/494.pdf (section 3.3)&#xA;&#xA;-- Laolu&#xA;&#xA;&#xA;On Fri, Apr 27, 2018 at 11:42 AM Pedro Moreno Sanchez &lt;pmorenos at purdue.edu&gt;&#xA;wrote:&#xA;&#xA;&gt; Hello guys,&#xA;&gt;&#xA;&gt; as some of you already know, I am working on some cryptographic&#xA;&gt; constructions that might be of interest and useful for the Lightning&#xA;&gt; Network.&#xA;&gt;&#xA;&gt; Recently, I have come up with a scriptless version of the adaptor&#xA;&gt; signatures and the contract required in the Lighting Network using only&#xA;&gt; 2-party ECDSA signatures. The main advantage is that, instead of waiting&#xA;&gt; for Schnorr signatures to be deployed in Bitcoin so that Poelstra&#39;s&#xA;&gt; scriptless scripts can be used, I believe that this ECDSA-version of the&#xA;&gt; scriptless scripts can be directly applied today.&#xA;&gt;&#xA;&gt; Details are in the attached PDF. I am looking forward to hearing your&#xA;&gt; comments and suggestions.&#xA;&gt;&#xA;&gt; Cheers,&#xA;&gt; Pedro.&#xA;&gt;&#xA;&gt; _______________________________________________&#xA;&gt; Lightning-dev mailing list&#xA;&gt; Lightning-dev at lists.linuxfoundation.org&#xA;&gt; https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&#xA;&gt;&#xA;-------------- next part --------------&#xA;An HTML attachment was scrubbed...&#xA;URL: &lt;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20180507/32b51086/attachment-0001.html&gt;</html></oembed>