Skip to content

mhasan08/zk-AV

Repository files navigation

Hermes’ Seal: Zero-Knowledge Assurance for Autonomous Vehicle Communications

This repository presents a zero-knowledge proof (zk-SNARK) framework for verifiable AV perception, implemented using the Groth16 proving system.


🚀 Quick Start

1. Environment Setup

conda create -n zkav python=3.11
conda activate zkav
pip install -r requirements.txt
pip install -e .

2. Install ZK tools

npm install -g snarkjs

3. Test Installation

python -c "import zkav; print(zkav.__file__)"
python -c "from zkav import load_config; print(load_config('configs/demo.json'))"

4. Generate/Test Cryptographic Keys

python scripts/generate_keys.py
python test_crypto.py

5. Run End-to-End Demo

python -m zkav.cli roundtrip --config configs/demo.json --verbose

Example Output

2026-03-26 09:40:18,655 | DEBUG | zkav | Command [witness-generation] finished in 54.90 ms
2026-03-26 09:40:19,210 | DEBUG | zkav | Command [proof-generation] finished in 290.48 ms
2026-03-26 09:40:19,684 | DEBUG | zkav | Command [proof-verification] finished in 225.33 ms
{
  "generation": {
    "status": "success",
    "stage": "generation",
    "detection": {
      "class_name": "stop sign",
      "probability": 0.783,
      "bbox": [1284, 647, 1343, 704]
    },
    "timing_ms": {
      "witness_generation": 54.896,
      "proof_generation": 290.479
    },
    "packet_file": "packet.cbor"
  },
  "verification": {
    "proof_verified": true,
    "signature_verified": true,
    "packet_integrity_ok": true,
    "elapsed_ms": 225.33,
    "detail": "Proof verification succeeded."
  }
}

6. Generate Proof

python -m zkav.cli generate --config configs/demo.json --verbose

Example Output

2026-03-26 10:23:28,497 | DEBUG | zkav | Command [witness-generation] finished in 52.90 ms
2026-03-26 10:23:29,073 | DEBUG | zkav | Command [proof-generation] finished in 298.13 ms
{
  "generation": {
    "status": "success",
    "stage": "generation",
    "detection": {
      "class_name": "stop sign",
      "probability": 0.783,
      "bbox": [
        1284,
        647,
        1343,
        704
      ]
    },
    "timing_ms": {
      "witness_generation": 52.90,
      "proof_generation": 298.13
    },
    "packet_file": "packet.cbor"
  }
}

7. Verify Proof

python -m zkav.cli verify --config configs/demo.json --verbose

Example Output

2026-03-26 10:26:39,760 | DEBUG | zkav | Command [proof-verification] finished in 219.73 ms
{
  "verification": {
    "proof_verified": true,
    "signature_verified": true,
    "packet_integrity_ok": true,
    "elapsed_ms": 219.728169997938,
    "detail": "Proof verification succeeded."
  }
}

8. Cleanup

python scripts/clean.py

Example Output

🧹 Cleaning project artifacts...

[REMOVE FILE] input.json
[REMOVE FILE] proof.json
[REMOVE FILE] public.json
[REMOVE FILE] packet.cbor
[REMOVE EXT] build/witness.wtns
[REMOVE CACHE] src/zkav/__pycache__

✅ Cleanup complete.

About

Verifiable autonomous vehicle perception using zk-SNARKs (Groth16) with cryptographic integrity and privacy guarantees.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors