Skip to content

chore: split bdk_wallet into it's own repository #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/code_coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
- name: Make coverage directory
run: mkdir coverage
- name: Run grcov
run: grcov . --binary-path ./target/debug/ -s . -t lcov --branch --ignore-not-existing --keep-only '**/crates/**' --ignore '**/tests/**' --ignore '**/examples/**' -o ./coverage/lcov.info
run: grcov . --binary-path ./target/debug/ -s . -t lcov --branch --ignore-not-existing --keep-only '**/wallet/**' --ignore '**/tests/**' --ignore '**/examples/**' -o ./coverage/lcov.info
- name: Generate HTML coverage report
run: genhtml -o coverage-report.html --ignore-errors unmapped ./coverage/lcov.info
- name: Coveralls upload
Expand Down
39 changes: 5 additions & 34 deletions .github/workflows/cont_integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ jobs:
- version: ${{ needs.prepare.outputs.rust_version }}
clippy: true
- version: 1.63.0 # Overall MSRV
- version: 1.75.0 # Specific MSRV for `bdk_electrum`
features:
- --no-default-features --features miniscript/no-std,bdk_chain/hashbrown
- --all-features
Expand All @@ -44,28 +43,15 @@ jobs:
profile: minimal
- name: Rust Cache
uses: Swatinem/[email protected]
- name: Pin dependencies for 1.75
if: matrix.rust.version == '1.75.0'
run: |
cargo update -p home --precise "0.5.9"
cargo update -p native-tls --precise "0.2.13"
cargo update -p idna_adapter --precise "1.1.0"
cargo update -p base64ct --precise "1.6.0"
cargo update -p minreq --precise "2.13.2"
- name: Pin dependencies for MSRV
if: matrix.rust.version == '1.63.0'
run: ./ci/pin-msrv.sh
- name: Build + Test
env:
MATRIX_RUST_VERSION: ${{ matrix.rust.version }}
run: |
if [ $MATRIX_RUST_VERSION = '1.63.0' ]; then
cargo build --workspace --exclude 'example_*' --exclude 'bdk_electrum' ${{ matrix.features }}
cargo test --workspace --exclude 'example_*' --exclude 'bdk_electrum' ${{ matrix.features }}
else
cargo build --workspace --exclude 'example_*' ${{ matrix.features }}
cargo test --workspace --exclude 'example_*' ${{ matrix.features }}
fi
cargo build --workspace --exclude 'example_*' ${{ matrix.features }}
cargo test --workspace --exclude 'example_*' ${{ matrix.features }}

check-no-std:
needs: prepare
Expand All @@ -85,18 +71,10 @@ jobs:
# target: "thumbv6m-none-eabi"
- name: Rust Cache
uses: Swatinem/[email protected]
- name: Check bdk_chain
working-directory: ./crates/chain
# TODO "--target thumbv6m-none-eabi" should work but currently does not
run: cargo check --no-default-features --features miniscript/no-std,hashbrown
- name: Check bdk wallet
working-directory: ./crates/wallet
working-directory: ./wallet
# TODO "--target thumbv6m-none-eabi" should work but currently does not
run: cargo check --no-default-features --features miniscript/no-std,bdk_chain/hashbrown
- name: Check esplora
working-directory: ./crates/esplora
# TODO "--target thumbv6m-none-eabi" should work but currently does not
run: cargo check --no-default-features --features bdk_chain/hashbrown

check-wasm:
needs: prepare
Expand Down Expand Up @@ -124,11 +102,8 @@ jobs:
- name: Rust Cache
uses: Swatinem/[email protected]
- name: Check bdk wallet
working-directory: ./crates/wallet
working-directory: ./wallet
run: cargo check --target wasm32-unknown-unknown --no-default-features --features miniscript/no-std,bdk_chain/hashbrown
- name: Check esplora
working-directory: ./crates/esplora
run: cargo check --target wasm32-unknown-unknown --no-default-features --features bdk_core/hashbrown,async

