Skip to content

Stoffel-Labs/Stoffel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Stoffel CLI

Built with Stoffel Stoffel Docs

The official CLI tool for building privacy-preserving applications with Stoffel's Multi-Party Computation (MPC) framework.

Installation

# Build from source
cargo build --release

# The binary will be at ./target/release/stoffel

Quick Start

# Create a new Stoffel project
stoffel init my-mpc-app

# Compile StoffelLang source files
stoffel compile src/main.stfl -b

# Run in development mode
stoffel dev

# Execute compiled bytecode
stoffel run target/main.stfb

# Run tests
stoffel test

Commands

Command Description Status
init Initialize a new Stoffel project
compile Compile StoffelLang source files
build Build all source files in project
dev Development mode (compile & run)
run Execute compiled bytecode
test Run project tests
deploy Deploy to MPC network 🚧
add Add dependencies 🚧
publish Publish to registry 🚧

Project Templates

Create projects for different language ecosystems:

stoffel init my-app --template <template>
Template Description
stoffel Pure StoffelLang project (default)
python Python SDK integration
rust Rust SDK integration
typescript TypeScript/Node.js integration
solidity-foundry Solidity + Foundry monorepo
solidity-hardhat Solidity + Hardhat project

MPC Configuration

Default configuration for HoneyBadger MPC protocol:

Parameter Default Description
protocol honeybadger MPC protocol
parties 5 Number of parties (min 4)
threshold 1 Max corrupted parties
field bls12-381 Cryptographic field

Constraint: parties >= 3 * threshold + 1

StoffelLang Syntax

# Function definition
def secure_add(x: secret int64, y: secret int64) -> secret int64:
  return x + y

# Main entry point
main main() -> nil:
  var a: secret int64 = 10
  var b: secret int64 = 20
  var result: secret int64 = secure_add(a, b)
  discard result

Project Structure

my-mpc-app/
├── Stoffel.toml          # Project configuration
├── src/
│   └── main.stfl         # Main StoffelLang source
├── tests/
│   └── integration.stfl  # Test files
└── target/               # Build output
    └── main.stfb         # Compiled bytecode

Development

# Build the CLI
cargo build

# Run tests
cargo test

# Format and lint
cargo fmt && cargo clippy

Documentation

License

Licensed under the Apache License, Version 2.0. See LICENSE for details.

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors