How vio1etus/zkcnn_complete works
Project Type and Purpose
• This is a C++ command‐line tool/library that implements zero‐knowledge proofs (GKR‐based) for convolutional neural network (CNN) inference (LeNet5, VGG11, VGG16, AlexNet).
• It bundles a core library (circuit construction, polynomial commitment, prover, verifier) plus demo executables and bash scripts to run end‐to‐end experiments.
File Structure Analysis
• Top level:
• 3rd/ ‐ submodule “hyrax‐bls12‐381” (polynomial commitment on BLS12-381)
• script/ ‐ bash wrappers to build and run demos (Lenet, VGG, AlexNet)
• src/ ‐ CMakeLists & source code:
– main_demo_*.cpp – entry points for each model
– neuralNetwork.* – constructs model layers & parameters
– circuit.* – encodes the CNN computation as an arithmetic circuit
– polynomial.* – low-level field/polynomial ops
– prover.* – “Prover” class uses circuit + commitment scheme
– verifier.* – “Verifier” class checks generated proof
– utils.*, global_var.hpp – I/O, parameter parsing, common definitions
– models.* – hard-coded network architectures (LeNet, VGG, AlexNet)
• Build: CMakeLists.txt files in root and src/
Architectural Insights from README
• Core pipeline:
1. Load image data and network weights
2. Build arithmetic circuit representing CNN inference
3. Commit to polynomials (via Hyrax commitment submodule)
4. Run Prover to generate zero‐knowledge proof of correct inference
5. Optionally run Verifier to check proof
• Demo scripts automate (build → run demo → log outputs)