1
$\begingroup$

Can I use Zk-SNARKS to prove that a given secret value is greater than another public value. for Example to prove that secret_value >10 . if so How would such a circuit look

I am using snarks.js which uses circuit file .

$\endgroup$
2
$\begingroup$

Doing range proofs with the zk-snark used by z-cash (ie. the one implemented in snark.js) is not trivial, because it is meant for equations using arithmetic operations such as multiplication and addition. In order to determine if x is smaller than 10, boolean operations (such as XOR and NAND) are required, which is not easy to implement with basic arithmetic.

Luckly, there are zero knowledge proofs specifically catered towards range proofs. One such proof is called a bulletproof (current resources include a rust implementation, a haskell implementation, and this summary). Another one, specifically built for Ethereum is ING's zero knowledge range proof (current resources include a white paper and a Go implementation to be used with Geth)

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.