Zero-Knowledge Proof P2P Token Exchange on Solana.
cd anomi-zk-prototype
# Install dependencies
npm install
# Build programs
anchor build
# Run tests
npm test
# Deploy to devnet
npm run deploy:devnet# 1. Create test token
npm run p2p:create-token
# 2. Setup buyer wallet
npm run p2p:setup-buyer
# 3. Initialize market
npm run p2p:init-market <TOKEN_MINT>
# 4. Distribute tokens
npm run p2p:distribute
# 5. Run P2P swap test
npm run p2p:test
# 6. Verify order book
npm run p2p:fetchThe settlement layer uses Zero-Knowledge proofs to verify email-based payment confirmations.
Quick Start:
cd zk-stuff
npm install
npm test # Run email verification testsSee zk-stuff/README.md for detailed setup, implementation, and testing.
Multi-Program Architecture:
Market- Order matching with CritBit tree-based order bookOrderStore- Persistent matched order storageOrderProcessor- ZK proof validation and settlement
Order Flow:
- Users place limit/market orders (ASK to sell, BID to buy)
- Orders matched on-chain using price-time priority
- Tokens held in escrow during matching
- Matched orders stored for off-chain settlement
- ZK proofs validate fiat payment confirmations
- Tokens released upon proof verification
Key Features:
- CritBit tree: O(log n) order operations
- 5 order types: Limit, Market, Post-Only, IOC, FOK
- Partial fills and self-trade prevention
- Token escrow with SPL integration
- ZK email verification for settlement
anomi-zk-prototype/docs/SETUP.md- Installation guideanomi-zk-prototype/docs/DEPLOYMENT.md- Deployment instructionsanomi-zk-prototype/docs/TESTING.md- Testing guideanomi-zk-prototype/docs/ARCHITECTURE.md- System designzk-stuff/README.md- ZK Email Verification (comprehensive)workflow_ANOMI.md- Project status and roadmap
✅ Completed:
- Core matching engine with CritBit trees
- All 5 order types implemented
- Token escrow system secure
- ZK email verification circuit (DKIM + domain matching)
- Email parsing and proof generation utilities
- Comprehensive test suite
🚧 In Progress:
- End-to-end P2P wallet testing
- Phantom wallet UI integration
- ZK proof integration with Solana program
⏳ Future:
- Full RSA signature verification in circuit
- Mainnet deployment
See workflow_ANOMI.md for detailed roadmap.
This project follows a milestone-based development approach. See the workflow document for current status and next steps.
ISC