wallet sign command returns generic error for decoding failures
Maintainers usually reply within 3 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
Research direction
Start at the bdk-cli wallet sign command’s PSBT decoding path and trace how decoding failures become BDKCliError values. The issue points to existing PsbtParseError and DecodeError variants; check the error mapping and run the relevant CLI tests. Done means malformed PSBT input reports a descriptive Base64 decoding error instead of a generic one.
Written by the indexing model from the issue text.
Description
Describe the bug
When the bdk-cli wallet sign command is given a PSBT that cannot be decoded (e.g. malformed base64, truncated bytes, or invalid PSBT structure), the CLI returns a generic error instead of a descriptive one. The underlying BDKCliError already has a dedicated PsbtError and DecodeError variant, but the CLI appears to collapse decoding failures into Error::Generic, which makes it impossible for users to tell whether the problem is their PSBT, their wallet, or the signing step itself.
To Reproduce
-
Build
bdk-cliwith any wallet backend. -
Create a wallet and obtain a valid PSBT (or use an existing one).
-
Corrupt the PSBT string or send a invalid one:
bdk-cli wallet -w test_user1 sign --psbt "cHNidP8BAKkBAAAAAsoKb5SPcP0PpTjvnGo3b4ANmCiirV/br9mIOgkb6DqyAAAAAAD9////"
4. Observe the error output.
Expected behavior
The CLI should return a specific, actionable error that identifies the failure as a Base64 decoding problem.for example:
```text
Error: Base64 decode error: Invalid padding
rather than:
Error: Generic error: Invalid padding
Build environment
· BDK-CLI tag/commit: main
· OS+version: macOS 12.7.6 (Monterey)
· Rust/Cargo version: rustc --version output
· Rust/Cargo target: x86_64-apple-darwin
Additional context
The BDKCliError enum already includes a PsbtParseError and DecodeErrorvariant so the fix is simple. I'll like to work on it myself.
- Dominant language
- Rust
- Stars
- 142
- Forks
- 103
- Avg merge
- 5d 12h
- Merged PRs (30d)
- 6
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from bitcoindevkit/bdk-cli
-
Remove "wallet" field from `WalletConfigInner`Possibly taken @Jennycj claimed this 6 days ago. Openenhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
bitcoindevkit/bdk-cli#332 · 2 comments ·
Maintainers usually reply within 3 days
-
`warn!` output is invisible unless `RUST_LOG` is setPossibly taken @chukwudiikeh claimed this 3 days ago. Open
bitcoindevkit/bdk-cli#352 · 1 comment · 1 assignee ·
Maintainers usually reply within 3 days
-
Add wallet commands that returns a list of unused addressesPossibly taken A pull request linked to this issue is open or already merged. Openenhancement
Difficulty 3/5 1-2 days Newbie friendliness 38/100
bitcoindevkit/bdk-cli#349 ·
Maintainers usually reply within 3 days
-
`compile` doesn't validate keys and returns unusable descriptorsPossibly taken @Olorunshogo claimed this 9 days ago. Openenhancement
Difficulty 3/5 1-2 days Newbie friendliness 52/100
bitcoindevkit/bdk-cli#344 · 1 comment ·
Maintainers usually reply within 3 days
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 50/100
bitcoindevkit/bdk-cli#340 · 1 comment ·
Maintainers usually reply within 3 days
All issues in bitcoindevkit/bdk-cli
Similar issues
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
IntersectMBO/developer-experience#347 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
registrystack/registry-stack#2168 ·
Maintainers usually reply within 1 day
-
bug crate: 3d help wanted triage
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
kornia/kornia-rs#1203 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
[Bug] ComponentType classifies 0x8A8A-0xEAEA as GREASE; mls-extensions §7.5 makes them private useOpen
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day