abcd5251 / zk-SNARK_calculator

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

zk-SNARK calculator program

Create simple zk-SNARK calculator program to interact with Ethereum smart contracts

Preparation

Ethereum wallet address
Download Zokrate from https://github.com/Zokrates/ZoKrates/releases
Make sure path of stdlib is right
Switch to the Ropsten Test Network and claim some ETH airdrop to your address

Usage

./zokrates.exe compile -i id.zok  

Perform the setup phase

# Skip this step if you have proving.key and verify.key  
./zokrates.exe setup  

Compute Witness

./zokrates.exe compute-witness -a "Your Address"

Generate a proof of computation

./zokrates.exe generate-proof

Export a solidity verifier

# Skip this step if you have verifier
./zokrates.exe  export-verifier

Then you can use your proof.json and your verifier.abi to interact with Ethereum smart contracts by Remix to prove that you have done the calculation using your wallet address.

About