fmt:
needs: prepare
Expand Down Expand Up @@ -179,10 +154,6 @@ jobs:
strategy:
matrix:
example-dir:
- example_cli
- example_bitcoind_rpc_polling
- example_electrum
- example_esplora
- example_wallet_electrum
- example_wallet_esplora_async
- example_wallet_esplora_blocking
Expand All @@ -201,5 +172,5 @@ jobs:
- name: Rust Cache
uses: Swatinem/[email protected]
- name: Build
working-directory: example-crates/${{ matrix.example-dir }}
working-directory: examples/${{ matrix.example-dir }}
run: cargo build
21 changes: 5 additions & 16 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,22 +1,11 @@
[workspace]
resolver = "2"
members = [
"crates/wallet",
"crates/chain",
"crates/core",
"crates/file_store",
"crates/electrum",
"crates/esplora",
"crates/bitcoind_rpc",
"crates/testenv",
"example-crates/example_cli",
"example-crates/example_electrum",
"example-crates/example_esplora",
"example-crates/example_bitcoind_rpc_polling",
"example-crates/example_wallet_electrum",
"example-crates/example_wallet_esplora_blocking",
"example-crates/example_wallet_esplora_async",
"example-crates/example_wallet_rpc",
"wallet",
"examples/example_wallet_electrum",
"examples/example_wallet_esplora_blocking",
"examples/example_wallet_esplora_async",
"examples/example_wallet_rpc",
]

[workspace.package]
Expand Down
48 changes: 17 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# The Bitcoin Dev Kit
# The Bitcoin Dev Kit Wallet

<div align="center">
<h1>BDK</h1>
<h1>BDK Wallet</h1>

<img src="./static/bdk.png" width="220" />

Expand All @@ -11,9 +11,9 @@

<p>
<a href="https://crates.io/crates/bdk_wallet"><img alt="Crate Info" src="https://img.shields.io/crates/v/bdk_wallet.svg"/></a>
<a href="https://github.com/bitcoindevkit/bdk/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>
<a href="https://github.com/bitcoindevkit/bdk/actions?query=workflow%3ACI"><img alt="CI Status" src="https://github.com/bitcoindevkit/bdk/workflows/CI/badge.svg"></a>
<a href="https://coveralls.io/github/bitcoindevkit/bdk?branch=master"><img src="https://coveralls.io/repos/github/bitcoindevkit/bdk/badge.svg?branch=master"/></a>
<a href="https://github.com/bitcoindevkit/bdk_wallet/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>
<a href="https://github.com/bitcoindevkit/bdk_wallet/actions?query=workflow%3ACI"><img alt="CI Status" src="https://github.com/bitcoindevkit/bdk_wallet/workflows/CI/badge.svg"></a>
<a href="https://coveralls.io/github/bitcoindevkit/bdk_wallet?branch=master"><img src="https://coveralls.io/repos/github/bitcoindevkit/bdk_wallet/badge.svg?branch=master"/></a>
<a href="https://docs.rs/bdk_wallet"><img alt="Wallet API Docs" src="https://img.shields.io/badge/docs.rs-bdk_wallet-green"/></a>
<a href="https://blog.rust-lang.org/2022/08/11/Rust-1.63.0.html"><img alt="Rustc Version 1.63.0+" src="https://img.shields.io/badge/rustc-1.63.0%2B-lightgrey.svg"/></a>
<a href="https://discord.gg/d7NkDKm"><img alt="Chat on Discord" src="https://img.shields.io/discord/753336465005608961?logo=discord"></a>
Expand All @@ -28,44 +28,30 @@

## About

The `bdk` libraries aims to provide well engineered and reviewed components for Bitcoin based applications.
The `bdk_wallet` project provides a high level descriptor based wallet API for building Bitcoin applications.
It is built upon the excellent [`rust-bitcoin`] and [`rust-miniscript`] crates.

## Architecture

The project is split up into several crates in the `/crates` directory:
There is currently only one published crate in this repository:

- [`wallet`](./crates/wallet): Contains the central high level `Wallet` type that is built from the low-level mechanisms provided by the other components
- [`chain`](./crates/chain): Tools for storing and indexing chain data
- [`file_store`](./crates/file_store): Persistence backend for storing chain data in a single file. Intended for testing and development purposes, not for production.
- [`esplora`](./crates/esplora): Extends the [`esplora-client`] crate with methods to fetch chain data from an esplora HTTP server in the form that [`bdk_chain`] and `Wallet` can consume.
- [`electrum`](./crates/electrum): Extends the [`electrum-client`] crate with methods to fetch chain data from an electrum server in the form that [`bdk_chain`] and `Wallet` can consume.
- [`wallet`](./wallet): Contains the central high level `Wallet` type that is built from the low-level mechanisms provided by the other components.

Crates that `bdk_wallet` depends on are found in the [`bdk`] repository.

Fully working examples of how to use these components are in `/example-crates`:
- [`example_cli`](./example-crates/example_cli): Library used by the `example_*` crates. Provides utilities for syncing, showing the balance, generating addresses and creating transactions without using the bdk_wallet `Wallet`.
- [`example_electrum`](./example-crates/example_electrum): A command line Bitcoin wallet application built on top of `example_cli` and the `electrum` crate. It shows the power of the bdk tools (`chain` + `file_store` + `electrum`), without depending on the main `bdk_wallet` library.
- [`example_esplora`](./example-crates/example_esplora): A command line Bitcoin wallet application built on top of `example_cli` and the `esplora` crate. It shows the power of the bdk tools (`chain` + `file_store` + `esplora`), without depending on the main `bdk_wallet` library.
- [`example_bitcoind_rpc_polling`](./example-crates/example_bitcoind_rpc_polling): A command line Bitcoin wallet application built on top of `example_cli` and the `bitcoind_rpc` crate. It shows the power of the bdk tools (`chain` + `file_store` + `bitcoind_rpc`), without depending on the main `bdk_wallet` library.
- [`example_wallet_esplora_blocking`](./example-crates/example_wallet_esplora_blocking): Uses the `Wallet` to sync and spend using the Esplora blocking interface.
- [`example_wallet_esplora_async`](./example-crates/example_wallet_esplora_async): Uses the `Wallet` to sync and spend using the Esplora asynchronous interface.
- [`example_wallet_electrum`](./example-crates/example_wallet_electrum): Uses the `Wallet` to sync and spend using Electrum.
Fully working examples of how to use these components are in `/examples`:

- [`example_wallet_esplora_blocking`](examples/example_wallet_esplora_blocking): Uses the `Wallet` to sync and spend using the Esplora blocking interface.
- [`example_wallet_esplora_async`](examples/example_wallet_esplora_async): Uses the `Wallet` to sync and spend using the Esplora asynchronous interface.
- [`example_wallet_electrum`](examples/example_wallet_electrum): Uses the `Wallet` to sync and spend using Electrum.

[`bdk`]: https://github.com/bitcoindevkit/bdk
[`rust-miniscript`]: https://github.com/rust-bitcoin/rust-miniscript
[`rust-bitcoin`]: https://github.com/rust-bitcoin/rust-bitcoin
[`esplora-client`]: https://docs.rs/esplora-client/
[`electrum-client`]: https://docs.rs/electrum-client/
[`bdk_chain`]: https://docs.rs/bdk-chain/

## Minimum Supported Rust Version (MSRV)
The BDK library maintains a MSRV of 1.63.0. This includes the following crates:

- `bdk_core`
- `bdk_chain`
- `bdk_bitcoind_rpc`.
- `bdk_esplora`.
- `bdk_wallet`.

The MSRV of `bdk_electrum` is 1.75.0.
The libraries in this repository maintain a MSRV of 1.63.0.

To build with the MSRV of 1.63.0 you will need to pin dependencies by running the [`pin-msrv.sh`](./ci/pin-msrv.sh) script.

Expand Down
10 changes: 1 addition & 9 deletions ci/pin-msrv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,13 @@ set -euo pipefail
# cargo clean
# rustup override set 1.63.0

cargo update -p zstd-sys --precise "2.0.8+zstd.1.5.5"
cargo update -p time --precise "0.3.20"
cargo update -p home --precise "0.5.5"
cargo update -p proptest --precise "1.2.0"
cargo update -p url --precise "2.5.0"
cargo update -p tokio --precise "1.38.1"
cargo update -p tokio-util --precise "0.7.11"
cargo update -p indexmap --precise "2.5.0"
cargo update -p security-framework-sys --precise "2.11.1"
cargo update -p csv --precise "1.3.0"
cargo update -p unicode-width --precise "0.1.13"
cargo update -p native-tls --precise "0.2.13"
cargo update -p flate2 --precise "1.0.35"
cargo update -p bzip2-sys --precise "0.1.12"
cargo update -p ring --precise "0.17.12"
cargo update -p once_cell --precise "1.20.3"
cargo update -p base64ct --precise "1.6.0"
cargo update -p minreq --precise "2.13.2"
cargo update -p native-tls --precise "0.2.13"
23 changes: 0 additions & 23 deletions crates/bitcoind_rpc/CHANGELOG.md

This file was deleted.

35 changes: 0 additions & 35 deletions crates/bitcoind_rpc/Cargo.toml

This file was deleted.

3 changes: 0 additions & 3 deletions crates/bitcoind_rpc/README.md

This file was deleted.

21 changes: 0 additions & 21 deletions crates/bitcoind_rpc/examples/README.md

This file was deleted.

Loading
Loading