Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

wallet sign command returns generic error for decoding failures

Open Beginner friendly
#357 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 3 days

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
72/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
rust
Domain
cli

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

bug

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

  1. Build bdk-cli with any wallet backend.

  2. Create a wallet and obtain a valid PSBT (or use an existing one).

  3. 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

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from bitcoindevkit/bdk-cli

All issues in bitcoindevkit/bdk-cli

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.