I've asked that question on some places, got a few answers but I'm still missing the bigger piece. I'd like to experiment with zk-snarks. In particular, I'd like to be able to do something similar to this tutorial, i.e., write a program to prove some computation based on a pair of public and secret values, such as:
function senderFunction(x, w) {
return (
w.senderBalanceBefore > w.value &&
sha256(w.value) == x.hashValue &&
sha256(w.senderBalanceBefore) == x.hashSenderBalanceBefore &&
sha256(w.senderBalanceBefore - w.value) == x.hashSenderBalanceAfter
)
}
var proof = zksnarkprove(
confTxSenderPk,
senderFunction,
[hashSenderBalanceBefore, hashSenderBalanceAfter, hashValue],
[senderBalanceBefore, senderBalanceAfter, hashValue]);
And then be able to verify the correctness of this computation without knowing w
from inside an Ethereum contract, for example:
zksnarkverify(
confTxSenderVk,
[hashSenderBalanceBefore, hashSenderBalanceAfter, hashValue],
zkProofSender)
Is there anything already implemented that allows me to experiment with this usage?