Sample Project
Usage of ZK-circuits
In the example/verify_js folder contains a JavaScript implementation of a verification system for zero-knowledge proofs. This folder is part of a larger project that aims to provide a secure and private way to verify the correctness of computations without revealing the underlying data.
Folder Structure
Directoryexample/verify_js/
- generate_witness.js
- input.json
- proof.json
- public.json
- verification_key.json
- verifier.sol
- witness_calculator.js
Key Components
1. generate_witness.js
This script generates a witness for a given input using the witness_calculator.js module.
2. input.json
This file contains the input data for the verification process.
3. proof.json
This file contains the proof generated by the generate_witness.js
script.
4. public.json
This file contains the public parameters for the verification process.
5. verification_key.json
This file contains the verification key used to verify the proof.
6. verifier.sol
This is a Solidity contract that verifies the proof on the Ethereum blockchain.
7. witness_calculator.js
This module calculates the witness for a given input.
Usage
To use the verification system, follow these steps:
- Run
node generate_witness.js
to generate a witness for the input data ininput.json
. - The generated witness is stored in
proof.json
. - Use the
verifier.sol
contract to verify the proof on the Ethereum blockchain.
Note: This is a high-level overview of the example/verify_js folder. For a more detailed explanation, please refer to the documentation and code comments within each file.