Skip to main content

Communication Layer

The communication layer (syft-extras) provides building blocks for SyftBox applications to interact with each other and external services.

Package Overview​

syft-core​

Foundation package providing:

  • πŸ“ Permission system (syft.pub.yaml format)
  • 🏠 Workspace and datasite management
  • πŸ”— SyftBox URL handling
  • πŸ”„ Auto-conversion from legacy formats

syft-event​

Event-driven RPC system for syft:// URLs:

  • πŸš€ Simple routing with decorators
  • πŸ“¨ Request/Response pattern
  • πŸ‘€ Filesystem watching
  • πŸ—ΊοΈ Automatic schema generation

syft-rpc​

Low-level serialization protocol:

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

syft-http-bridge​

HTTP API integration through filesystem:

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

syft-crypto​

End-to-end encryption using Signal Protocols:

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

Communication Patterns​

App-to-App (syft:// URLs)​

Applications communicate using syft:// URLs routed through the filesystem:

# Example: Sending a request
response = send_request("syft://user@email.com/app/endpoint", data)

App-to-External (HTTP Bridge)​

Applications access external APIs through the HTTP bridge:

# Example: Making HTTP request via filesystem
response = http_bridge.get("https://api.example.com/data")

Encrypted Communication​

End-to-end encryption ensures privacy:

# Example: Encrypted message
encrypted = encrypt(message, recipient_public_key)
note

Detailed API documentation and examples coming soon

See Also​