# How can I prove the preimage of a hash that contains a number is bigger than x?

So I want to create a zero-knowledge proving system for numbers (think loans and bank accounts, I want to prove my paycheck is more than x dollars per month).

I was thinking about using a zero-knowledge proof for the preimage of a hash. So let's say my employer hashes my paycheck in such a way (e.g. using merkle trees) that my net received is hashed individually. I can use a preimage proof to prove I know the preimage of the hash, but that does not get me anywhere. I want to prove the preimage of the hash is bigger than some set amount.

But that also is not very useful as I don't want to disclose the hash of my paycheck, because it's not difficult to hash all possible amounts (let's say 500.00-5000.00, that's only 450k options) and check if it's equal.

So what I thought about doing is append a random string to the amount, and hash that. Is there a way I can prove that a hash of a string containing a number is bigger than some amount? Or am I thinking about this the wrong way?

• Have you looked into range proofs: arxiv.org/abs/1907.06381? Jan 20, 2022 at 16:02
• My answer here crypto.stackexchange.com/questions/96232/… shows how to use a Pedersen Commitment instead of a hash, and how to create a Schnorr-ring-signature-based range proof that proves the commitment is greater than or equal to a certain value Jan 20, 2022 at 17:30