Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
52 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Solstice Protocol

Zero-knowledge identity verification on Solana - Privacy-preserving authentication using Aadhaar infrastructure

Solana License Status

Executive Summary

Solstice Protocol transforms government-issued identity credentials into portable, privacy-preserving zero-knowledge proofs that can be verified across any Web3 application. By leveraging India's Aadhaar (1.4B users) and Solana's high-performance blockchain, Solstice achieves 5000x cost reduction compared to traditional on-chain identity systems while maintaining cryptographic security and regulatory compliance.

** Now Live on Devnet**: Fully functional with camera QR scanning, automatic proof generation, and on-chain verification!

Architecture: Challenge-Response Flow

Solstice uses a challenge-response architecture to protect user privacy:

  1. Identity Registration (once): Users register in the main Solstice app by scanning their Aadhaar QR code
  2. Challenge Generation: Third-party apps create verification challenges (e.g., "prove you're 18+")
  3. User Response: Users scan challenges with the Solstice app, which generates ZK proofs
  4. Verification: Third-party apps verify proofs without ever seeing personal data

Key Insight: Users NEVER share their Aadhaar data with third-party apps. Only cryptographic proofs are exchanged.

Key Achievements

  • Deployed on Solana Devnet - Program ID: 8jrTVUyvHrL5WTWyDoa6PTJRhh3MwbvLZXeGT81YjJjz
  • Camera QR Scanning - Real-time detection at ~60fps
  • Automatic Proof Generation - All 3 proofs in ~5 seconds
  • IndexedDB Storage - Client-side proof caching with 7-day expiration
  • Full Documentation - Testing guide, contributing guide, API docs

Quick Start (2 Minutes)

# 1. Clone and install
git clone <your-repo-url>
cd SolsticeProtocol

# 2. Install dependencies
cd backend && npm install
cd ../frontend && npm install
cd ../circuits && npm install

# 3. Setup database
createdb solstice_protocol
psql -d solstice_protocol -f backend/db/schema.sql

# 4. Configure environment
cp backend/.env.example backend/.env
# Edit backend/.env and frontend/.env with your settings

# 5. Start servers (2 terminals)
# Terminal 1:
cd backend && node src/index.js

# Terminal 2:
cd frontend && npm run dev

# 6. Open browser
open http://localhost:5173/

Full Setup Guide: See TESTING_GUIDE.md for comprehensive instructions.

Documentation

Key Innovation

Self-Sovereign Identity on Solana: Solstice brings browser-based, privacy-preserving identity verification to Solana's ecosystem. Users scan their mAadhaar QR code once, and the system automatically generates all necessary zero-knowledge proofs locally in their browser—no personal data ever leaves their device.

Core Features

Privacy-First Architecture

  • All ZK proof generation occurs in-browser using snarkjs
  • Personal identity data never transmitted to servers or blockchain
  • Cryptographic commitments stored on-chain, not raw data
  • Users maintain full control over their identity proofs

Automatic Proof Generation

  • Single QR scan generates three proofs: Age, Nationality, and Uniqueness
  • Proofs cached locally for 7 days for instant verification
  • Total generation time: ~5 seconds for all three proofs
  • No manual proof generation required per dApp

Light Protocol Integration

  • 5000x cost reduction through ZK compression
  • Compressed Merkle trees for efficient state management
  • Poseidon hashing optimized for zero-knowledge circuits
  • Nullifier-based Sybil resistance

Production-Ready Verification

  • Groth16 proof system with BN254 elliptic curves
  • On-chain verification in Solana smart contracts
  • 256-byte compressed proofs for minimal storage
  • Sub-second verification times

Seamless User Experience

  • No complex wallet interactions required
  • QR code scanning replaces traditional KYC flows
  • One-time setup, perpetual verification
  • Compatible with any Solana dApp

Technical Architecture

┌─────────────────────────────────────────────────────────────────┐
│                  Frontend (React + TypeScript)                   │
│  ┌──────────────┐  ┌──────────────┐  ┌──────────────────────┐  │
│  │ QR Scanner   │  │ Proof Gen    │  │ Wallet Integration   │  │
│  │ (jsQR)       │  │ (snarkjs)    │  │ (@solana/wallet)     │  │
│  └──────────────┘  └──────────────┘  └──────────────────────┘  │
└────────────────────────────┬────────────────────────────────────┘
                             │
                             ↓
