Global News Hubb
Advertisement Banner
  • Home
  • Politics
  • Finance
  • Technology
  • Contact
No Result
View All Result
  • Home
  • Politics
  • Finance
  • Technology
  • Contact
No Result
View All Result
Wellnessnewshubb
No Result
View All Result
Home Technology

Programmable zero knowledge proofs using zk-SNARKs: part 3

admin by admin
August 3, 2022
in Technology


This post was first published on Medium.

ZK Key-Statement Proof

Previously, we have showed how to construct zero-knowledge proof (ZKP) for the following statement, using a technique called ZK Key-Statement Proof (ZKKSP).

Key Statement with Hashing

Basically, it proves not only the prover knows a secret key to a given public key, but also the secret hashes to a given digest, without leaking the secret.

programmable-zero-knowledge-proofs-using-zk-snarks-part-3-2
Credit: CoinGeek

Although ZKKSP works, it has a severe limitation: it only works for one specific form of statement, i.e., a secret is the private key of a given public key, and it is also the preimage of a given hash. It is unclear how to extend it to a slightly modified statement, say, the secret is also an even number, besides being a private key and preimage. Furthermore, coming up with it requires patent-level knowledge of cryptography, such as ∑-protocol and commitment schemes.

ZKKSP using zkSNARKs

We reimplement ZKKSP by leveraging the programmability of zkSNARKs. We simply combine elliptic curve point multiplication used in Part 2 and hashing library. The resulting Circom code is listed below:

key_stmt.circom

As before, we use ECDSAPrivToPub to derive a public key at Line 15 from the private key at Line 14 (note it is declared private). Then we hash the same private key using Sha256 from sha256 library imported at Line 3, to ensure the result matches the given hash at Line17. We have just “programmed” ZKKSP, no prior knowledge of advanced cryptography required. In addition, we can easily extend it to add constraints on the secret, e.g., being even, thanks to the composability of zkSNARKs.

A test can be found here.

Watch: The BSV Global Blockchain Convention presentation, Smart Contracts and Computation on BSV

New to Bitcoin? Check out CoinGeek’s Bitcoin for Beginners section, the ultimate resource guide to learn more about Bitcoin—as originally envisioned by Satoshi Nakamoto—and blockchain.



Source link

Previous Post

Lifestyle branding for financial services

Next Post

‘Better for democracy’: Two US cities offer Arabic voting ballots | Elections News

Next Post

‘Better for democracy’: Two US cities offer Arabic voting ballots | Elections News

Recommended

Chinese municipal bank issues first digital yuan loan holding IP as collateral

7 days ago

From al-Shabab to the cabinet: Somalia’s move fuels debate | Al-Shabab News

2 weeks ago

© 2022 Global News Hubb All rights reserved.

Use of these names, logos, and brands does not imply endorsement unless specified. By using this site, you agree to the Privacy Policy.

Navigate Site

  • Home
  • Politics
  • Finance
  • Technology
  • Contact

Newsletter Sign Up.

No Result
View All Result
  • Home
  • Politics
  • Finance
  • Technology
  • Contact

© 2022 JNews - Premium WordPress news & magazine theme by Jegtheme.