Skip to content

Commit 4ef94df

Browse files
authored
Merge branch 'bitcoindevkit:master' into fix/FilterIter-may-not-handle-reorgs-properly
2 parents 6f20e8a + b707586 commit 4ef94df

File tree

58 files changed

+67
-22480
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+67
-22480
lines changed

.github/workflows/cont_integration.yml

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,6 @@ jobs:
8989
working-directory: ./crates/chain
9090
# TODO "--target thumbv6m-none-eabi" should work but currently does not
9191
run: cargo check --no-default-features --features miniscript/no-std,hashbrown
92-
- name: Check bdk wallet
93-
working-directory: ./crates/wallet
94-
# TODO "--target thumbv6m-none-eabi" should work but currently does not
95-
run: cargo check --no-default-features --features miniscript/no-std,bdk_chain/hashbrown
9692
- name: Check esplora
9793
working-directory: ./crates/esplora
9894
# TODO "--target thumbv6m-none-eabi" should work but currently does not
@@ -123,9 +119,6 @@ jobs:
123119
target: "wasm32-unknown-unknown"
124120
- name: Rust Cache
125121
uses: Swatinem/[email protected]
126-
- name: Check bdk wallet
127-
working-directory: ./crates/wallet
128-
run: cargo check --target wasm32-unknown-unknown --no-default-features --features miniscript/no-std,bdk_chain/hashbrown
129122
- name: Check esplora
130123
working-directory: ./crates/esplora
131124
run: cargo check --target wasm32-unknown-unknown --no-default-features --features bdk_core/hashbrown,async
@@ -183,10 +176,6 @@ jobs:
183176
- example_bitcoind_rpc_polling
184177
- example_electrum
185178
- example_esplora
186-
- example_wallet_electrum
187-
- example_wallet_esplora_async
188-
- example_wallet_esplora_blocking
189-
- example_wallet_rpc
190179
steps:
191180
- name: checkout
192181
uses: actions/checkout@v4
@@ -201,5 +190,5 @@ jobs:
201190
- name: Rust Cache
202191
uses: Swatinem/[email protected]
203192
- name: Build
204-
working-directory: example-crates/${{ matrix.example-dir }}
193+
working-directory: examples/${{ matrix.example-dir }}
205194
run: cargo build

Cargo.toml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,17 @@
11
[workspace]
22
resolver = "2"
33
members = [
4-
"crates/wallet",
54
"crates/chain",
65
"crates/core",
76
"crates/file_store",
87
"crates/electrum",
98
"crates/esplora",
109
"crates/bitcoind_rpc",
1110
"crates/testenv",
12-
"example-crates/example_cli",
13-
"example-crates/example_electrum",
14-
"example-crates/example_esplora",
15-
"example-crates/example_bitcoind_rpc_polling",
16-
"example-crates/example_wallet_electrum",
17-
"example-crates/example_wallet_esplora_blocking",
18-
"example-crates/example_wallet_esplora_async",
19-
"example-crates/example_wallet_rpc",
11+
"examples/example_cli",
12+
"examples/example_electrum",
13+
"examples/example_esplora",
14+
"examples/example_bitcoind_rpc_polling",
2015
]
2116

2217
[workspace.package]

README.md

Lines changed: 28 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,72 @@
11
# The Bitcoin Dev Kit
22

33
<div align="center">
4-
<h1>BDK</h1>
54

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

87
<p>
9-
<strong>A modern, lightweight, descriptor-based wallet library written in Rust!</strong>
8+
<strong>A suite of libraries for building modern, lightweight, descriptor-based wallets written in Rust!</strong>
109
</p>
1110

1211
<p>
13-
<a href="https://crates.io/crates/bdk_wallet"><img alt="Crate Info" src="https://img.shields.io/crates/v/bdk_wallet.svg"/></a>
1412
<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>
1513
<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>
1614
<a href="https://coveralls.io/github/bitcoindevkit/bdk?branch=master"><img src="https://coveralls.io/repos/github/bitcoindevkit/bdk/badge.svg?branch=master"/></a>
17-
<a href="https://docs.rs/bdk_wallet"><img alt="Wallet API Docs" src="https://img.shields.io/badge/docs.rs-bdk_wallet-green"/></a>
1815
<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>
1916
<a href="https://discord.gg/d7NkDKm"><img alt="Chat on Discord" src="https://img.shields.io/discord/753336465005608961?logo=discord"></a>
2017
</p>
2118

2219
<h4>
2320
<a href="https://bitcoindevkit.org">Project Homepage</a>
24-
<span> | </span>
25-
<a href="https://docs.rs/bdk_wallet">Documentation</a>
2621
</h4>
2722
</div>
2823

2924
## About
3025

31-
The `bdk` libraries aims to provide well engineered and reviewed components for Bitcoin based applications.
32-
It is built upon the excellent [`rust-bitcoin`] and [`rust-miniscript`] crates.
26+
The `bdk` libraries aim to provide well engineered and reviewed components for Bitcoin wallets and other applications.
27+
They are built upon the excellent [`rust-bitcoin`] and [`rust-miniscript`] crates.
3328

