0xPolygonZero/plonky2

Examples for adding private inputs

drewstone opened this issue · 3 comments

I am unsure how to leverage private inputs in plonky2 circuits. It seems all the examples deal primarily with public input SNARKs. Is there any example that is purely zero-knowledge?

Hi - any luck here? Thank you.

Maybe if the inputs are not registered as public, the default is to private?

https://polymerlabs.medium.com/a-tutorial-on-writing-zk-proofs-with-plonky2-part-i-be5812f6b798

Is there any example that is purely zero-knowledge?

The zero-knowledge property is orthogonal to the statement you want to prove. Proving "The Keccak preimage of foo is bar" is different from "I know the Keccak preimage of foo". In the latter, you do not reveal the preimage but convince the verifier you indeed know it.

You can have a look at the square root example at plonky2/examples/square_root.rs, which deals with something in the lines of the latter example. We prove there that we know a square root of a value which is a public input, but the square root isn't known by the verifier.