Starknet Lightning Privacy Mixer - V2
Break on-chain linkability with privacy routing
Created on 4th December 2025
•
Starknet Lightning Privacy Mixer - V2
Break on-chain linkability with privacy routing
The problem Starknet Lightning Privacy Mixer - V2 solves
SLPM V2 - The Problem It Solves
Executive Summary
SLPM (Starknet Lightning Privacy Mixer) solves the critical problem of financial surveillance on public blockchains. Every transaction on Ethereum, Starknet, and other networks is permanently visible—creating comprehensive financial profiles of users, exposing spending patterns, and enabling tracking of fund flows.
SLPM V2 breaks this chain of surveillance through a revolutionary multi-layer privacy architecture, now enhanced with cross-chain atomic swaps for ZEC (Zcash) and STRK (Starknet).
The Problem: Blockchain Transparency = Financial Surveillance
┌─────────────────────────────────────────────────────────────────────────────┐ │ THE SURVEILLANCE PROBLEM │ ├─────────────────────────────────────────────────────────────────────────────┤ │ │ │ Every blockchain transaction reveals: │ │ │ │ - WHO sent funds → Your address is your identity │ │ - WHO received funds → Links you to every recipient │ │ - HOW MUCH was sent → Your exact wealth & spending patterns │ │ - WHEN it happened → Timing analysis reveals habits │ │ - TRANSACTION GRAPH → Chain analysis links all your addresses │ │ │ │ Result: Complete financial dossier on every user │ │ │ └─────────────────────────────────────────────────────────────────────────────┘
Real-World Impact
| Scenario | Problem Without SLPM |
|---|---|
| Salary Payments | Employer can track all your spending |
| Donations | Political/social causes become public |
| Business Payments | Competitors see your suppliers & pricing |
| Personal Savings | Anyone can calculate your net worth |
| Medical Expenses | Health conditions become traceable |
The Solution: SLPM V2 Multi-Layer Privacy
SLPM V2 provides military-grade financial privacy through a sophisticated four-layer architecture:
┌─────────────────────────────────────────────────────────────────────────────┐ │ SLPM V2 PRIVACY ARCHITECTURE │ ├─────────────────────────────────────────────────────────────────────────────┤ │ │ │ ┌──────────────────────────────────────────────────────────────────────┐ │ │ │ LAYER 1: STARKNET ZK MIXER │ │ │ │ ──────────────────────────── │ │ │ │ • Noir circuits for ZK proof generation │ │ │ │ • Garaga for on-chain proof verification │ │ │ │ • Merkle tree anonymity set (256 commitments) │ │ │ │ • Cryptographic unlinkability between deposit & withdrawal │ │ │ └──────────────────────────────────────────────────────────────────────┘ │ │ │ │ │ ▼ │ │ ┌──────────────────────────────────────────────────────────────────────┐ │ │ │ LAYER 2: LIGHTNING NETWORK │ │ │ │ ──────────────────────────── │ │ │ │ • Off-chain payment routing │ │ │ │ • Multi-hop onion encryption │ │ │ │ • No permanent blockchain record │ │ │ │ • Instant settlement │ │ │ └──────────────────────────────────────────────────────────────────────┘ │ │ │ │ │ ▼ │ │ ┌──────────────────────────────────────────────────────────────────────┐ │ │ │ LAYER 3: CASHU ECASH │ │ │ │ ──────────────────────── │ │ │ │ • Blind-signed bearer tokens │ │ │ │ • No ledger tracking transfers │ │ │ │ • Offline storage capability │ │ │ │ • Peer-to-peer transferable
Challenges I ran into
1. ZK Toolchain Version Compatibility
The Problem
The biggest challenge was getting the entire ZK proof pipeline working end-to-end. We needed to integrate three separate tools that had to be exactly compatible:
- Noir (circuit language) - For defining the privacy circuit
- Barretenberg (proving backend) - For generating UltraHonk proofs
- Garaga (Cairo verifier) - For on-chain proof verification
Each tool has its own versioning, and they must all be compatible with each other AND with Starknet's Cairo VM.
Incompatible versions led to: - Proof generation failures - Verifier contract compilation errors - On-chain verification returning false positives/negatives
How We Solved It
After extensive testing, we found the exact version combination that works:
# The working stack: noirup --version 1.0.0-beta.5 # Noir circuit compiler bbup --version 0.87.4-starknet.1 # Barretenberg with Starknet support pip install garaga==0.18.1 # Garaga Cairo verifier generator
We also had to use specific flags for proof generation to ensure Starknet compatibility:
bb prove --scheme ultra_honk --zk --oracle_hash starknet
The
--oracle_hash starknet
flag was critical - it ensures the proof uses Starknet-compatible hash functions.2. Merkle Tree Root Synchronization
The Problem
The privacy mixer uses a Merkle tree to store commitments. When generating a withdrawal proof, the Merkle root in the proof must match the current on-chain root. But:
- New deposits change the root
- If someone deposits between proof generation and withdrawal, the proof becomes invalid
How We Solved It
We implemented root history tracking in the contract:
// Store historical roots (last 100) fn is_known_root(self: @ContractState, root: felt252) -> bool { // Check current root if self.merkle_root.read() == root { return true; } // Check historical roots // ... }
This allows proofs generated against slightly older roots to still verify.
3. Large Proof Calldata Size
The Problem
A single ZK proof with Garaga hints requires ~2900 felt252 elements. This is:
- Expensive in terms of calldata costs
- Near the transaction size limits
- Slow to serialize/deserialize
Proof calldata breakdown: - Proof points: ~64 elements - Pairing hints: ~2800 elements - Public inputs: ~23 elements Total: ~2900 elements
How We Solved It
We accepted this as a tradeoff for the security guarantees. Garaga's approach of pre-computing pairing hints client-side reduces on-chain computation significantly, making verification gas-efficient despite the large calldata.
Future optimization: Recursive proof aggregation could batch multiple withdrawals into a single proof, amortizing the calldata cost.
Tracks Applied (5)
Cross-Chain Privacy Solutions
Starknet
Privacy Infrastructure & Developer Tools
Starknet
Privacy Infrastructure & Developer Tools
Electric Coin Company
Private DeFi & Trading
Zcash Community Grants
Privacy Infrastructure & Developer Tools
Zcash Community Grants
Technologies used