Skip to content

yellowwlabs/luna

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Luna: ZeroReveal Identity Verification Platform

Privacy-first identity and form verification using Zero-Knowledge Proofs (ZKPs) on the Midnight blockchain.

Overview

Luna implements ZeroReveal, a next-generation form and identity verification plugin that enables platforms to verify facts about users without exposing sensitive personal data. Using Selective Disclosure and Zero-Knowledge Proofs, users prove specific claims (e.g., "I am over 18") without revealing the underlying data (e.g., passport details, home address).

Core Philosophy

  • Privacy by Design — Verify truth, not data
  • Progressive Disclosure — Reveal raw data only when pre-agreed conditions are met
  • Blind Processing — Enable unbiased evaluation by decoupling identity from submissions

Supported Use Cases

1. Airline & Airport Verification

Proves passengers are legally authorized to fly without exposing exact passport numbers or addresses. ZK proofs verify valid passports and name matches; agents see only a green checkmark.

2. International Hackathons

Enforces blind judging and eliminates geographic/gender bias. Participants register anonymously, generate ZKPs to prove eligibility. Legal/demographic data unlocks only if they win.

3. Secure Legal Evidence Collection

Protects victim and witness identities in sensitive cases (e.g., POCSO Act). Zero-knowledge architecture ensures confidentiality of testimonies and sensitive records.

Project Architecture

Luna is organized as a monorepo with three main workspaces:

/contracts — Smart Contract Layer

  • Language: Compact (TypeScript-like, compiled for Midnight)
  • Responsibilities:
    • IdentityRegistry: Stores hashes of user data signed by trusted issuers
    • ZKVerifier: Contains cryptographic logic to verify ZK-SNARK/STARK proofs
    • AppGateway: Business logic for the specific use case
  • Build: pnpm run build (compiles Compact → circuit + contract types)

/api — Backend Services

  • Midnight provider setup
  • Pinata IPFS integration for encrypted data storage
  • Luna contract API endpoints for proof verification
  • Indexing and public data providers

/ui — React Frontend

  • Framework: React 19 + Vite
  • UI Library: Material-UI (MUI)
  • State Management: RxJS + fp-ts
  • Forms: Three use-case templates (airline, hackathon, legal evidence)
  • Build: pnpm run build (compiled to dist/)

Technology Stack

Core

  • Midnight Network + Compact language
  • Zero-Knowledge Proofs (zk-SNARK/STARK)
  • IPFS (Pinata) for decentralized storage

Backend

  • Node.js + TypeScript
  • Midnight JS SDK (providers, contracts, indexing)
  • Axios for HTTP

Frontend

  • React 19
  • TypeScript
  • Vite (bundler)
  • Material-UI
  • React Router

DevOps

  • Docker Compose (Midnight node, indexer, proof server, IPFS)
  • pnpm workspaces

Quick Start

See STARTUP.md for detailed environment setup and development workflow.

Prerequisites

  • Node.js 18+
  • pnpm 8+
  • Docker & Docker Compose (for local blockchain/IPFS)

Install & Build

# Install dependencies
pnpm install

# Build all workspaces
pnpm run build

# Type check
pnpm run typecheck

# Run tests
pnpm test

Local Development

# Start Midnight node, indexer, proof server, IPFS
docker-compose -f docker/midnight/node/compose.yaml up -d
docker-compose -f docker/midnight/indexer/compose.yaml up -d
docker-compose -f docker/midnight/proofserver/compose.yaml up -d
docker-compose -f docker/ipfs/compose.yaml up -d

# Start UI dev server
cd ui && pnpm run dev

# API is available at http://localhost:3000 (configured in .env)

Security & Compliance

  • GDPR/CCPA Compliant: Verifiers never hold raw sensitive data; liability is massively reduced
  • Anti-Spoofing: All verifiable credentials must be cryptographically signed by a trusted issuer
  • Circuit Privacy: All data through circuits or returned by witnesses is private
  • Ledger Exposure Prevention: Developers must explicitly disclose data when moving from private to public ledger states

Key Files & Hot Paths

  • contracts/src/luna.compact — Main smart contract definition
  • contracts/src/managed/luna-contracts/ — Compiled circuit & types (auto-generated)
  • api/src/storage.ts — Pinata/IPFS integration
  • ui/src/pages/ — Form pages for each use case

Development Workflow

  1. Contracts: Edit .compact file → pnpm run compact → auto-generates circuit + types
  2. Backend: Update API endpoints in /api/srcpnpm run build
  3. Frontend: React components in /ui/src → Hot reload via Vite
  4. Testing: pnpm test across all workspaces

Debugging

  • Type Errors: pnpm run typecheck (root)
  • Contract Compilation: cd contracts && pnpm run compact
  • Lint Issues: pnpm run lint
  • Docker Issues: Check individual service logs in docker/*/compose.yaml

Repository

References

License

ISC

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages