A privacy-preserving machine learning system using Multi-Party Computation (MPC) on the Partisia Blockchain. This project demonstrates how to build a secure ML system where model parameters and user data remain private during inference.
ml-mpc/
├── frontend/ # Next.js frontend application
├── backend/ # Python ML training and model conversion
├── contracts/ # Rust smart contracts for MPC
└── docs/ # Additional documentation
- User interface for model interaction
- Secure data input handling
- Real-time result visualization
- Integration with smart contracts
- Model training pipeline
- Data preprocessing
- Model conversion to MPC format
- Parameter encryption
- MPC protocol implementation
- Secure parameter storage
- Privacy-preserving inference
- Result verification
-
Set up the frontend:
cd frontend npm install npm run dev -
Configure the backend:
cd backend python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate pip install -r requirements.txt
-
Build the smart contracts:
cd contracts cargo build
- Train and prepare the model using the Python backend
- Deploy the model parameters to the blockchain
- Build and deploy the smart contracts
- Start the frontend application
- Test the complete system
- Privacy-preserving model inference
- Encrypted parameter storage
- Secure data transmission
- Zero-knowledge proofs
- Multi-party computation
- Node.js 18+
- Python 3.8+
- Rust (latest stable)
- Partisia Blockchain CLI
- Docker (optional)
- Create
.envfiles in each component:# frontend/.env NEXT_PUBLIC_CONTRACT_ADDRESS=your_contract_address NEXT_PUBLIC_NODE_URL=your_node_url # backend/.env MODEL_PATH=path_to_model TRAINING_DATA_PATH=path_to_data # contracts/.env PRIVATE_KEY=your_private_key NODE_URL=your_node_url
-
Frontend tests:
cd frontend npm run test
-
Backend tests:
cd backend python -m pytest -
Contract tests:
cd contracts cargo test
-
Deploy smart contracts:
cd contracts cargo run --release -
Deploy frontend:
cd frontend npm run build npm run start
Please refer to the main repository README for contribution guidelines.
This project is licensed under the MIT License - see the LICENSE file for details.