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

Beef up the Descriptor type #687

Open
thunderbiscuit opened this issue Mar 2, 2025 · 1 comment
Open

Beef up the Descriptor type #687

thunderbiscuit opened this issue Mar 2, 2025 · 1 comment

Comments

@thunderbiscuit
Copy link
Member

thunderbiscuit commented Mar 2, 2025

The Descriptor type is one of the most complex types coming from BDK/Miniscript, and we expose a simplified version of what's available in Rust, partly because it's a whole lot of generics on top of generics.

I still need to play around with the Rust code to figure out a few things we could add to make the type more powerful in the bindings, but the first thing that I realized only today is that given a descriptor, there is currently not a lot of introspection available into it.

For example, at any point your Descriptor probably came from either the domain layer (you created it yourself from entropy or a recovery phrase) and used our descriptor templates, in which case you know the script type (P2TR, P2WPKH, etc.), or it was given to you by a user in the form of a string. In this case, you can create the descriptor but cannot query it directly for metadata (script type, checksum, etc.). The only way to do this currently is to manually parse the string, but surely we can do better because those methods are available in some form in Rust.

@thunderbiscuit
Copy link
Member Author

See #688 for an example of what I have in mind.

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