Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Descriptor::parse_descriptor is hard to discover #716

Open
apoelstra opened this issue Jul 30, 2024 · 1 comment
Open

Descriptor::parse_descriptor is hard to discover #716

apoelstra opened this issue Jul 30, 2024 · 1 comment

Comments

@apoelstra
Copy link
Member

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.

@apoelstra
Copy link
Member Author

cc @thunderbiscuit who asked how to parse secret keys at the rust-bitcoin meetup and it took me 5 minutes to figure it out

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant