I am looking to implement the zk-SNARK capabilities of Ethereum to allow a user to prove that they have all the components required ('a', 'b', 'c', 'd') to create a publicly known hash 'x'. My general problem can be defined as:
def main(x):
sha3(a, b, c, d) == x
return 1
I understand that there are two options to use when it comes to converting this general form program into a QAP and subsequent verification: ZoKrates (https://github.com/JacobEberhardt/ZoKrates) and libsnark (https://github.com/scipr-lab/libsnark).
Would anyone be able to help in guiding me through the steps to convert this into a workable piece of code:
- Constructing the circuit either using ZoKrates or libsnark
- Generating the proving and verifying key
- Generating proofs
- Verify the proof in Solidity
The documentation / practical examples are fairly limited so will appreciate any help that can be given.