┌─────────────────────────────────────────────────────────────────┐
│                  Backend API (Node.js + Express)                 │
│  ┌──────────────┐  ┌──────────────┐  ┌──────────────────────┐  │
│  │ QR Parser    │  │ Commitment   │  │ Database             │  │
│  │ (@anon-      │  │ Generator    │  │ (PostgreSQL)         │  │
│  │  aadhaar)    │  │              │  │                      │  │
│  └──────────────┘  └──────────────┘  └──────────────────────┘  │
└────────────────────────────┬────────────────────────────────────┘
                             │
                             ↓
┌─────────────────────────────────────────────────────────────────┐
│              Solana Blockchain (Anchor Framework)                │
│  ┌──────────────┐  ┌──────────────┐  ┌──────────────────────┐  │
│  │ Identity     │  │ Groth16      │  │ Light Protocol       │  │
│  │ Registry     │  │ Verifier     │  │ Compression          │  │
│  └──────────────┘  └──────────────┘  └──────────────────────┘  │
└────────────────────────────┬────────────────────────────────────┘
                             │
                             ↓
┌─────────────────────────────────────────────────────────────────┐
│                ZK Circuits (Circom + snarkjs)                    │
│  ┌──────────────┐  ┌──────────────┐  ┌──────────────────────┐  │
│  │ Age Proof    │  │ Nationality  │  │ Uniqueness Proof     │  │
│  │ (~50K const) │  │ (~30K const) │  │ (~10K constraints)   │  │
│  └──────────────┘  └──────────────┘  └──────────────────────┘  │
└─────────────────────────────────────────────────────────────────┘

Protocol Workflows

Identity Registration Flow

  1. User Scans QR Code: Upload mAadhaar QR code via web interface
  2. Data Extraction: Backend parses QR using @anon-aadhaar/core library
  3. Commitment Generation: Cryptographic commitment created from identity data
  4. Blockchain Storage: Commitment stored in compressed Solana account (Light Protocol)
  5. Automatic Proof Generation: Browser generates all three ZK proofs in parallel
  6. Local Storage: Proofs cached in localStorage for instant future use

Identity Verification Flow

  1. dApp Requests Proof: Application specifies required attribute (e.g., age > 18)
  2. Proof Retrieval: User's browser loads cached proof from localStorage
  3. Local Pre-verification: Proof integrity checked client-side before submission
  4. On-chain Submission: Proof submitted to Solana smart contract
  5. Groth16 Verification: Contract cryptographically verifies proof validity
  6. Access Granted: dApp authenticates user based on verification result

Zero-Knowledge Circuits

Age Proof Circuit

Proves user meets minimum age requirement without revealing exact date of birth.

  • Public Inputs: Minimum age threshold, identity commitment
  • Private Inputs: Actual age, identity secret nonce
  • Circuit Constraints: ~50,000
  • Proof Generation Time: 2-3 seconds
  • Proof Size: 256 bytes

Nationality Proof Circuit

Verifies user's nationality without exposing other personal information.

  • Public Inputs: Allowed country code, identity commitment
  • Private Inputs: User's nationality, identity secret nonce
  • Circuit Constraints: ~30,000
  • Proof Generation Time: 1-2 seconds
  • Proof Size: 256 bytes

Uniqueness Proof Circuit

Ensures one person creates only one identity, preventing Sybil attacks.

  • Public Inputs: Global nullifier registry, identity commitment
  • Private Inputs: Aadhaar number hash, identity secret nonce
  • Circuit Constraints: ~10,000
  • Proof Generation Time: <1 second
  • Proof Size: 256 bytes

Use Cases

Decentralized Finance (DeFi)

  • KYC/AML compliance for regulated protocols
  • Age-gated financial products (18+ verification)
  • Sybil-resistant governance and airdrops
  • Cross-chain identity portability

Gaming and Metaverse

  • Age verification for mature content
  • Unique player identification
  • Bot prevention in competitive games
  • Fair reward distribution

Decentralized Autonomous Organizations (DAOs)

  • One-person-one-vote mechanisms
  • Citizenship verification for nation DAOs
  • Quadratic funding Sybil resistance
  • Reputation systems

Social and Communication

  • Verified user badges
  • Bot-free communities
  • Age-appropriate content filtering
  • Trust scores without doxxing

Technology Stack

Blockchain Layer

  • Solana (High-performance L1 blockchain)
  • Anchor Framework (Smart contract development)
  • Light Protocol (ZK compression primitives)
  • @solana/web3.js (JavaScript SDK)

Zero-Knowledge Proof System

  • Circom (Circuit compiler)
  • snarkjs (Proof generation/verification)
  • Groth16 (Proving system)
  • circomlibjs (Cryptographic primitives)

Identity Integration

  • @anon-aadhaar/core (QR parsing library)
  • mAadhaar (Indian government identity app)
  • RSA-2048 (Signature verification)

