The Breez SDK provides developers with an end-to-end solution for integrating self-custodial Lightning into their apps and services. It eliminates the need for third parties, simplifies the complexities of Bitcoin and Lightning, and enables seamless onboarding for billions of users to the future of value transfer.
It’s a nodeless integration that offers a self-custodial, end-to-end solution for integrating Lightning payments, utilizing Spark with on-chain interoperability and third-party fiat on-ramps.
To install the package:
$ go get github.com/breez/breez-sdk-spark-go
This package embeds the Breez SDK - Nodeless (Spark Implementation) runtime compiled as shared library objects, and uses cgo
to consume it. A set of precompiled shared library objects are provided. Thus this package works (and is tested) on the following platforms:
Platform | Architecture | Triple | Status |
---|---|---|---|
Android | amd64 |
x86_64-linux-android |
✅ |
aarch64 |
aarch64-linux-android |
✅ | |
Darwin | amd64 |
x86_64-apple-darwin |
✅ |
aarch64 |
aarch64-apple-darwin |
✅ | |
Linux | amd64 |
x86_64-unknown-linux-gnu |
✅ |
aarch64 |
aarch64-unknown-linux-gnu |
✅ | |
Windows | amd64 |
x86_64-pc-windows-msvc |
✅ |
Head over to the Breez SDK - Nodeless (Spark Implementation) documentation to start implementing Lightning in your app.
package main
import (
"github.com/breez/breez-sdk-spark-go/breez_sdk_spark"
)
func main() {
mnemonic := "abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about"
config := breez_sdk_spark.DefaultConfig(breez_sdk_spark.NetworkMainnet)
sdk, err := breez_sdk_spark.Connect(breez_sdk_spark.ConnectRequest{
Config: config,
Mnemonic: mnemonic,
StorageDir: "./.data",
})
}
For some platforms the provided binding libraries need to be copied into a location where they need to be found during runtime.
Copy the binding libraries into the jniLibs directory of your app
cp vendor/github.com/breez/breez-sdk-spark-go/breez_sdk_spark/lib/android-aarch64/*.so android/app/src/main/jniLibs/arm64-v8a/
cp vendor/github.com/breez/breez-sdk-spark-go/breez_sdk_spark/lib/android-amd64/*.so android/app/src/main/jniLibs/x86_64/
So they are in the following structure
└── android
├── app
└── src
└── main
└── jniLibs
├── arm64-v8a
├── libbreez_sdk_spark_bindings.so
└── libc++_shared.so
└── x86_64
├── libbreez_sdk_spark_bindings.so
└── libc++_shared.so
└── AndroidManifest.xml
└── build.gradle
└── build.gradle
Copy the binding library to the same directory as the executable file or include the library into the windows install packager.
cp vendor/github.com/breez/breez-sdk-spark-go/breez_sdk_spark/lib/windows-amd64/*.dll build/windows/
The Breez SDK is free for developers.
Have a question for the team? Join us on Telegram or email us at contact@breez.technology.
This repository is used to publish a Go package providing Go bindings to the Breez SDK - Nodeless (Spark Implementation)'s underlying Rust implementation. The Go bindings are generated using UniFFi Bindgen Go.
Any changes to Breez SDK - Nodeless (Spark Implementation), the Go bindings, and the configuration of this Go package must be made via the spark-sdk repository.