- Used ZoKrates library to implement zkSNARK based authentication on EVM blockchain
- Prover can prove to smart contract verifier his knowledge of hash pre-image to authenticate himself
This is a simple example of how to use ZoKrates.js to generate a proof and verify it using the Groth16 verifier (OnChain - Solidity, OffChain).
npm install
Generate Prover and Verifier keys & Verifier Smart Contract
npm run setup
Generate Hash Values from password
and k
npm run generate-hash
Generate Proof
npm run proof
Verify Proof (OnChain)
npm run verify-onchain
Verify Proof (OffChain)
npm run verify-offchain