Latens allows users to privately prove Bitcoin balance ownership or threshold conditions without revealing their address or exact balance on-chain
- Privacy-First: Prove you own ≥X BTC without revealing your address or exact balance
- Zero-Knowledge: Uses ZK proofs verified on Starknet
- Bitcoin Native: Works with real Bitcoin blockchain data
- Trustless: Cryptographically verifiable proofs
- Modern UI: Glassmorphism design with live protocol statistics
┌─────────────────┐
│ Bitcoin Chain │
└────────┬────────┘
│
▼
┌─────────────────┐ ┌──────────────┐
│ Indexer │─────▶│ Merkle Tree │
│ (Backend) │ │ Builder │
└─────────────────┘ └──────┬───────┘
│
▼
┌──────────────┐
│ ZK Circuit │
│ (Cairo) │
└──────┬───────┘
│
┌──────────────────────┴──────────────────────┐
▼ ▼
┌─────────────────┐ ┌─────────────────┐
│ Frontend │ │ Starknet │
│ (Next.js) │─────────────────────────▶│ Contracts │
└─────────────────┘ Submit Proof └─────────────────┘
latens/
├── backend/ # Python backend service
│ ├── src/
│ │ ├── indexer/ # Bitcoin data fetching
│ │ ├── crypto/ # Merkle tree & Poseidon hash
│ │ ├── circuit/ # Cairo circuit & proof generation
│ │ ├── api/ # FastAPI server
│ │ └── models/ # Database models
│ ├── tests/
│ └── requirements.txt
├── contracts/ # Cairo smart contracts
│ ├── src/
│ │ ├── state_root_registry.cairo
│ │ └── proof_verifier.cairo
│ ├── tests/
│ └── Scarb.toml
├── frontend/ # Next.js frontend
│ ├── src/
│ │ ├── app/
│ │ ├── components/
│ │ └── lib/
│ └── package.json
└── docs/ # Documentation
├── prd.md
└── flow.md
Run the full stack (Frontend + Backend + DB) with one command:
docker-compose up --build- Frontend: http://localhost:3000
- Backend API: http://localhost:8000/docs
- Python 3.10+
- Node.js 18+
- Scarb (for contracts)
- Starknet wallet (Argent/Braavos)
cd backend
python -m venv venv
# Windows: venv\Scripts\activate | Mac/Linux: source venv/bin/activate
pip install -r requirements.txt
uvicorn src.api.main:app --reloadcd frontend
npm install
npm run devcd contracts
scarb build
# Deploy to Testnet (requires .env vars)
python scripts/deploy.pycd backend
python -m src.scripts.generate_snapshot --block-height 800000cd backend
uvicorn src.api.main:app --reloadOpen browser to http://localhost:3000/demo
- Enter Bitcoin Address: Input your BTC address locally
- Generate Proof: Client-side commitment + backend proof generation
- Connect Wallet: Connect Starknet wallet (Argent/Braavos)
- Submit Proof: Verify on-chain without revealing address
- View Result: See verification status
- ✅ Exact balance remains private
- ✅ Salt prevents correlation attacks
- ✅ Only threshold satisfaction is proven
- ✅ Bitcoin address never appears on-chain
# Backend tests
cd backend
pytest tests/ -v
# Contract tests
cd contracts
scarb test
# Frontend tests
cd frontend
npm test- PRD - Product Requirements Document
- Flow - Detailed User Flow Specification
- Implementation Plan - Technical Implementation Guide
- Backend: Python, FastAPI, SQLAlchemy
- ZK Circuits: Cairo
- Smart Contracts: Cairo on Starknet
- Frontend: Next.js, TypeScript, TailwindCSS
- Cryptography: Poseidon hash, Merkle trees
- Private Balance Verification: Prove ownership without revealing amount
- Threshold Gating: Access DAOs/services with ≥X BTC requirement
- Anonymous Reputation: Build cross-chain reputation from Bitcoin holdings
- Compliance Proofs: Prove non-interaction with blacklisted addresses
MIT
This is a hackathon project. Contributions welcome!