How breez/spark-sdk works
Project type and purpose
• This is an open-source multi-language SDK (“Breez SDK – Nodeless (Spark Implementation)”) for self-custodial Bitcoin & Lightning integration using Spark (a Bitcoin-native Layer-2).
• It provides Rust core libraries, FFI bindings to Go, C#, Python, React Native, Swift, Flutter, WebAssembly, a CLI, and an LNURL microservice.
File structure
• Top-level workspace (Cargo.toml) with two main Rust workspaces:
• crates/breez-sdk – the SDK crates:
– bindings (uniffi-generated FFI layers)
– core & common (business logic, protocols, storage adapters)
– wasm (WebAssembly interface)
– cli (command-line client)
• crates/spark – the Spark protocol & operator client
• A microservice subdirectory: crates/breez-sdk/lnurl – a standalone HTTP service (Rust + Diesel/Postgres/SQLite migrations) exposing LNURL endpoints.
• packages/ – platform projects consuming the SDK: Flutter, React Native, Wasm examples
• docs/ – static site generator for HTML docs and code snippets per language
• .github/ – CI/CD workflows for building & publishing each binding
• regtest/ – scripts for integration tests against a local Bitcoin regtest
README for additional insights
• Clarifies SDK capabilities (payments, tokens, real-time sync, WebAssembly)
• Describes project layout (crates + packages)
• Lists features and supported languages
• Mentions the CLI and LNURL microservice