Frontend Stack

  • React 18 + TypeScript
  • Vite (Build tool)
  • TailwindCSS (Styling)
  • @solana/wallet-adapter (Wallet integration)

Backend Infrastructure

  • Node.js + Express (API server)
  • PostgreSQL (Identity registry database)
  • Axios (HTTP client)

Performance Metrics

Metric Value
Identity Registration ~5 seconds
Proof Generation (all 3) ~5 seconds
On-chain Verification <1 second
Storage Cost (compressed) 0.00002 SOL
Storage Cost (traditional) 0.1 SOL
Cost Reduction 5000x
Concurrent Users Supported 1.4+ billion

Security Considerations

Cryptographic Security

  • Groth16 provides 128-bit security level
  • BN254 elliptic curve pairing-based cryptography
  • Poseidon hash function resistant to algebraic attacks
  • Trusted setup ceremony for circuit parameters

Privacy Guarantees

  • Zero-knowledge: No information leaked beyond proof statement
  • Unlinkability: Different proofs cannot be correlated
  • Non-interactivity: Proofs verifiable without prover interaction
  • Forward secrecy: Compromised proofs don't reveal past proofs

Sybil Resistance

  • Nullifier-based uniqueness enforcement
  • Aadhaar number hashing prevents identity reuse
  • On-chain nullifier registry tracks used identities
  • Cryptographic guarantee of one-person-one-identity

Regulatory Compliance

Solstice Protocol is designed with regulatory compliance in mind:

  • GDPR Compliant: Personal data never stored on-chain or servers
  • KYC/AML Compatible: Verifiable government-issued credentials
  • Right to be Forgotten: Users can delete local proofs anytime
  • Data Minimization: Only necessary commitments stored on-chain
  • Consent-Based: Users explicitly approve each verification request

Whitepaper

For comprehensive technical details, cryptographic protocols, and economic analysis, please refer to our whitepaper:

Read the Solstice Protocol Whitepaper

The whitepaper covers:

  • Detailed cryptographic protocols and security proofs
  • Circuit design and constraint optimization
  • Economic incentives and tokenomics
  • Governance mechanisms
  • Future roadmap and scaling strategies
  • Formal verification and audit results

Quick Start

For developers interested in integrating Solstice Protocol or running a local instance:

  1. Clone Repository: git clone https://github.com/Shaurya2k06/SolsticeProtocol.git
  2. Install Dependencies: npm install in root, frontend, backend, circuits directories
  3. Compile Circuits: cd circuits && npm run compile:all
  4. Deploy Contracts: cd contracts && anchor build && anchor deploy
  5. Start Services: Run backend (npm run dev) and frontend (npm run dev)

Repository Structure

SolsticeProtocol/
├── frontend/           # React + TypeScript web application
│   ├── src/
│   │   ├── components/ # UI components (QRScanner, VerificationFlow)
│   │   ├── contexts/   # React contexts (SolsticeContext)
│   │   ├── lib/        # Proof generation, Aadhaar parsing
│   │   └── assets/     # Static assets
│   └── public/         # Public files, compiled circuits
├── backend/            # Node.js API server
│   ├── src/
│   │   ├── routes/     # API endpoints
│   │   ├── db/         # Database schema and queries
│   │   └── utils/      # Aadhaar parsing, proof verification
│   └── logs/           # Application logs
├── contracts/          # Solana smart contracts (Anchor)
│   ├── programs/       # Rust program code
│   ├── tests/          # Anchor tests
│   └── scripts/        # Deployment scripts
├── circuits/           # Zero-knowledge circuits (Circom)
│   ├── age_proof.circom
│   ├── nationality_proof.circom
│   ├── uniqueness_proof.circom
│   └── scripts/        # Circuit compilation scripts
└── docs/               # Additional documentation

Contributing

We welcome contributions from the community! Please see our Contributing Guidelines for details on:

  • Code of conduct
  • Development workflow
  • Pull request process
  • Testing requirements
  • Documentation standards

License

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

Acknowledgments

  • Aadhaar: India's Unique Identification Authority for the identity infrastructure
  • Light Protocol: For ZK compression primitives on Solana
  • Self Protocol: Inspiration for privacy-preserving identity on blockchain
  • @anon-aadhaar: For QR parsing libraries and cryptographic utilities
  • Circom & snarkjs: For zero-knowledge proof tooling

Contact


Built with privacy, secured by mathematics, powered by Solana.

About

Zero-knowledge identity verification on Solana - Privacy-preserving authentication using Aadhaar infrastructure

Resources

Contributing

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.