This folder contains comprehensive documentation for the MPC Solana Wallet project - a production-ready Multi-Party Computation (MPC) based cryptocurrency wallet service for Solana blockchain.
The MPC Solana Wallet is a complete wallet infrastructure that provides:
- Distributed Key Management: 2-of-3 threshold signing using FROST Ed25519
- Real-time Blockchain Indexing: Yellowstone GRPC integration for balance tracking
- DEX Integration: Jupiter API for token swaps
- Production-Ready APIs: Versioned REST APIs with JWT authentication
- Enterprise Security: No single point of private key failure
setup-index.md- Complete setup guide and architecture overviewimplementation_steps.md- Detailed 7-phase implementation roadmapcurrent-status.md- Real-time implementation status and progress
phase3-implementation.md- Phase 3 wallet API implementation detailsphase3-completion-summary.md- Phase 3 completion summary with test resultsphase3-4.md- Combined Phase 3 & 4 implementation documentationphase4-step1-solana-integration.md- Solana blockchain integration details
test-scripts-fixes.md- Test script fixes and validation proceduresstep-1-2-completion-summary.md- Database schema validation completion
purge-assignment/
βββ docs/ # π Complete documentation
β βββ README.md # This file - project overview
β βββ setup-index.md # Setup & architecture guide
β βββ current-status.md # Current implementation status
β βββ implementation_steps.md # 7-phase implementation plan
β βββ phase3-*.md # Phase 3 implementation docs
β βββ phase4-*.md # Phase 4 implementation docs
β βββ test-scripts-fixes.md # Testing procedures
βββ backend/ # π HTTP API server (Actix-web)
β βββ src/routes/ # API endpoints (v1, wallet, user, solana)
β βββ src/services/ # Business logic (MPC, Jupiter, Solana)
β βββ src/middleware/ # Auth, rate limiting, metrics
β βββ src/blockchain/ # Solana blockchain integration
βββ mpc/ # π Multi-Party Computation service
β βββ src/tss.rs # FROST threshold signing implementation
β βββ src/serialization.rs # Cryptographic data structures
β βββ src/error.rs # Comprehensive error handling
βββ store/ # πΎ Database operations crate
β βββ src/user.rs # User management operations
β βββ src/balance.rs # Balance and asset operations
β βββ src/quote.rs # Jupiter quote management
β βββ src/bin/ # Database validation tools
βββ indexer/ # π Real-time blockchain monitor
β βββ src/yellowstone.rs # Yellowstone GRPC client
β βββ src/processor.rs # Transaction processing logic
β βββ src/database.rs # Indexer database operations
βββ migrations/ # ποΈ Database schema migrations
β βββ 001_initial_schema.sql # Core tables (users, assets, balances)
β βββ 002_add_balance_tables.sql # Balance management tables
β βββ 003_wallet_state_management.sql # MPC session management
βββ tests/ # π§ͺ Organized test suites
β βββ phase3/ # Phase 3 backend API tests
β βββ phase4/ # Phase 4 Solana integration tests
β βββ mpc/ # MPC cluster tests
β βββ performance/ # Performance and load tests
βββ scripts/ # π οΈ Setup and utility scripts
βββ start_mpc_cluster.sh # Start 3-node MPC cluster
- Rust 1.70+ with Cargo
- PostgreSQL 13+ database
- Node.js 16+ (for some scripts)
# Create databases
createdb solana_wallet
createdb solana_wallet_indexer
# Run migrations
./run_all_migrations.sh# Start 3-node MPC cluster (ports 8001, 8002, 8003)
./start_mpc_cluster.shcd backend
cargo run
# API available at http://localhost:8080cd indexer
cargo run
# Indexer monitors Solana blockchain for balance changes- Database schema with comprehensive tables
- Store module with full CRUD operations
- Performance indexes and migrations
- Database validation and testing
- FROST Ed25519 threshold signing
- 3-node MPC cluster with distributed key generation
- Two-phase signing protocol
- Persistent key storage with Sled database
- Wallet-specific REST APIs (
/wallet/*) - Versioned external APIs (
/api/v1/wallet/*) - JWT authentication and rate limiting
- Session management and retry logic
- OpenAPI/Swagger documentation
- Solana blockchain module with address derivation
- Transaction building and signing
- MPC-signed transaction broadcasting
- Secure API endpoints (
/api/v1/solana/*) - Comprehensive observability
- Jupiter client implementation
- Quote fetching and validation
- Swap transaction building
- Integration with backend routes
- Yellowstone GRPC client setup
- Account update processing
- Balance change detection
- Database integration
- Security enhancements
- Performance optimization
- Comprehensive testing
- Production deployment
# Run complete Phase 3 integration tests
./tests/phase3/integration/run_all.sh
# Test MPC cluster functionality
./tests/mpc/test_integration.sh
# Test Solana blockchain integration
./tests/phase4/test_solana_integration.sh# Test store module
cd store && cargo test
# Test backend services
cd backend && cargo test
# Test MPC implementation
cd mpc && cargo test# Database
DATABASE_URL=postgresql://user:pass@localhost:5432/solana_wallet
# MPC Cluster
MPC_NODES=http://localhost:8001,http://localhost:8002,http://localhost:8003
MPC_THRESHOLD=2
# Solana
SOLANA_RPC_URL=https://api.devnet.solana.com
SOLANA_COMMITMENT=confirmed
# Jupiter DEX
JUPITER_API_URL=https://quote-api.jup.ag/v6POST /keygen- Generate distributed MPC keysPOST /sign/phase1- Initiate signing (nonce generation)POST /sign/phase2- Complete signing (signature shares)POST /aggregate- Aggregate signature sharesGET /health- MPC cluster health check
POST /address- Derive Solana address from MPC keyPOST /transfer- Send SOL/tokens (MPC-signed)GET /balance- Get user balancesPOST /quote- Get Jupiter swap quotePOST /swap- Execute token swap
POST /signup- User registration with MPC key generationPOST /signin- User authentication (JWT)GET /profile- Get user profile
- Threshold Signing: 2-of-3 MPC nodes required for transactions
- JWT Authentication: Secure API access with token expiration
- Rate Limiting: 100 requests/minute per user
- Input Validation: Comprehensive validation for all inputs
- Audit Logging: Structured logging for all operations
- No Private Key Exposure: All signing via distributed MPC
- Setup Guide: See
setup-index.mdfor detailed setup instructions - Implementation Plan: See
implementation_steps.mdfor development roadmap - Current Status: See
current-status.mdfor real-time progress - API Documentation: Available at
http://localhost:8080/api/docs/ - Metrics: Available at
http://localhost:8080/metrics
This is a production-ready MPC wallet implementation with comprehensive documentation, testing, and security features. The system is designed for enterprise use with proper error handling, observability, and scalability.
For detailed implementation information, see the individual documentation files in this directory.