Skip to content

Latest commit

 

History

History
45 lines (22 loc) · 1.35 KB

README.md

File metadata and controls

45 lines (22 loc) · 1.35 KB

Zokrates demo app

CI/CD CodeQL

Running

make sure to install necessary dependencies

cd ./server && npm start

cd ./client && yarn start

About the app

Developed using Zokrates plugin for Remix IDE

1) Zok file

main.zok

 def main(private field firstNumber, private field secondNumber, field sum) -> (field):

    field result = if firstNumber + secondNumber == sum then 1 else 0 fi

    return result

2) Verifier smart contract

verifier.sol is available on Rinkeby test net at 0x600c3dC2568d97D85082bE1110f7a9dC52C2123C

Navigate to smart contract via Etherscan

3) Flow

Server on start compiles zok file, does a setup (creates a proving key and a verification key pair).

After User input data on client side and press Compute button, request to server is being send.

Server then does a computation and generates proof which sends back to client as a response.

Client then uses proof as an argument to call smart contract's verifyTx function and after a response from blockchain displays to User success or failed verification.