Stoffel CLI Overview
The Stoffel CLI is a comprehensive command-line interface that provides everything you need to develop, build, test, and run privacy-preserving applications using secure Multi-Party Computation (MPC).Design Philosophy
The Stoffel CLI is designed with the following principles:- Developer-Friendly: Intuitive commands that follow familiar patterns from tools like
cargoandnpm - Template-Driven: Project templates for different use cases and programming languages
- Integrated Workflow: Seamless integration between development, compilation, and execution
Core Commands
Project Management
Compilation
Building
Development
Execution
Testing
Available Templates
The CLI provides templates for different development scenarios:Language-Specific Templates
| Template | Description | Status |
|---|---|---|
stoffel | Pure StoffelLang project (default) | ✅ Complete |
python | Python SDK integration with Poetry | ✅ Complete |
rust | Rust SDK integration | ✅ Complete |
typescript | TypeScript/Node.js integration | ⚠️ Skeleton (SDK pending) |
solidity-foundry | Solidity with Foundry framework | ✅ Complete |
solidity-hardhat | Solidity with Hardhat framework | ✅ Complete |
Template Usage
Project Structure
Pure StoffelLang Project
Python Template Structure
Rust Template Structure
Solidity Template Structure (Foundry)
Configuration
Stoffel.toml
The main configuration file for Stoffel projects:MPC Configuration
The CLI supports configurable MPC parameters:- Parties: Number of parties in the MPC computation (minimum 4 for HoneyBadger)
- Threshold: Maximum number of corrupted parties tolerated
- Constraint:
parties >= 3 * threshold + 1 - Cryptographic Fields: BLS12-381 (default), BN254, Secp256k1, Prime61
Valid Configurations
| Parties | Threshold | Valid? |
|---|---|---|
| 4 | 1 | ✅ (4 >= 4) |
| 5 | 1 | ✅ (5 >= 4) - default |
| 7 | 2 | ✅ (7 >= 7) |
| 3 | 1 | ❌ (3 < 4) |
Help System
The CLI provides comprehensive help for all commands:Command Status
Implemented Commands
| Command | Description |
|---|---|
init | Project initialization with templates |
compile | StoffelLang compilation |
build | Build entire project |
dev | Development mode (compile + run) |
run | Execute compiled bytecode |
test | Test discovery and execution |
Planned Commands
| Command | Description |
|---|---|
deploy | Deployment to MPC networks |
add | Package dependency management |
update | Update dependencies |
publish | Publish packages to registry |
clean | Remove build artifacts |
Examples
Quick Start
Rust SDK Integration
Solidity Integration
Next Steps
- Project Management: Learn about creating and managing projects
- Development Workflow: Understand the development process
- Building and Deployment: Build and deploy your applications