You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+25-10Lines changed: 25 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
# Native language bindings for BDK
1
+
# Language bindings for BDK
2
2
3
3
<p>
4
4
<a href="https://github.com/bitcoindevkit/bdk-ffi/blob/master/LICENSE"><img alt="MIT or Apache-2.0 Licensed" src="https://img.shields.io/badge/license-MIT%2FApache--2.0-blue.svg"/></a>
@@ -8,22 +8,25 @@
8
8
</p>
9
9
10
10
## Readme
11
+
11
12
The workspace in this repository creates the `libbdkffi` multi-language library for the Rust-based
12
13
[bdk] library from the [Bitcoin Dev Kit] project.
13
14
14
15
Each supported language and the platform(s) it's packaged for has its own directory. The Rust code in this project is in the bdk-ffi directory and is a wrapper around the [bdk] library to expose its APIs in a uniform way using the [mozilla/uniffi-rs] bindings generator for each supported target language.
15
16
16
17
## Supported target languages and platforms
18
+
17
19
The below directories (a separate repository in the case of bdk-swift) include instructions for using, building, and publishing the native language binding for [bdk] supported by this project.
18
20
19
21
| Language | Platform | Published Package | Building Documentation | API Docs |
| Kotlin | JVM |[bdk-jvm]|[Readme bdk-jvm]|[Kotlin JVM API Docs]|
24
+
| Kotlin | Android |[bdk-android]|[Readme bdk-android]|[Android API Docs]|
25
+
| Swift | iOS, macOS |[bdk-swift]|[Readme bdk-swift]||
26
+
| Python | linux, macOS, Windows |[bdk-python]|[Readme bdk-python]||
27
+
28
+
## Building and testing the libraries
25
29
26
-
## Building and Testing the Libraries
27
30
If you are familiar with the build tools for the specific languages you wish to build the libraries for, you can use their normal build/test workflows. We also include some [just](https://just.systems/) files to simplify the work across different languages. If you have the just tool installed on your system, you can simply call the commands defined in the `justfile`s, for example:
28
31
```sh
29
32
cd bdk-android
@@ -34,20 +37,25 @@ just publishlocal
34
37
```
35
38
36
39
## Minimum Supported Rust Version (MSRV)
40
+
37
41
This library should compile with any combination of features with Rust 1.84.1.
38
42
39
43
## Contributing
44
+
40
45
To add new structs and functions, see the [UniFFI User Guide](https://mozilla.github.io/uniffi-rs/) and the [uniffi-examples](https://thunderbiscuit.github.io/uniffi-examples/) repository.
41
46
42
47
## Goals
48
+
43
49
1. Language bindings should feel idiomatic in target languages/platforms
44
50
2. Adding new targets should be easy
45
51
3. Getting up and running should be easy
46
52
4. Contributing should be easy
47
53
5. Get it right, then automate
48
54
49
55
## Using the libraries
56
+
50
57
### bdk-android
58
+
51
59
```kotlin
52
60
// build.gradle.kts
53
61
repositories {
@@ -59,6 +67,7 @@ dependencies {
59
67
```
60
68
61
69
### bdk-jvm
70
+
62
71
```kotlin
63
72
// build.gradle.kts
64
73
repositories {
@@ -71,18 +80,22 @@ dependencies {
71
80
72
81
_Note:_ We also publish snapshot versions of bdk-jvm and bdk-android. See the specific readmes for instructions on how to use those.
73
82
74
-
### bdk-python
83
+
### bdkpython
84
+
75
85
```shell
76
86
pip3 install bdkpython
77
87
```
78
88
79
-
### bdk-swift
80
-
Add bdk-swift to your dependencies in XCode.
89
+
### BitcoinDevKit (Swift)
90
+
91
+
Add `BitcoinDevKit` to your dependencies in XCode.
81
92
82
93
## Developing language bindings using uniffi-rs
94
+
83
95
If you are interested in better understanding the base structure we use here in order to build your own Rust-to-Kotlin/Swift/Python language bindings, check out the [uniffi-bindings-template](https://github.com/thunderbiscuit/uniffi-bindings-template) repository. We maintain it as an example and starting point for other projects that wish to leverage the tech stack used in producing the BDK language bindings.
84
96
85
97
## Verifying Signatures
98
+
86
99
Both libraries and all their corresponding artifacts are signed with a PGP key you can find in the
87
100
root of this repository. To verify the signatures follow the below steps:
88
101
@@ -121,12 +134,14 @@ gpg: Good signature from "bitcoindevkit-bindings <[email protected]>" [
2. Install Android SDK and Build-Tools for API level 30+
46
-
3. Setup `ANDROID_SDK_ROOT` and `ANDROID_NDK_ROOT` path variables which are required by the build tool. Note that currently, NDK version 25.2.9519653 or above is required. For example:
46
+
3. Setup `ANDROID_SDK_ROOT` and `ANDROID_NDK_ROOT` path variables which are required by the build tool. Note that currently, NDK version 27.2.12479018 or above is recommended. For example:
Copy file name to clipboardExpand all lines: bdk-jvm/README.md
+14-2Lines changed: 14 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -3,19 +3,23 @@
3
3
This project builds a .jar package for the JVM platform that provides Kotlin language bindings for the [BDK] libraries. The Kotlin language bindings are created by the `bdk-ffi` project which is included in the root of this repository.
4
4
5
5
## How to Use
6
+
6
7
To use the Kotlin language bindings for BDK in your JVM project add the following to your gradle dependencies:
Note that the commands assume you don't need the local libraries to be signed. If you do wish to sign them, simply set your `~/.gradle/gradle.properties` signing key values like so:
60
+
52
61
```properties
53
62
signing.gnupg.keyName=<YOUR_GNUPG_ID>
54
63
signing.gnupg.passphrase=<YOUR_GNUPG_PASSPHRASE>
55
64
```
56
65
57
66
and use the `publishToMavenLocal` task without the `localBuild` flag:
67
+
58
68
```shell
59
69
./gradlew publishToMavenLocal
60
70
```
61
71
62
72
## Known issues
73
+
63
74
## JNA dependency
75
+
64
76
Depending on the JVM version you use, you might not have the JNA dependency on your classpath. The exception thrown will be
0 commit comments