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
<a href="https://blog.rust-lang.org/2025/02/20/Rust-1.85.0/"><img alt="Rustc Version 1.85.0+" src="https://img.shields.io/badge/rustc-1.85.0%2B-lightgrey.svg"/></a>
19
17
<a href="https://discord.gg/d7NkDKm"><img alt="Chat on Discord" src="https://img.shields.io/discord/753336465005608961?logo=discord"></a>
20
18
</p>
@@ -29,25 +27,88 @@
29
27
## About
30
28
31
29
The `bdk_wallet` project provides a high level descriptor based wallet API for building Bitcoin applications.
32
-
It is built upon the excellent [`rust-bitcoin`] and [`rust-miniscript`] crates.
33
30
34
31
## Architecture
35
32
36
-
There is currently only one published crate in this repository:
33
+
[`bdk_wallet`] contains the central high level [`Wallet`] type that is built from the other low-level components.
37
34
38
-
-[`wallet`](./wallet): Contains the central high level `Wallet` type that is built from the low-level mechanisms provided by the other components.
35
+
Core BDK crates that `bdk_wallet` depends on are found in the [`bdk`] repository. This works by
36
+
leveraging the functionality in [`rust-bitcoin`] and [`rust-miniscript`].
39
37
40
-
Crates that `bdk_wallet` depends on are found in the [`bdk`] repository.
38
+
# BDK Wallet
41
39
42
-
Fully working examples of how to use these components are in `/examples`:
40
+
The `bdk_wallet` provides the [`Wallet`] type which is a simple, high-level
41
+
interface built from the low-level components of [`bdk_chain`]. `Wallet` is a good starting point
42
+
for many simple applications as well as a good demonstration of how to use the other mechanisms to
43
+
construct a wallet. It has two keychains (external and internal) that are defined by
44
+
[miniscript descriptors][`rust-miniscript`] and uses them to generate addresses. When you give it
45
+
chain data it also uses the descriptors to find transaction outputs owned by them. From there, you
46
+
can create and sign transactions.
43
47
44
-
-[`example_wallet_esplora_blocking`](examples/example_wallet_esplora_blocking): Uses the `Wallet` to sync and spend using the Esplora blocking interface.
45
-
-[`example_wallet_esplora_async`](examples/example_wallet_esplora_async): Uses the `Wallet` to sync and spend using the Esplora asynchronous interface.
46
-
-[`example_wallet_electrum`](examples/example_wallet_electrum): Uses the `Wallet` to sync and spend using Electrum.
48
+
For details about the API of `Wallet` see the [module-level documentation][`Wallet`].
// Create a wallet with initial wallet data read from the file store.
88
+
let network = Network::Testnet;
89
+
let descriptor = "wpkh(tprv8ZgxMBicQKsPdcAqYBpzAFwU5yxBUo88ggoBqu1qPcHUfSbKK1sKMLmC7EAk438btHQrSdu3jGGQa6PA71nvH5nkDexhLteJqkM4dQmWF9g/84'/1'/0'/0/*)";
90
+
let change_descriptor = "wpkh(tprv8ZgxMBicQKsPdcAqYBpzAFwU5yxBUo88ggoBqu1qPcHUfSbKK1sKMLmC7EAk438btHQrSdu3jGGQa6PA71nvH5nkDexhLteJqkM4dQmWF9g/84'/1'/0'/1/*)";
0 commit comments