sudiptab2100 / zkSNARK-Auth-JS

zk-SNARK (Groth16) based authentication for EVM smart contracts.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

zkSNARK Authentication

  • 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

Groth16 Verifier & Proof Generator (ZoKrates.js)

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).

Installation

npm install

Usage

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

About

zk-SNARK (Groth16) based authentication for EVM smart contracts.


Languages

Language:JavaScript 100.0%