An experimental library to research the implementation of silent payments (BIP-352) in bdk-ffi and bdk_dart
- Core SP Logic: Built on top of the spdk repository.
- Crate Routing:
sp_dartbinds into the underlyingsilentpaymentssub-crate inside spdk
| Path | Purpose |
|---|---|
native/ |
Rust sources and uniffi-dart build scripts and configs wrapping the underlying bdk-ffi crate to be used by the Dart build hook. |
lib/ |
Dart bindings (bdk.dart) generated by UniFFI-Dart. |
example/ |
Standalone Dart example to showcase, test and play with the bindings. |
test/ |
Offline/construction/persistence tests (not full integration tests). |
sp_demo/ |
Flutter sample app you can point at mobile targets once the bindings are built. |
scripts/generate_bindings.sh |
Helper used to rebuild the native library and regenerate the Dart bindings. |
To use this package you need:
- Dart SDK >= 3.10 or newer (see
pubspec.yaml). - Rust toolchain with
cargoand the native targets you intend to build. You can install Rust via rustup. - Flutter SDK if you plan to use the package in a Flutter app or run the Flutter demo.
See SUPPORTED_TARGETS.md for the current platform/architecture matrix and support status.
Via git:
dependencies:
sp_dart:
git:
url: https://github.com/MusabYK/sp-dart.git
ref: main # or specific tagImport the package entrypoint:
import 'package:sp_dart/sp_dart.dart';Check out the example in example/main.dart for a walkthrough of how to use the bindings to:
- Create a new mnemonic and derive BIP84 descriptors.
- Instantiate a wallet backed by the in-memory persister.
- Reveal addresses and persist staged changes.
- Optionally sync with Electrum over TLS.
Run it with:
dart run example/main.dartIf you have the Rust toolchain installed, the native library will be automatically built by Dart's Native Assets system.
As a user of the package, you don't need to worry about building the native library or bindings yourself.
Only if you want to contribute to the bindings or modify the native code yourself, you can follow the instructions in development below.
The first build can take several minutes depending on your machine and network (subsequent builds are faster).
We pin git dependencies to immutable refs for reproducibility. bdk-ffi and uniffi-dart both track upstream release tags.
-
Modify the native Rust code and configuration files in
native/as needed. -
Run the bindings generator script:
just generate-bindings
This experimental integration workspace is licensed under the MIT License.