-
Notifications
You must be signed in to change notification settings - Fork 138
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
Add support for XpubOnly keys #586
base: master
Are you sure you want to change the base?
Conversation
There are more specialized key types coming
Unlike descriptor publickey which supports multi xkeys as well as single keys, this only supports extended keys. Makes the ergonimics much simpler for most common wallet implementations co-authored-by: Scott Robinson <ssr@squareup.com>
I am not happy with the names or the code duplication, but looking for feedback on whether this solves the desired issue
… I guess this works? It adds yet another type. It'll mean that for now and into the future the methods need to be manually copied across. 🤷 |
My understanding is that most wallet developers will only use this type
I understand that replicating methods instead of implementing a unifying trait might seem contrived. We've succumbed to the allure of grouping similar-looking elements within traits. However, amalgamating two distinct entities to alter the trait signature into a Result would compel users to manage errors in methods that consistently yield Ok(). Alternatively, this approach might result in methods exclusively returning errors. W.r.t to forgetting things, the Perhaps, @danielabrozzoni also has some comments for this one. |
I'm not confident enough with the project structure to give suggestions about how to implement this, but I think that having a xpub only descriptor would be really useful for most users - but I'm not sure how useful this would be for bdk, as I don't think we'll ever drop support for single key descriptors. |
This allows users to directly operate on extended keys without always having to match on
DescriptorPublicKey
enum. This is quick hack PR, just looking for superficial feedback if this addresses issues by @quad.All the APis that were supported on
DescirptorPublicKey
are now also exported viaXPubOnlyDescriptor
(I am not happy names I chose in the PR).Overall,