Skip to content

OpenMined/syft-extras

SyftBox Extras

Building blocks for SyftBox applications to communicate with each other and external services.

Overview

SyftBox Extras provides essential packages that enable:

  • πŸ” Secure file permissions with the new syft.pub.yaml format
  • πŸ”’ End-to-end encryption using the X3DH protocol
  • 🌐 Inter-app communication via syft:// URLs
  • πŸ”Œ External API integration through HTTP bridging
  • πŸ“¦ Object serialization for distributed communication
  • πŸ—οΈ Application scaffolding with client and workspace management

Architecture

The packages serve different layers of the SyftBox communication stack:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                      Application Layer                          β”‚
β”‚  β€’ SyftBox Apps use these packages for communication            β”‚
β”‚  β€’ Receive data via syft:// or http:// URLs                     β”‚
β”‚  β€’ Use syft-core for permissions and client management          β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                               β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    Communication Layer                          β”‚
β”‚  β€’ syft-event: Handles syft:// URLs with routing                β”‚
β”‚  β€’ syft-http-bridge: Bridges HTTP ↔ filesystem                  β”‚
β”‚  β€’ syft-rpc: Request/Response serialization                     β”‚
β”‚  β€’ syft-crypto: End-to-end encryption using X3DH                β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                               β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                   Infrastructure Layer                          β”‚
β”‚  β€’ SyftBox Cache Server: Optional Encrypted data routing        β”‚
β”‚  β€’ No direct TCP connections needed                             β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Packages

Foundation package providing client configuration, workspace management, and the new permissions system.

Key Features:

  • πŸ“ New syft.pub.yaml permission format with terminal flags
  • πŸ”„ Auto-conversion from old syftperm.yaml format
  • 🏠 Workspace and datasite management
  • πŸ”— SyftBox URL handling

Event-driven RPC system for handling syft:// URL requests between applications.

Key Features:

  • πŸš€ Simple routing with @router.on_request()
  • πŸ“¨ Request/Response pattern
  • πŸ‘€ Filesystem watching for events
  • πŸ—ΊοΈ Automatic schema generation

Low-level serialization protocol supporting complex Python objects and RPC primitives.

Key Features:

  • πŸ”„ Serialize/deserialize Python objects
  • πŸ“¦ Support for Pydantic models and dataclasses
  • 🌍 Full UTF-8 support
  • πŸ”’ Type validation and security

Enables SyftBox apps to communicate with external HTTP APIs through filesystem transport.

Key Features:

  • 🌐 HTTP client that works through filesystem
  • πŸ“€ Automatic request/response serialization
  • πŸ” Host whitelisting for security
  • ⚑ Connection pooling and caching

End-to-end encryption utilities for SyftBox using a simplified X3DH protocol implementation.

Key Features:

  • πŸ”’ Forward secrecy with ephemeral keys
  • πŸ” Mutual authentication via signed prekeys
  • πŸ“‘ Asynchronous communication through DID documents
  • πŸš€ High performance with 2 DH operations instead of 4
  • πŸ“„ W3C DID standards compliance

syft-proxy (DEPRECATED)

Previously provided HTTP β†’ syft:// translation. This functionality is now integrated into the SyftBox Cache Server.

Quick Start

Installation

Install all packages:

# Install the packages from PyPI
pip install syft-core
pip install syft-event
pip install syft-rpc
pip install syft-http-bridge
pip install syft-crypto

## Higher-Level Abstraction

For easier development, check out [FastSyftBox](https://github.com/OpenMined/fastsyftbox) - a FastAPI-compatible server template that combines syft-core, syft-rpc, syft-events, and syft-http-bridge into one cohesive system.

## Documentation

- πŸ“– [Architecture Overview](docs/architecture-overview.md)
- πŸ“š [syft-core Documentation](docs/syft-core.md)
- πŸ“š [syft-event Documentation](docs/syft-event.md)
- πŸ“š [syft-rpc Documentation](docs/syft-rpc.md)
- πŸ“š [syft-http-bridge Documentation](docs/syft-http-bridge.md)
- πŸ“š [syft-crypto Documentation](packages/syft-crypto/README.md)
- πŸ“š [syft-proxy Documentation](docs/syft-proxy.md) (Deprecated)

## Development

### Running Tests

Test all packages:
```bash
# Unix/macOS
./test.sh

# Windows
./test.ps1

# Or test individual packages
cd packages/syft-core
uv run pytest

Linting

Run linting with auto-fix:

# Unix/macOS
./lint.sh

# Windows
./lint.ps1

Examples

The original experimental examples are still available:

RPC Ping Pong

Start the pong RPC server:

just run-pong

Make a ping RPC request to the pong server:

just run-ping

HTTP Proxy (Deprecated)

The HTTP proxy functionality has been moved to the SyftBox Cache Server.

Future Enhancements

  • syft-files - File management package (not yet started)
  • Distributed Tracing - Better debugging across services
  • Schema Registry - Centralized type definitions

Contributing

We welcome contributions! Please see our contributing guidelines (coming soon).

License

Apache License 2.0

About

SyftBox Experimental

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published