DePLOB (Decentralized Private Limit Order Book) - A privacy-preserving DEX using zk-SNARKs and TEE.
| Document | Description |
|---|---|
| 01-problem-statement.md | Problem motivation, MEV issues, dark pool concept |
| 02-preliminary-knowledge.md | Blockchain, DeFi, ZKP, Merkle Trees, Nullifiers, TEE |
| 03-system-architecture.md | System components, data structures, security model |
| 04-operations.md | Step-by-step: Deposit, Withdraw, Create/Cancel Order, Execution |
An on-chain shielded pool DEX where users swap tokens via limit orders while preserving privacy. Order data (sizing, direction, depositor) is encrypted and invisible on-chain.
- zk-SNARKs: Prove transaction validity without revealing details
- TEE (Trusted Execution Environment): Secure order matching off-chain
- Incremental Merkle Tree: Efficient commitment storage
- Nullifiers: Prevent double-spending while maintaining privacy
Smart Contract (Shielded Pool) <--> ZK Verifier <--> TEE Matching Engine
1. DEPOSIT User -> Smart Contract: Commit tokens to shielded pool
2. CREATE User -> Smart Contract -> TEE: Submit encrypted order
3. MATCH TEE: Decrypt, match orders, generate settlement
4. SETTLE TEE -> Smart Contract: Create new commitments for trades
5. WITHDRAW User -> Smart Contract: Withdraw to any address (unlinkable)
commitment = H(nullifier_note || secret || token || amount || order_data)
nullifier = H(nullifier_note) // Prevents double-spend, maintains privacy
{price, quantity, side, token_in, token_out, commitment_reference}
- Balance privacy via commitments
- Order privacy via encryption
- Identity privacy via unlinkable deposits/withdrawals
- Trade privacy via TEE execution
When coding DePLOB components, refer to:
- Smart Contracts: See architecture + operations for interfaces
- ZK Circuits: See preliminary knowledge + operations for proof relations
- TEE Engine: See architecture + operations for matching logic
- Frontend: See operations for user-side steps