bitcoindevkit / bitcoindevkit/bdk-cli
Improve error message / accept descriptor key expressions in descriptor command
- 主要言語
- Rust
- スター
- 141
- フォーク
- 99
- 平均マージ
- 6日 14分
- マージ済み PR(30日)
- 1
説明
**Describe the enhancement**
`bdk-cli key derive` returns a descriptor key expression (e.g. `[fingerprint/path]xpub.../*`), while `bdk-cli descriptor` expects a raw `xpub`/`xprv`. Passing the output of `key derive` directly to `descriptor` results in:
```text
BIP32 error: base58 encoding error
```
The error doesn't explain that the input is a descriptor key expression rather than a raw extended key.
It would be helpful if `descriptor` either:-
* detected descriptor key expressions and emitted a more descriptive error or
* accepted descriptor key expressions directly.
---
**Use case**
A natural workflow is:
```text
key restore
↓
key derive
↓
descriptor
```
Since `key derive` produces a key intended for descriptors, it's reasonable to expect its output to be consumable by `descriptor`.
Instead, users encounter a low-level Base58 parsing error without any indication that the command expects a different representation.
---
**Additional context**
Reproducer:
```bash
bdk-cli key derive --xprv "tprv..." --derivation_path "m/84h/1h/0h"
```
Output:
```text
[bd2eb472/84'/1'/0']tprv.../*
```
Then:
```bash
bdk-cli descriptor --type wpkh "[bd2eb472/84'/1'/0']tprv.../*"
```
produces:
```text
BIP32 error: base58 encoding error
```
The same descriptor key expression works correctly when wrapped in a descriptor and passed to:
```bash
bdk-cli wallet config --ext-descriptor "wpkh([bd2eb472/84'/1'/0']tprv.../*)"
```
which suggests the underlying parsing is already supported in that context.
コントリビューションガイド
調査の方向性
まず、文書化された `key derive` と `descriptor` の再現手順を実行し、次に `bdk-cli key derive`、`descriptor`、`wallet config` のエントリーポイントを追跡して、それぞれの入力がどのように解析されるかを比較します。完了条件は、descriptor のキー式が `descriptor` によって直接受け入れられるか、期待される表現について明示的に説明したうえで拒否され、選択した動作をコマンドテストでカバーすることです。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- rust
- 領域
- cli
- issue の種類
- 機能追加
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 静か
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 55/100