rust-bitcoin / rust-bitcoin/rust-miniscript

Descriptor::parse_descriptor is hard to discover

Open
#716 1 comment 1 reaction 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

If you have a descriptor string containing secret keys, it's super non-obvious how to parse this. You can type from_str into docs.rs but nothing will come up. You can type parse and the Descriptor::parse_descriptor method does show up in the list, but there's nothing in the name indicating that it's for secret-key descriptors (and the word "secret" doesn't appear til late in the description so you need a wide screen for it to show up).

As a further thing, it kinda sucks that you can't just parse and re-serialize secret-key-containing descriptors without needing a secp context and doing all the secret key derivations.

I think both API issues would be solved by introducing a SecretDescriptor type which can be parsed/reserialized and converted to/from a (Descriptor, KeyMap) pair, and nothing else.

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 reviewing the Descriptor::parse_descriptor entry point and how descriptor parsing is exposed through docs.rs, including the existing from_str search path. Define the proposed SecretDescriptor API, including parsing, re-serialization, and conversion to and from a (Descriptor, KeyMap) pair, while avoiding unnecessary secp context and secret-key derivation.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
backend-api-design, developer-experience
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.