Commit 7df419a
committed
Merge #180: Adding descriptor generator
7d3720e feat(desc): remove generate subcommand (Vihiga Tyonum)
32a2c88 feat(desc):update descriptors gen to use templates (Vihiga Tyonum)
c8f23ba feat(descriptors): fix descriptor generation (Vihiga Tyonum)
550e816 feat(descriptors): add multipath descs and pretty (Vihiga Tyonum)
1f77842 fix descriptors generation (Vihiga Tyonum)
6c9c3a1 feat: add descriptor generation (AmosOO7)
Pull request description:
# Pull Request: Add `descriptor` Subcommand
## Description
This PR introduces a new `descriptor` subcommand to the BDK CLI that enable users to generate and inspect **Bitcoin wallet descriptors** for internal and external paths, supporting common types (pkh, sh, wpkh, wsh, tr). It includes support for both **single-path** descriptors from extended keys (`xprv`/`xpub` or `tprv`/`tpub`).
This resolves issue #175
## Features Implemented
- Adds new `descriptor` subcommand with:
- `generate` – generate new descriptors
- Supports BIP44, BIP49, BIP84, and BIP86 script types
- Generates **internal and external descriptors**
- Reasonable defaults:
- `--type` defaults to `wsh` and a short `t`
- `--network` default `testnet`
---
## Usage Examples
### 1. Generate Descriptors from an Extended Private Key
```bash
cargo run -- --network testnet descriptor generate --type wsh <XPRV>
```
### 2. Generate Descriptors from a Mnemonic (no key provided)
```bash
cargo run -- --network testnet descriptor generate --type tr
```
* [x] I've signed all my commits
* [x] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk-cli/blob/master/CONTRIBUTING.md)
* [x] I ran `cargo fmt` and `cargo clippy` before committing
#### New Features:
* [ ] I've added tests for the new feature
* [ ] I've added docs for the new feature
* [ ] I've updated `CHANGELOG.md`
ACKs for top commit:
notmandatory:
tACK 7d3720e
tvpeter:
ACK 7d3720e
Tree-SHA512: 38182e657ffeaec89c84c601f8c41482eee9962a1847eaf6a3ad8b55d01858e0d2a056248d5bd4090734787caedf1c11232bb56337c90d5451c2664ff3571b504 files changed
+350
-22
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
17 | 16 | | |
18 | 17 | | |
19 | 18 | | |
| |||
107 | 106 | | |
108 | 107 | | |
109 | 108 | | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
110 | 125 | | |
111 | | - | |
112 | 126 | | |
113 | 127 | | |
114 | 128 | | |
| |||
470 | 484 | | |
471 | 485 | | |
472 | 486 | | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
473 | 500 | | |
474 | 501 | | |
475 | 502 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | | - | |
| 8 | + | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | | - | |
20 | 18 | | |
21 | 19 | | |
22 | 20 | | |
23 | 21 | | |
| 22 | + | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
48 | 54 | | |
49 | 55 | | |
50 | 56 | | |
| |||
54 | 60 | | |
55 | 61 | | |
56 | 62 | | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | 63 | | |
68 | 64 | | |
69 | 65 | | |
| |||
1260 | 1256 | | |
1261 | 1257 | | |
1262 | 1258 | | |
| 1259 | + | |
| 1260 | + | |
| 1261 | + | |
| 1262 | + | |
1263 | 1263 | | |
1264 | 1264 | | |
1265 | 1265 | | |
| |||
1307 | 1307 | | |
1308 | 1308 | | |
1309 | 1309 | | |
| 1310 | + | |
| 1311 | + | |
| 1312 | + | |
| 1313 | + | |
| 1314 | + | |
1310 | 1315 | | |
1311 | 1316 | | |
1312 | 1317 | | |
| |||
1333 | 1338 | | |
1334 | 1339 | | |
1335 | 1340 | | |
| 1341 | + | |
| 1342 | + | |
| 1343 | + | |
| 1344 | + | |
| 1345 | + | |
| 1346 | + | |
| 1347 | + | |
| 1348 | + | |
| 1349 | + | |
| 1350 | + | |
| 1351 | + | |
| 1352 | + | |
| 1353 | + | |
| 1354 | + | |
| 1355 | + | |
| 1356 | + | |
| 1357 | + | |
| 1358 | + | |
| 1359 | + | |
| 1360 | + | |
| 1361 | + | |
| 1362 | + | |
| 1363 | + | |
| 1364 | + | |
| 1365 | + | |
| 1366 | + | |
| 1367 | + | |
| 1368 | + | |
| 1369 | + | |
1336 | 1370 | | |
1337 | 1371 | | |
1338 | 1372 | | |
| |||
0 commit comments