WIP
Fiat-Shamir dark alchemy implemented in Solidity as a way for users to provide proofs of secret offchain knowledge without sending hashes vulnerable to dictionary attacks. Instead of a trusted setup ceremony as with a zk-snark, the "zk-niro" users derive proofs with a secret random nonce and and public random challenge from the contract during each proof verification.
For concrete example see test
FiatShamirZKP.registerSeed()
function.FiatShamirZKP.getChallenge()
FiatShamirZKP.verify()
. (At no point is x or v sent to the contract)The proof works because:
gr yc = g v-cx (gx)c
= gv-cx gxc
= gv-cx+cx
= gv
Currently the library works well within the confines of solidity's 256 bit word sizes. This is ok for the purposes of research and experimentation, however it is more desirable to have a smart contract system that plays well with very large primes. Fortunately, new iterations of the EVM have included opcodes that map to bignumber precompile operations (mod, expmod, etc.) and there has been some research and development integrating these functions into solidity.
How To Prove Yourself: Practical Solutions to Identification and Signature Problems
Special thanks to Professor Bill Buchanan, OBE