3429
## Architecture
3530

36-
The project is split up into several crates in the `/crates` directory:
31+
The workspace in this repository contains several crates in the `/crates` directory:
3732

38-
- [`wallet`](./crates/wallet): Contains the central high level `Wallet` type that is built from the low-level mechanisms provided by the other components
39-
- [`chain`](./crates/chain): Tools for storing and indexing chain data
40-
- [`file_store`](./crates/file_store): Persistence backend for storing chain data in a single file. Intended for testing and development purposes, not for production.
41-
- [`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.
42-
- [`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.
33+
| Sub-Directory | Description | Badges |
34+
|---------------|-------------|--------|
35+
| [`chain`](./crates/chain) | Tools for storing and indexing chain data. | ![Chain Crate Info](https://img.shields.io/crates/v/bdk_chain.svg) ![Chain API Docs](https://img.shields.io/badge/docs.rs-bdk_chain-green) |
36+
| [`core`](./crates/core) | A collection of core structures used by the [`bdk_chain`], [`bdk_wallet`], and BDK's chain data source crates. | ![Core Crate Info](https://img.shields.io/crates/v/bdk_core.svg) ![Core API Docs](https://img.shields.io/badge/docs.rs-bdk_core-green) |
37+
| [`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. | ![Esplora Crate Info](https://img.shields.io/crates/v/bdk_esplora.svg) ![Esplora API Docs](https://img.shields.io/badge/docs.rs-bdk_esplora-green) |
38+
| [`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. | ![Electrum Crate Info](https://img.shields.io/crates/v/bdk_electrum.svg) ![Electrum API Docs](https://img.shields.io/badge/docs.rs-bdk_electrum-green) |
39+
| [`bitcoind_rpc`](./crates/bitcoind_rpc) | Extends [`bitcoincore-rpc`] for emitting blockchain data from the `bitcoind` RPC interface in the form that [`bdk_chain`] and `Wallet` can consume. | ![BitcoinD RPC Crate Info](https://img.shields.io/crates/v/bdk_bitcoind_rpc.svg) ![BitcoinD RPC API Docs](https://img.shields.io/badge/docs.rs-bdk_bitcoind_rpc-green) |
40+
| [`file_store`](./crates/file_store) | Persistence backend for storing chain data in a single file. Intended for testing and development purposes, not for production. | ![File Store Crate Info](https://img.shields.io/crates/v/bdk_file_store.svg) ![File Store API Docs](https://img.shields.io/badge/docs.rs-bdk_file_store-green) |
4341

44-
Fully working examples of how to use these components are in `/example-crates`:
45-
- [`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`.
46-
- [`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.
47-
- [`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.
48-
- [`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.
49-
- [`example_wallet_esplora_blocking`](./example-crates/example_wallet_esplora_blocking): Uses the `Wallet` to sync and spend using the Esplora blocking interface.
50-
- [`example_wallet_esplora_async`](./example-crates/example_wallet_esplora_async): Uses the `Wallet` to sync and spend using the Esplora asynchronous interface.
51-
- [`example_wallet_electrum`](./example-crates/example_wallet_electrum): Uses the `Wallet` to sync and spend using Electrum.
42+
The [`bdk_wallet`] repository and crate contains a higher level `Wallet` type that depends on the above lower-level mechanism crates.
43+
44+
Fully working examples of how to use these components are in `/examples`:
45+
46+
- [`example_cli`](examples/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`.
47+
- [`example_electrum`](examples/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.
48+
- [`example_esplora`](examples/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.
49+
- [`example_bitcoind_rpc_polling`](examples/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.
5250

5351
[`rust-miniscript`]: https://github.com/rust-bitcoin/rust-miniscript
5452
[`rust-bitcoin`]: https://github.com/rust-bitcoin/rust-bitcoin
5553
[`esplora-client`]: https://docs.rs/esplora-client/
5654
[`electrum-client`]: https://docs.rs/electrum-client/
55+
[`bitcoincore-rpc`]: https://docs.rs/bitcoincore-rpc/
5756
[`bdk_chain`]: https://docs.rs/bdk-chain/
57+
[`bdk_wallet`]: https://github.com/bitcoindevkit/bdk_wallet
5858

5959
## Minimum Supported Rust Version (MSRV)
60-
The BDK library maintains a MSRV of 1.63.0. This includes the following crates:
60+
61+
The following BDK crates maintains a MSRV of 1.63.0. To build these crates with the MSRV of 1.63.0 you will need to pin dependencies by running the [`pin-msrv.sh`](./ci/pin-msrv.sh) script.
6162

6263
- `bdk_core`
6364
- `bdk_chain`
64-
- `bdk_bitcoind_rpc`.
65-
- `bdk_esplora`.
66-
- `bdk_wallet`.
67-
68-
The MSRV of `bdk_electrum` is 1.75.0.
65+
- `bdk_bitcoind_rpc`
66+
- `bdk_esplora`
67+
- `bdk_file_store`
6968

70-
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.
69+
The MSRV of the `bdk_electrum` crate is 1.75.0.
7170

7271
## License
7372

crates/chain/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ workspace = true
1919
bitcoin = { version = "0.32.0", default-features = false }
2020
bdk_core = { path = "../core", version = "0.4.1", default-features = false }
2121
serde = { version = "1", optional = true, features = ["derive", "rc"] }
22-
miniscript = { version = "12.0.0", optional = true, default-features = false }
22+
miniscript = { version = "12.3.1", optional = true, default-features = false }
2323

2424
# Feature dependencies
2525
rusqlite = { version = "0.31.0", features = ["bundled"], optional = true }

crates/chain/src/tx_graph.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1216,6 +1216,13 @@ impl<A: Anchor> TxGraph<A> {
12161216
self.try_list_expected_spk_txids(chain, chain_tip, indexer, spk_index_range)
12171217
.map(|r| r.expect("infallible"))
12181218
}
1219+
1220+
/// Construct a `TxGraph` from a `changeset`.
1221+
pub fn from_changeset(changeset: ChangeSet<A>) -> Self {
1222+
let mut graph = Self::default();
1223+
graph.apply_changeset(changeset);
1224+
graph
1225+
}
12191226
}
12201227

12211228
/// The [`ChangeSet`] represents changes to a [`TxGraph`].

crates/electrum/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
//!
1414
//! Refer to [`example_electrum`] for a complete example.
1515
//!
16-
//! [`example_electrum`]: https://github.com/bitcoindevkit/bdk/tree/master/example-crates/example_electrum
16+
//! [`example_electrum`]: https://github.com/bitcoindevkit/bdk/tree/master/examples/example_electrum
1717
//! [`SyncResponse`]: bdk_core::spk_client::SyncResponse
1818
//! [`FullScanResponse`]: bdk_core::spk_client::FullScanResponse
1919

crates/esplora/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ use bdk_esplora::EsploraExt;
4141
use bdk_esplora::EsploraAsyncExt;
4242
```
4343

44-
For full examples, refer to [`example_wallet_esplora_blocking`](https://github.com/bitcoindevkit/bdk/tree/master/example-crates/example_wallet_esplora_blocking) and [`example_wallet_esplora_async`](https://github.com/bitcoindevkit/bdk/tree/master/example-crates/example_wallet_esplora_async).
44+
For full examples, refer to [`example_wallet_esplora_blocking`](https://github.com/bitcoindevkit/bdk/tree/master/examples/example_wallet_esplora_blocking) and [`example_wallet_esplora_async`](https://github.com/bitcoindevkit/bdk/tree/master/examples/example_wallet_esplora_async).
4545

4646
[`esplora-client`]: https://docs.rs/esplora-client/
4747
[`bdk_chain`]: https://docs.rs/bdk-chain/

crates/file_store/CHANGELOG.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,31 @@ Contributors do not need to change this file but do need to add changelog detail
77
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
88
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
99

10+
## [file_store-0.19.0]
11+
12+
### Added:
13+
14+
- `StoreError` enum, which includes `Io`, `Bincode` and `InvalidMagicBytes` #1684.
15+
- docs: add "not intended for production" note in `README`.
16+
17+
### Changed:
18+
19+
- `Store::create_new` to `Store::create`, with new return type: `Result<Self, StoreError>`
20+
- `Store::open` to `Store::load`, with new return type: `Result<(Self, Option<C>), StoreErrorWithDump<C>>`
21+
- `Store::open_or_create` to `Store::load_or_create`, with new return type: `Result<(Option<C>, Self), StoreErrorWithDump<C>>`
22+
- `Store::aggregate_changesets` to `Store::dump`, with new return type: `Result<Option<C>, StoreErrorWithDump<C>>`
23+
- `FileError` to `StoreError`
24+
- `AggregateChangesetsError` to `StoreErrorWithDump`, which now can include all the variants of `StoreError` in the error field.
25+
26+
#### Removed:
27+
28+
- `IterError` deleted.
29+
1030
## [file_store-0.18.1]
1131

1232
### Changed
1333

1434
- Minor updates to fix new rustc 1.83.0 clippy warnings #1776
1535

16-
[file_store-0.18.1]: https://github.com/bitcoindevkit/bdk/releases/tag/file_store-0.18.1
36+
[file_store-0.18.1]: https://github.com/bitcoindevkit/bdk/releases/tag/file_store-0.18.1
37+
[file_store-0.19.0]: https://github.com/bitcoindevkit/bdk/releases/tag/file_store-0.19.0

crates/file_store/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "bdk_file_store"
3-
version = "0.18.1"
3+
version = "0.19.0"
44
edition = "2021"
55
license = "MIT OR Apache-2.0"
66
repository = "https://github.com/bitcoindevkit/bdk"

0 commit comments

Comments
 (0)