Reserved IP Address°C
01-22-2025
BSV
$53.15
Vol 41.27m
1.28%
BTC
$106254
Vol 94441.74m
3.86%
BCH
$448.46
Vol 247.34m
4.19%
LTC
$119.2
Vol 998.78m
0.78%
DOGE
$0.37
Vol 9104.24m
5.14%
Getting your Trinity Audio player ready...

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).

programmable-zero-knowledge-proofs-using-zk-snarks-part-3-1
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

https://www.youtube.com/watch?v=c_zAlkImgTU&feature=youtu.be

Recommended for you

Arkansas prohibits BTC miner’s operation near military facility
A military facility, as per the bill, includes a base, a hospital or clinic, or an arsenal; it seems to...
January 21, 2025
BTC miner Bit Digital acquires Montreal site, new client announced
Bit Digital has spent $23 million on the Montreal site, which it will customize to host a 5MW data center...
January 10, 2025
Advertisement
Advertisement
Advertisement