Skip to content

Commit 7c2dc52

Browse files
RandyMcMillanthunderbiscuit
authored andcommitted
docs: update readme
1 parent 6f61d2e commit 7c2dc52

File tree

1 file changed

+54
-31
lines changed

1 file changed

+54
-31
lines changed

README.md

Lines changed: 54 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -31,37 +31,50 @@ This project provides a command-line Bitcoin wallet application using the latest
3131
And yes, it can do Taproot!!
3232

3333
This crate can be used for the following purposes:
34-
- Instantly create a miniscript based wallet and connect to your backend of choice (Electrum, Esplora, Core RPC, etc) and quickly play around with your own complex bitcoin scripting workflow. With one or many wallets, connected with one or many backends.
35-
- The `tests/integration.rs` module is used to document high level complex workflows between BDK and different Bitcoin infrastructure systems, like Core, Electrum and Lightning(soon TM).
36-
- (Planned) Expose the basic command handler via `wasm` to integrate `bdk-cli` functionality natively into the web platform. See also the [playground](https://bitcoindevkit.org/bdk-cli/playground/) page.
34+
35+
- Instantly create a miniscript based wallet and connect to your backend of choice (Electrum, Esplora, Core RPC, etc) and quickly play around with your own complex bitcoin scripting workflow. With one or many wallets, connected with one or many backends.
36+
- The `tests/integration.rs` module is used to document high level complex workflows between BDK and different Bitcoin infrastructure systems, like Core, Electrum and Lightning(soon TM).
37+
- (Planned) Expose the basic command handler via `wasm` to integrate `bdk-cli` functionality natively into the web platform. See also the [playground](https://bitcoindevkit.org/bdk-cli/playground/) page.
3738

3839
If you are considering using BDK in your own wallet project bdk-cli is a nice playground to get started with. It allows easy testnet and regtest wallet operations, to try out what's possible with descriptors, miniscript, and BDK APIs. For more information on BDK refer to the [website](https://bitcoindevkit.org/) and the [rust docs](https://docs.rs/bdk/latest/bdk/index.html)
3940

40-
bdk-cli can be compiled with different features to suit your experimental needs.
41-
- Database Options
42-
- `key-value-db` : Sets the wallet database to a `sled` db.
43-
- `sqlite-db` : Sets the wallet database to a `sqlite3` db.
44-
- Blockchain Options
45-
- `rpc` : Connects the wallet to bitcoin core via RPC.
46-
- `electrum` : Connects the wallet to an electrum server.
47-
- `esplora-ureq` or `esplora-reqwest` : Connects the wallet to an esplora server synchronously or asynchronously.
48-
- Extra Utility Tools
49-
- `repl` : use bdk-cli as a [REPL](https://codewith.mu/en/tutorials/1.0/repl) shell (useful for quick manual testing of wallet operations).
50-
- `compiler` : opens up bdk-cli policy compiler commands.
51-
- `verify` : uses `bitcoinconsensus` to verify transactions at every `sync` call of the wallet.
52-
- `reserves` : opens up bdk-cli **Proof of Reserves** operation commands using the [bdk-reserves plugin](https://github.com/bitcoindevkit/bdk-reserves). (requires the `electrum` feature)
53-
- Automated Node Backend
54-
- `regtest-bitcoin` : Auto deploys a regtest `bitcoind` node, connects the wallet, and exposes core rpc commands via `bdk-cli node` subcommands.
55-
- `regtest-electrum` : Auto deploys `electrsd` and connected `bitcoind` nodes, exposes core rpc commands via `bdk-cli node` and provides a wallet connected to the local `electrsd`.
56-
57-
The `default` feature set is `repl` and `sqlite-db`. With the `default` features, `bdk-cli` can be used as an **air-gapped** wallet, and can do everything that doesn't require a network connection.
41+
`bdk-cli` can be [compiled from source](#from-source) or [installed from crates.io](#from-crates) with different features to suit your experimental needs.
42+
43+
### Features:
44+
45+
- Database
46+
- `key-value-db` : Sets the wallet database to a `sled` db.
47+
- `sqlite-db` : Sets the wallet database to a `sqlite3` db.
48+
49+
- Blockchain
50+
- `rpc` : Connects the wallet to bitcoin core via RPC.
51+
- `electrum` : Connects the wallet to an electrum server.
52+
- `esplora-ureq` or `esplora-reqwest` : Connects the wallet to an esplora server synchronously or asynchronously.
53+
54+
### Additional Features:
55+
56+
- `repl` : use `bdk-cli` as a [REPL](https://codewith.mu/en/tutorials/1.0/repl) shell (useful for quick manual testing of wallet operations).
57+
58+
- `compiler` : opens up `bdk-cli` policy compiler commands.
5859

60+
- `verify` : uses `bitcoinconsensus` to verify transactions at every `sync` call of the wallet.
61+
62+
- `reserves` : opens up `bdk-cli` **Proof of Reserves** operation commands using the [bdk-reserves plugin](https://github.com/bitcoindevkit/bdk-reserves). (requires the `electrum` feature)
63+
64+
- Automated Node Backend
65+
- `regtest-bitcoin` : Auto deploys a regtest `bitcoind` node, connects the wallet, and exposes core rpc commands via `bdk-cli node` subcommands.
66+
- `regtest-electrum` : Auto deploys `electrsd` and connected `bitcoind` nodes, exposes core rpc commands via `bdk-cli node` and provides a wallet connected to the local `electrsd`.
67+
68+
69+
_Note: The `default` feature set is `repl` and `sqlite-db` and enables `bdk-cli` to be used as an **air-gapped** wallet, and doesn't require a network connection._
5970

6071
## Install bdk-cli
61-
### From source
72+
73+
### <a name="from-source"></a>From source
74+
6275
To install a dev version of `bdk-cli` from a local git repo with the `electrum` blockchain client enabled:
6376

64-
```shell
77+
```sh
6578
cd <bdk-cli git repo directory>
6679
cargo install --path . --features electrum
6780
bdk-cli help # to verify it worked
@@ -72,50 +85,56 @@ disabled. To enable these commands a blockchain client feature such as `electrum
7285
blockchain client feature must be enabled. Below is an example of how to run the `bdk-cli` binary with
7386
the `esplora-ureq` blockchain client feature.
7487

75-
```shell
88+
```sh
7689
RUST_LOG=debug cargo run --features esplora-ureq -- wallet --descriptor "wpkh(tpubEBr4i6yk5nf5DAaJpsi9N2pPYBeJ7fZ5Z9rmN4977iYLCGco1VyjB9tvvuvYtfZzjD5A8igzgw3HeWeeKFmanHYqksqZXYXGsw5zjnj7KM9/*)" sync
7790
```
7891

7992
At most one blockchain feature can be enabled, available blockchain client features are:
8093
`electrum`, `esplora-ureq` (blocking), `esplora-reqwest` (async) and `rpc`.
8194

82-
### From crates.io
95+
### <a name="from-crates"></a>From crates.io
96+
8397
You can install the binary for the latest tag of `bdk-cli` with online wallet features
8498
directly from [crates.io](https://crates.io/crates/bdk-cli) with a command as below:
99+
85100
```sh
86101
cargo install bdk-cli --features electrum
87102
```
88103

104+
```sh
105+
cargo install bdk-cli --features electrum,compiler,...
106+
```
107+
89108
### bdk-cli bin usage examples
90109

91110
To get usage information for the `bdk-cli` binary use the below command which returns a list of
92111
available wallet options and commands:
93112

94-
```shell
113+
```sh
95114
cargo run
96115
```
97116

98117
To sync a wallet to the default electrum server:
99118

100-
```shell
119+
```sh
101120
cargo run --features electrum -- wallet --descriptor "wpkh(tpubEBr4i6yk5nf5DAaJpsi9N2pPYBeJ7fZ5Z9rmN4977iYLCGco1VyjB9tvvuvYtfZzjD5A8igzgw3HeWeeKFmanHYqksqZXYXGsw5zjnj7KM9/*)" sync
102121
```
103122

104123
To sync a wallet to a Bitcoin Core node (assuming a regtest node at 127.0.0.1:18443) using the core rpc:
105124

106-
```shell
125+
```sh
107126
cargo run --features rpc -- --network regtest wallet --node 127.0.0.1:18443 --descriptor "wpkh(tpubEBr4i6yk5nf5DAaJpsi9N2pPYBeJ7fZ5Z9rmN4977iYLCGco1VyjB9tvvuvYtfZzjD5A8igzgw3HeWeeKFmanHYqksqZXYXGsw5zjnj7KM9/*)" sync
108127
```
109128

110129
To get a wallet balance with customized logging:
111130

112-
```shell
131+
```sh
113132
RUST_LOG=debug,sled=info,rustls=info cargo run -- wallet --descriptor "wpkh(tpubEBr4i6yk5nf5DAaJpsi9N2pPYBeJ7fZ5Z9rmN4977iYLCGco1VyjB9tvvuvYtfZzjD5A8igzgw3HeWeeKFmanHYqksqZXYXGsw5zjnj7KM9/*)" get_balance
114133
```
115134

116135
To generate a new extended master key, suitable for use in a descriptor:
117136

118-
```shell
137+
```sh
119138
cargo run -- key generate
120139
```
121140

@@ -125,7 +144,7 @@ This library should always compile with any valid combination of features on Rus
125144

126145
To build with the MSRV you will need to pin the below dependency versions:
127146

128-
```shell
147+
```sh
129148
# log 0.4.19 has MSRV 1.60.0
130149
cargo update -p log --precise 0.4.18
131150
# required for sqlite, hashlink 0.8.2 has MSRV 1.61.0
@@ -142,6 +161,10 @@ cargo update -p flate2 --precise 1.0.26
142161
```
143162

144163
## Resources
164+
145165
Docs: [bitcoindevkit.org CLI Section](https://bitcoindevkit.org/bdk-cli/installation/)
166+
146167
Episode on the _Bitcoin Developers Show_: [Youtube](https://www.youtube.com/watch?v=-Q8OD8NCEe4)
168+
147169
Video Tutorials: [Youtube Playlist](https://www.youtube.com/playlist?list=PLmyfVqsSelG3jSobvpY3GoNKDtAumsrg3)
170+

0 commit comments

Comments
 (0)