Skip to content
/ ZKP Public

Circom circuits, zkSNARK proof system, and Solidity verifiers for ChainElect’s zero-knowledge voting system.

Notifications You must be signed in to change notification settings

ChainElect/ZKP

Repository files navigation

🗳️ ZKP Voting System – ChainElect

This repository contains the zero-knowledge proof (ZKP) components of the ChainElect decentralized voting system. It includes Circom circuits, setup scripts, and utilities for compiling, proving, and verifying votes while preserving voter privacy.


🔐 Overview

ChainElect leverages Zero-Knowledge Proofs to enable anonymous, tamper-proof voting. This repo focuses on the cryptographic logic and infrastructure used to:

  • Generate zkSNARK circuits (using Circom)
  • Compile and export proof and verifier logic
  • Enable on-chain and off-chain vote verification

📁 Repo Structure

  • circuits/ – Circom files (e.g. vote.circom)
  • inputs/ – Sample JSON input files
  • proofs/ – Generated proofs and public signals
  • scripts/ – Shell/JS scripts for compilation & proof generation
  • verifier/ – Solidity verifier contracts
  • keys/ – ZKey files and trusted setup artifacts

⚙️ Getting Started

🔧 Prerequisites


🧪 Compile & Generate Proof

# Compile the circuit
circom circuits/vote.circom --r1cs --wasm --sym -o build/

# Generate trusted setup
snarkjs groth16 setup build/vote.r1cs powersOfTau28_hez_final_10.ptau keys/vote_0000.zkey

# Contribute to phase 2 (optional)
snarkjs zkey contribute keys/vote_0000.zkey keys/vote_final.zkey --name="Your Name"

# Export verifier
snarkjs zkey export solidityverifier keys/vote_final.zkey verifier/VoteVerifier.sol

# Generate a proof
snarkjs groth16 prove keys/vote_final.zkey inputs/input.json proofs/proof.json proofs/public.json

# Verify the proof
snarkjs groth16 verify verification_key.json proofs/public.json proofs/proof.json

About

Circom circuits, zkSNARK proof system, and Solidity verifiers for ChainElect’s zero-knowledge voting system.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published