<oembed><type>rich</type><version>1.0</version><title>Joe Miyamoto Philips [ARCHIVE] wrote</title><author_name>Joe Miyamoto Philips [ARCHIVE] (npub1rx…rdmna)</author_name><author_url>https://yabu.me/npub1rxe6xx0tvp69u4ah8q7rl2v8yryawr9wv4zc2z2p59jupsdnnffslrdmna</author_url><provider_name>njump</provider_name><provider_url>https://yabu.me</provider_url><html>📅 Original date posted:2021-02-03&#xA;📝 Original message:&#xA;Hi all.&#xA;&#xA;&#xA;&#xA;I want to point out another application of Discrete-Log selling on PTLC&#xA;lightning since I could not find anyone else mentioning it (in particular,&#xA;I could not find in the Nadav Kohen&#39;s list here. [1] )&#xA;&#xA;&#xA;&#xA;The protocol may be obvious to most of the members here, but I believe its&#xA;application has some impact on the way people make anonymity-focused&#xA;applications with LN, so I want to have some feedback.&#xA;&#xA;&#xA;&#xA;In short, by using ElGamal encryption, we can sell not only a discrete-log&#xA;but also an elliptic curve point which satisfies some requirements. This&#xA;includes KVAC [2] which is used for WabiSabi [3] and Signal app [4].&#xA;&#xA;&#xA;&#xA;&gt; disclaimer: I&#39;m not a cryptography or math major, the following reasoning&#xA;might be wrong at the fundamental level. Please correct me if I&#39;m wrong.&#xA;&#xA;&#xA;&#xA;## Notations&#xA;&#xA;&#xA;&#xA;* G ... Elliptic curve base point.&#xA;&#xA;* H ... some additional NUMS&#xA;&#xA;* x, X = x * G ... secret and public key&#xA;&#xA;&#xA;&#xA;For ZKPoK, I will use Camenisch-Stadler like notation&#xA;&#xA;PK{ (secret values) : statements about secret values to prove. }&#xA;&#xA;e.g. For DLEQ proof. assume the verifier already have some points P_1, P_2&#xA;&#xA;PK{ (x, y) : P_1 =  x * G and P_2 = y * H and x = y }&#xA;&#xA;&#xA;&#xA;# Protocols&#xA;&#xA;&#xA;&#xA;## pay-for ElGamal decryption key&#xA;&#xA;&#xA;&#xA;Quick recap, ElGamal encryption for message M (= m * G) is&#xA;&#xA;(r * G, M + r * P)&#xA;&#xA;where r is some blinding factor and P is a shared secret (P = p * G)&#xA;&#xA;&#xA;&#xA;Imagine the Buyer knows some point (X_h = x * H), and he wants another&#xA;point (X_g  = x * G).&#xA;&#xA;The Seller knows x and he wants to sell the point X_g but he does NOT want&#xA;to reveal its discrete log x to the buyer.&#xA;&#xA;(There is not much of a situation like this, but I will explain it later.)&#xA;&#xA;&#xA;&#xA;In this case, the Seller can send its elgamal encryption and sell its&#xA;decryption key.&#xA;&#xA;Seller:&#xA;&#xA;* Generate ephemeral encryption key S = s * G&#xA;&#xA;* Encrypt X_g  with random blinding r ... (c1, c2) := (r * G, X_g + r * S)&#xA;&#xA;* Send (c1, c2) and S to the Buyer.&#xA;&#xA;* Also, send PK{(x, r, s) :  c1 = r * G and c2 = x * G + r * S and X_h = x&#xA;* H }&#xA;&#xA;&#xA;&#xA;Buyer&#xA;&#xA;* Verifies the ZKPoK, he can be sure that the plaintext will be X_g that he&#xA;wants.&#xA;&#xA;* Make a payment offer to the Seller with S.&#xA;&#xA;&#xA;&#xA;Seller&#xA;&#xA;* Receive the payment by revealing s&#xA;&#xA;&#xA;&#xA;Buyer&#xA;&#xA;* Decrypt the ciphertext by s to get the X_g ... (X_g := c2 - c1 * s)&#xA;&#xA;&#xA;&#xA;## Pay for Keyed Verification Anonymous Credential. (KVAC)&#xA;&#xA;&#xA;&#xA;We assume MAC_{GGM} scheme for the KVAC. [2]&#xA;&#xA;&#xA;&#xA;* attributes encoded in the credential is m_1, ... m_n&#xA;&#xA;* secret keys for the issuer=verifier is r, x_0, x_1, ... x_n&#xA;&#xA;* Public params for the issuer are (C_x0 = x_0 * G + r * H), (X_1 = x_1 *&#xA;G, ... X_n = x_n * G)&#xA;&#xA;&#xA;&#xA;The credential is of the form (U, U&#39;) where U&#39; = U * (x_0 + x_1 * m_1 + ...&#xA;+ x_n * m_n)&#xA;&#xA;&#xA;&#xA;Issuer:&#xA;&#xA;* get random point `U`&#xA;&#xA;* compute U&#39; = U * (x_0 + x_1 * m_1 + ... + x_n + m_n)&#xA;&#xA;* sends U and ElGamal encryption of U&#39; to the Buyer with blinding factor k&#xA;and ephemeral encryption key S.&#xA;&#xA;  * (c1, c2) = (k * G, U&#39; + k * S)&#xA;&#xA;* Also send ZKPoK to tell the ciphertext is for correct U&#39;&#xA;&#xA;  * PK{(x_0, ... x_n, x_0, r, k, s, U’) :  U&#39; = U * (x_0 + x_1 * m_1 + ...&#xA;+ x_n * m_n)  and  C_x0 = G * x_0 + H * r and X_1 = x_1 * G and ... and X_n&#xA;= x_n * G and  c1 = k * G and c2 = U&#39; + k * S }&#xA;&#xA;&#xA;&#xA;Then Buyer can buy s as the same as above.&#xA;&#xA;&#xA;&#xA;# Why this matters&#xA;&#xA;&#xA;&#xA;I believe that KVAC has great potential as a building block of anonymous&#xA;web apps.&#xA;&#xA;Its MAC-based construction is more performant and easy to prove the&#xA;security compared to the similar system for the PKI based anonymous&#xA;credentials (e.g. U-Prove [5] and ACL [6]).&#xA;&#xA;And it&#39;s a great fit for commercial purpose applications which do not have&#xA;to cooperate with other entities when defining the protocol. (Which is not&#xA;the case for an Attribute based credential system in general.)&#xA;&#xA;&#xA;&#xA;The reason so far it has not been used widely is, IMHO, it&#39;s because there&#xA;is no way to charge its users anonymously. [7]&#xA;&#xA;Another problem is Sybil attack. In general, the DoS protection is a great&#xA;concern for anonymous applications.&#xA;&#xA;So we need users to commit something &#34;scarce&#34; to prevent it.&#xA;&#xA;It is why Signal requires its users to register their telephone number&#xA;(Maybe I&#39;m wrong about this, not sure).&#xA;&#xA;(WabiSabi cleverly uses the user&#39;s UTXO as the scarce resource to mitigate&#xA;this problem.)&#xA;&#xA;&#xA;&#xA;And of course, these problems get fixed by LN, if users have to pay to get&#xA;their service, the service does not have to ban the users by DoS-ing&#xA;anymore. So I think the LN-based payment and KVAC-based app fits very well.&#xA;&#xA;&#xA;&#xA;Thus, if the service wants to grant some right to do something with their&#xA;server resource to users in an unlinkable fashion, then I believe&#xA;exchanging the credential in this way has a benefit.&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;Regards,&#xA;&#xA;&#xA;&#xA;Miyamoto.&#xA;&#xA;&#xA;&#xA; P.S. I may have sent the same mail with a different address. Please ignore&#xA;it.&#xA;&#xA;&#xA;[1]:&#xA;https://lists.linuxfoundation.org/pipermail/lightning-dev/2020-April/002647.html&#xA;&#xA;[2]: https://eprint.iacr.org/2013/516.pdf&#xA;&#xA;[3]: https://github.com/zkSNACKs/WabiSabi&#xA;&#xA;[4]: https://signal.org/blog/pdfs/signal_private_group_system.pdf&#xA;&#xA;[5]: https://www.microsoft.com/en-us/research/project/u-prove/&#xA;&#xA;[6]: https://core.ac.uk/download/pdf/193377167.pdf&#xA;&#xA;[7]: DuckDuckGo has an interesting solution for this. But it is not a&#xA;general solution for all kinds of apps and I doubt how good it works&#xA;compared to charging a fee by LN.&#xA;https://spreadprivacy.com/duckduckgo-revenue-model/&#xA;-------------- next part --------------&#xA;An HTML attachment was scrubbed...&#xA;URL: &lt;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20210203/3ec104bc/attachment-0001.html&gt;</html></oembed>