Skip to content

mhasan08/groth16-core

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Groth16-Core

A minimal, modular implementation of a Groth16 zkSNARK verifier in Python, compatible with snarkjs-generated artifacts, with a working example based on an autonomous driving stop-sign scenario.


🚀 Overview

This project is part of a step-by-step effort to rebuild Groth16 from scratch, starting from the verifier and progressing toward a full prover implementation.

Current status:

  • ✅ Groth16 verifier (Python, BN128)
  • ✅ Compatible with snarkjs artifacts
  • ✅ Modular structure (types, parser, verifier)
  • ✅ Example: stop-sign autonomous driving scenario
  • ✅ Unit tests (positive + negative cases)

🧠 What is implemented

The verifier performs:

  • Parsing of:
    • verification_key.json
    • proof.json
    • public.json
  • Construction of the linear combination:

Project structure

.
├── cleanup.py
├── examples
│   └── hermes_stop_sign
│       ├── proof.json
│       ├── public.json
│       ├── run_verify.py
│       └── verification_key.json
├── groth16_core
│   ├── __init__.py
│   └── verifier
│       ├── __init__.py
│       ├── parser.py
│       ├── types.py
│       └── verifier.py
├── Makefile
├── README.md
└── tests
    └── test_verifier.py

▶️ Running the Example

From the repository root:

PYTHONPATH=groth16-core python groth16-core/examples/hermes_stop_sign/run_verify.py

Output

result: True
result with tampered public input: False

Running Test

PYTHONPATH=groth16-core pytest -q

Tests

About

Modular Groth16 verifier in Python with snarkjs compatibility, tests, and real-world example.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors