I am thinking of building a game on the Ethereum network and I stumbled on a problem, that is it is generally hard to hide information on that platform. So I have heard of ZK-SNARKS in relation to ZCash so I thought this would be a good place to ask a question I have.
So what I am trying to do goes as follows:
I have a function that takes a list of parameters, call it f(x1,x2,x3,…). It is supposed to be a complex function, in that it should be hard to predict how the value changes when you change one of the parameters. Now I want to hide this function, so computing it on the blockchain is out of the question. But I still want to minimise the trust needed in this game, so I thought of the following scheme:
- Publish a proof of the form: “there exists a function f, and it hashes (in some encoding) to the value h”, before the game begins.
- Then every time the function is used, publish a proof like "the function that hashes to h has value y for input list (x1,x2,x3,…).
- When the game ends, reveal f so that anyone can verify that it indeeds hashes to h.
So my question is: is this even possible? If so, any resource recommendation for implementing this?