Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question / Idea: example to showcase "proof of having some secret" #1729

Open
grasphoper opened this issue Nov 1, 2024 · 0 comments
Open

Comments

@grasphoper
Copy link

grasphoper commented Nov 1, 2024

One of the commonly advertised use cases for ZKProofs is the following:
I can prove to you that I have some secret S, where f(S) = X, without revealing the secret to you.

Most of the examples in the examples/ directory showcase "proving a result of some computation, so that the verifier doesn't have to redo the calculation again".

On the secrets front, there's the rsa example which comes close to what I have in mind but is different. In the rsa example, inside of the "program" which is our provable computation, we do roughly the following:

let pk = read_public_key();
let sig = read_signature();
let msg = read_signed_msg();
let valid_sig = RsaVerifySig(pk, sig, msg);
sp1_zkvm::io::commit(&valid_sig);

However, one can check whether an RSA signature is valid without using ZKProofs. I think it'd be interesting to showcase the ability of ZKProof to not reveal anything secret through proving roughly the following:

let public_key = read_public_key();
let private_key = read_private_key();
let valid_pair = public_key.Eq(RsaGeneratePublicKey(private_key));
sp1_zkvm::io::commit(&valid_pair);

This way we could prove that we have access to a private_key without generating any signatures through RSA.

Thanks for reading through my issue, let me know what you think!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant