Zero-knowledge proof system for Starknet: Complete toolkit for generating, verifying, and deploying ZK proofs using Noir circuits, Barretenberg, and Garaga.
Kliver Privacy is a complete zero-knowledge proof infrastructure for Starknet that enables privacy-preserving session validation on-chain.
What it does:
- Generates zero-knowledge proofs using Noir circuits
- Deploys UltraHonk verifier contracts to Starknet
- Verifies proofs on-chain with real transactions
- Complete end-to-end workflow from circuit to verification
Successful deployment example:
- Sepolia Contract:
0x06a65b053fc92038862083f38d95898c3018d7860840e5548ec0cfcc2358128a - Explorer: View on Starkscan
- Status: Deployed & Verified
📁 Noir Circuit (circuits/generate-proof/)
↓ (generates proof + public inputs)
📄 Proof Files (target/proof, target/vk, target/public_inputs)
↓ (Garaga formats for Starknet)
🔗 Calldata (proof_calldata.txt)
↓ (sncast calls contract)
🏛️ Starknet Verifier Contract
↓ (returns verification result)
✅ On-Chain Verification Success!
| Component | Technology | Version |
|---|---|---|
| Circuit Compiler | Noir | 1.0.0-beta.6 |
| Proof System | Barretenberg (UltraHonk) | 0.86.0-starknet.1 |
| Contract Language | Cairo | 2.x |
| Verifier Generator | Garaga | Latest |
| Deployment | Starknet Foundry | Latest |
| Package Manager | Poetry | Latest |
# Install all required tools
python deploy_contract.py install-all
# Include local devnet (optional)
python deploy_contract.py install-all --with-devnetpython deploy_contract.py install-poetry # Install Poetry
python deploy_contract.py install-python # Install Python dependencies
python deploy_contract.py install-noir # Install Noir v1.0.0-beta.6
python deploy_contract.py install-bb # Install Barretenberg v0.86.0-starknet.1
python deploy_contract.py install-scarb # Install Scarb (Cairo)
python deploy_contract.py install-foundry # Install Starknet FoundryRequirements: Python 3.10+ and internet access.
The easiest way to deploy everything:
# Deploy contract + generate proof + verify on-chain
poetry run python deploy_contract.py deploy --environment qa --contract verifier
# Test complete verification workflow
poetry run python deploy_contract.py test-verification --environment qaThis will:
- Build and execute the Noir circuit
- Generate zero-knowledge proof
- Deploy verifier contract to Sepolia
- Generate calldata and verify on-chain
- Show successful verification results
For more control, use pipeline commands that group related steps:
# 1. Circuit & Proof Generation (Steps 1-4)
poetry run python deploy_contract.py build-proof-pipeline
# 2. Contract Deployment (Steps 5-7)
poetry run python deploy_contract.py deploy-verifier-pipeline --environment qa
# 3. On-Chain Verification (Steps 8-10)
poetry run python deploy_contract.py verify-pipeline --environment qa --use-invokeIf you want to execute each step individually:
# Step 1: Build the Noir circuit
poetry run python deploy_contract.py build-circuit
# Step 2: Execute circuit (generate witness)
poetry run python deploy_contract.py exec-circuit
# Step 3: Generate zero-knowledge proof
poetry run python deploy_contract.py prove-circuit
# Step 4: Generate verification key
poetry run python deploy_contract.py gen-vk# Step 5: Generate verifier contract
poetry run python deploy_contract.py gen-verifier
# Step 6: Compile verifier contract
poetry run python deploy_contract.py build-verifier
# Step 7: Deploy to Starknet
poetry run python deploy_contract.py deploy --environment qa --contract verifier# Step 8: Generate calldata for proof
poetry run python deploy_contract.py generate-calldata
# Step 9a: Verify proof on-chain (read-only call)
poetry run python deploy_contract.py verify-onchain --environment qa
# Step 9b: Execute proof verification transaction (creates TX on blockchain)
poetry run python deploy_contract.py invoke-onchain --environment qa
# Step 10: Complete verification test
poetry run python deploy_contract.py test-verification --environment qa| Flag | Description | Required |
|---|---|---|
--environment |
Environment (qa/dev/prod) | Yes |
--contract |
Contract name (verifier) | For deploy |
--skip-circuit |
Skip circuit build/prove steps | No |
--skip-vk |
Skip verification key generation | No |
--rpc-url |
Custom RPC URL | No |
--contract-address |
Specific contract address | For verification |
--use-invoke |
Create real transaction | For verify-pipeline |
--regenerate-proof |
Rebuild proof before test | For test-verification |
Edit deployment_config.yml for environment settings:
environments:
qa:
name: "Quality Assurance"
network: "sepolia"
rpc_url: "https://starknet-sepolia.public.blastapi.io/rpc/v0_8"
account: "qa"
prod:
name: "Production"
network: "mainnet"
rpc_url: "https://starknet-mainnet.public.blastapi.io/rpc/v0_8"
account: "kliver"verify-onchain: Read-only call, doesn't create transaction, free, instant responseinvoke-onchain: Creates real transaction on blockchain, costs gas, permanently recorded, returns TX hash
The Noir circuit implements session validation with zero-knowledge proofs.
Located in: circuits/generate-proof/src/main.nr
- Session Data: Verifies session with up to 40 interactions
- Hash Computation: Uses Poseidon2 to hash session interactions
- Range Validation: Ensures random keys are 10-digit numbers (1000000000-9999999999)
random_key: 64-bit random number (10 digits)expected_interactions_hash: Hash of session interactions
struct SessionInteraction {
id: Field,
sender: u8, // 0 or 1
message: Field,
}
struct SessionData {
session_id: Field,
interactions: [SessionInteraction; 40],
}- Validate random key is in valid range (10 digits)
- Compute Poseidon2 hash of all session interactions
- Verify computed hash matches expected hash
- Generate proof that above constraints hold
When verification succeeds, you'll see a response array:
Response: [0x0, 0x2, 0x3b9aca17, 0x0, 0x158a0b5b978d173ae46a249d400aef26, ...]
Decoded:
[0]0x0- Padding[1]0x2- Number of public inputs[2]0x3b9aca17 = 1000000023- Your random key[3]0x0- Padding[4-5]- Expected interactions hash (256-bit split into two 128-bit values)
# Start local Starknet devnet
make devnet
# Setup accounts
poetry run python deploy_contract.py prepare-accountscd app
bun install && bun run devpoetry run python deploy_contract.py install-all [--with-devnet]
poetry run python deploy_contract.py install-poetry
poetry run python deploy_contract.py install-python
poetry run python deploy_contract.py install-noir
poetry run python deploy_contract.py install-bb
poetry run python deploy_contract.py install-scarb
poetry run python deploy_contract.py install-foundrypoetry run python deploy_contract.py build-proof-pipeline
poetry run python deploy_contract.py deploy-pipeline --environment qa
poetry run python deploy_contract.py deploy-verifier-pipeline --environment qa
poetry run python deploy_contract.py verify-pipeline --environment qa
poetry run python deploy_contract.py verify-pipeline --environment qa --use-invoke# Circuit & Proof
poetry run python deploy_contract.py build-circuit
poetry run python deploy_contract.py exec-circuit
poetry run python deploy_contract.py prove-circuit
poetry run python deploy_contract.py gen-vk
# Contract Deployment
poetry run python deploy_contract.py gen-verifier
poetry run python deploy_contract.py build-verifier
poetry run python deploy_contract.py declare-verifier --environment qa
poetry run python deploy_contract.py deploy --environment qa --contract verifier
# Verification
poetry run python deploy_contract.py generate-calldata
poetry run python deploy_contract.py verify-onchain --environment qa
poetry run python deploy_contract.py invoke-onchain --environment qa
poetry run python deploy_contract.py test-verification --environment qaMissing proof files
# Generate proof first
poetry run python deploy_contract.py prove-circuitNo contract address found
# Deploy contract first
poetry run python deploy_contract.py deploy --environment qa --contract verifierTransaction fails with gas issues
# Add max-fee parameter
poetry run python deploy_contract.py invoke-onchain --environment qa --max-fee 1000000000000000Prerequisites missing
# Check what's missing
poetry run python deploy_contract.py deploy --environment qa --contract verifier
# Install missing tools
python deploy_contract.py install-allTo learn more about Kliver and our platform, visit:
Built with Noir, Barretenberg, Garaga, and Starknet