Proof of reserves - fhEVM + zk proofs

Hi, I need to create proofs of reserves for balances of a smart contract with fhEVM. These will ideally be ZK range proofs. Or these could be proof of knowledge of a simple value. What is the best language and library for the application to do so? Should it be a Node application with fhevmjs and making its own ZK proofs? Or should it be a Rust application with TFHE-rs also making its own ZK proofs? I thought it would be better to use Rust with TFHE-rs but I don’t know if TFHE-rs can access the values in the smart contract.

Hey,

Your question is not an easy one. Do you want to make proofs from the ciphertext or directly from the plaintext?

But, another way to look at this might be: if you want to prove that an encrypted value c corresponds to a plaintext m such that a < m < b, could you use directly the comparison operators (see Operations on encrypted types | fhEVM) on c? The boolean will be encrypted, however. It’s how we do ERC20 transfers, by checking if we have sufficient founds.