rust-bitcoin / rust-bitcoin/rust-miniscript

Descriptor loses formatting options

Open
#323 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
426
Forks
200
Avg merge
7d 17h
Merged PRs (30d)
8

Description

Descriptor loses formatting options on Display and Debug. Specifically, if alternative formatting is provided, it does not reach specific miniscript key implementation. This happens due to the fact that the library formats everything inside Display implementation by using write!(f, "{}", ...) instead of Display::fmt(..., f).

Some specific key types may use alternative formatting flag to switch display format; for instance to use Bitcoin Core or other format for displaying extended public key derivation path.

Fixing of this bug requires some extensive refactoring due to the presence of to_string_no_checksum function, which does not takes formatter. Another function fmt_no_checksum must be created and used from Display implementations.

Contributor guide

Open the contributing guide

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.

Research direction

Start by tracing the Display implementations and the to_string_no_checksum function to see where formatters are discarded. Review the alternative-formatting behavior of the specific miniscript key implementations, then use the issue's proposed fmt_no_checksum refactoring as the completion target: formatting flags must reach those implementations, including extended public key derivation paths.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.