Skip to content

DHRUVCHARNE/zk-panagram

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ZK Panagram Project

ZK Panagram is a proof-of-concept zero-knowledge proof (ZKP) application demonstrating cryptographic proof verification on-chain. The project is NOT about proving pangrams in the traditional sense, but rather implements a simplified ZK circuit game where users submit a hash-based guess and generate a Honk proof that gets verified on-chain via ERC1155 NFT minting.

  • Verifier Contract Sepolia Address(Verifier.sol):here
  • Panagram Contract Sepolia Address(Panagram.sol):here

Technology Stack

Turborepo for Monorepo

Frontend Application (apps/my-app)

  • Framework: Next.js 14+ with App Router
  • Language: TypeScript + TSX
  • Styling: Tailwind CSS with custom gradient backgrounds
  • Web3 Integration:
    • Wagmi v2: Latest React hooks for Ethereum interaction
    • Viem: Low-level transaction building
    • Connectors: MetaMask, WalletConnect, Safe wallet
  • State Management: React Query (TanStack Query)
  • Proof Generation: Client-side in-browser proof creation

Zero-Knowledge Circuit (apps/circuit)

  • Language: Noir v1.0.0-beta.3 (DSL for ZK constraints)
  • Proof System: Aztec's Honk (Modern recursive proof system)
  • Backend: Barretenberg v0.82.2
  • Compilation: Nargo compiler (Noir compiler toolchain)

Smart Contracts (apps/contract)

  • Language: Solidity 0.8.24
  • Proof Verifier: HonkVerifier (Auto-generated from circuit)
  • Main Contract: Panagram.sol (ERC1155 + Honk verification)
  • Dependencies: OpenZeppelin contracts (access control, ERC1155)
  • Testing: Foundry (Forge for unit tests)

🔐 ZK Toolchain Version Requirements (Strict)

This project depends on a specific legacy Barretenberg backend and modern Noir JS bindings. ⚠️ Do NOT upgrade or downgrade any of these versions — proofs and verification will break.

📦 Required Versions

Component Version Purpose
Noir JS @noir-lang/noir_js@1.0.0-beta.3 Circuit execution in JS
Barretenberg JS @aztec/bb.js@0.82.2 Proof generation backend
Barretenberg CLI (bb) 0.82.2 VK + proof tooling
Nargo (Noir compiler) 1.0.0-beta.3 Circuit compilation

🛠 Installation Steps

1️⃣ Install JS Dependencies

Run inside apps/:

bun add @noir-lang/noir_js@1.0.0-beta.3
bun add @aztec/bb.js@0.82.2

2️⃣ Install Barretenberg CLI (bb v0.82.2)

mkdir -p ~/bb-0.82.2 && cd ~/bb-0.82.2

curl -L -o bb.tar.gz https://github.com/AztecProtocol/aztec-packages/releases/download/v0.82.2/barretenberg-amd64-linux.tar.gz
tar -xzf bb.tar.gz
chmod +x bb

echo 'export PATH="$HOME/bb-0.82.2:$PATH"' >> ~/.bashrc
source ~/.bashrc

Verify:

bb --version
# Expected: 0.82.2

3️⃣ Install Nargo v1.0.0-beta.3

mkdir -p ~/noir && cd ~/noir

curl -L -o nargo.tar.gz https://github.com/noir-lang/noir/releases/download/v1.0.0-beta.3/nargo-x86_64-unknown-linux-gnu.tar.gz
tar -xzf nargo.tar.gz
chmod +x nargo

echo 'export PATH="$HOME/noir:$PATH"' >> ~/.bashrc
source ~/.bashrc

Verify:

nargo --version
# Expected: 1.0.0-beta.3

✅ Final Version Check

Run:

bb --version
nargo --version

You must see:

bb version 0.82.2
nargo version = 1.0.0-beta.3

🚫 Do NOT

  • Upgrade bb to 3.x
  • Upgrade Noir beyond 1.0.0-beta.3
  • Mix other versions of @aztec/bb.js

This project relies on proof formats specific to these versions.

Releases

No releases published

Packages

 
 
 

Contributors