Skip to content

Repository files navigation

ProofPass

Reusable Zero-Knowledge Age Credentials on Stellar

ProofPass is a zero-knowledge identity validation and credential issuance protocol built for the Stellar network using Soroban smart contracts. It enables users to verify their age eligibility (e.g., proving they are at least 18 years old) using zk-SNARKs, and receive a secure, privacy-preserving, reusable on-chain credential without exposing their actual date of birth or age.


💡 The Problem

Traditional age verification processes (e.g., signing up for age-restricted services, token launches, or gating apps) require users to upload government IDs or enter their exact birthdate. This approach has critical drawbacks:

  1. Privacy Invasiveness: Service providers learn the user's exact age, full name, address, and document numbers.
  2. Centralized Data Storage: Storing sensitive personal identification information (PII) creates honeypots for hackers and data breaches.
  3. Friction: Users must undergo repetitive verification flows for every new application.

🛡️ The Solution

ProofPass solves this by decoupling eligibility verification from identity disclosure:

  • Zero-Knowledge Age Proof: Users generate a mathematical proof locally in their browser using a private input (their age) and a public policy input (the threshold, e.g., 18).
  • On-Chain Verification & Issuance: A Soroban smart contract validates the zk-SNARK proof. If valid, the contract issues an on-chain, reusable credential bound to the user's Stellar address.
  • Instant Verification: Other Web3 apps can query the contract instantly to check if the user is verified, removing the need for a secondary KYC/ID check.

⚙️ Architecture Flow

+------------------+          +------------------------+          +-------------------------+
|                  |          |                        |          |                         |
|   Private Input  | -------->|   Local zk-SNARK Proof | -------->|    Freighter Wallet     |
|   (User's Age)   |          |  (snarkjs in Browser)  |          |   (Transaction Sign)    |
|                  |          |                        |          |                         |
+------------------+          +------------------------+          +-------------------------+
                                                                               |
                                                                               v
+------------------+          +------------------------+          +-------------------------+
|                  |          |                        |          |                         |
|  Query & Verify  |<-------- |  On-Chain Credential   |<-------- |    Soroban Contract     |
|  (Other Web3)    |          |   (Stored on Ledger)   |          |  (Verify & Save State)  |
|                  |          |                        |          |                         |
+------------------+          +------------------------+          +-------------------------+

🛠️ Technology Stack

  • ZK Proving System: Circom (circuit logic) & SnarkJS (Groth16 proving/witness calculation in-browser).
  • Blockchain Ecosystem: Stellar & Soroban smart contract environment.
  • Smart Contract Logic: Rust, using the soroban-sdk and standard cryptographic pairing checks for BLS12-381.
  • Wallet Connection: Freighter wallet for Stellar transaction signing.
  • Frontend Web Application: React, Vite, CSS, and @stellar/stellar-sdk for transaction simulation, assembly (prepareTransaction), and submission.

📁 Repository Structure

PROOFPASS/
├── circuits/       # Circom source circuits (age_verifier.circom)
├── contract/       # Soroban verifier contract in Rust (contract/src/lib.rs)
├── proving/        # SNARK keys and proving inputs (zkey, wasm, input.json)
├── frontend/       # Vite + React Web Application
├── tools/          # Rust command-line tools for JSON-to-hex encoding
├── docs/           # Documentation, phase reviews, and screenshots
├── DEMO.md         # Detailed walkthrough script for judges
├── Cargo.toml      # Cargo workspace configuration
└── LICENSE         # MIT license

🚀 Quickstart & Development

1. Run the End-to-End Demo Script

Execute the integrated script to compile the contract, deploy to Testnet, generate a local proof, and verify on-chain:

./demo.sh

2. Run the React Web App Locally

Navigate to the frontend folder, configure variables, and launch the dev server:

cd frontend
cp .env.example .env
npm install
npm run dev

3. Check and Test Rust Contracts

Run cargo commands from the workspace root:

cargo check --workspace
cargo test --workspace

📝 Demo Procedure

To test all edge cases (happy path, underage rejection, and administrative authorization checks), see our step-by-step instructions in the DEMO.md file.

📄 License

This project is licensed under the MIT License — see the LICENSE file for details.

About

Decentralized identity protocol that generates zk-SNARK age proofs in-browser and issues secure, reusable on-chain credentials on Stellar without disclosing date of birth.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages