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

Output descriptor parsing #151

Closed
Sjors opened this issue Nov 26, 2019 · 1 comment
Closed

Output descriptor parsing #151

Sjors opened this issue Nov 26, 2019 · 1 comment

Comments

@Sjors
Copy link
Contributor

Sjors commented Nov 26, 2019

Bitcoin Core introduced Output Descriptors recently: https://github.com/bitcoin/bitcoin/blob/master/doc/descriptors.md

They're quite useful, but there's no BIP. So perhaps it's premature to implement. But if so, I'd like to see a method that takes a descriptor string and an index as input, and returns an address (like the deriveaddresses RPC).

E.g. from one of the Bitcoin Core examples:

Inputs:
* Descriptor: 
wsh(multi(1,xpub661MyMwAqRbcFW31YEwpkMuc5THy2PSt5bDMsktWQcFF8syAmRUapSCGu8ED9W6oDMSgv6Zz8idoc4a6mr8BDzTJY47LJhkJ8UB7WEGuduB/1/0/*,xpub69H7F5d8KSRgmmdJg2KhpAK8SR3DjMwAdkxj3ZuxV27CprR9LgpeyGmXUbC6wb7ERfvrnKZjXoUmmDznezpbZb7ap6r1D3tgFxHmwMkQTPH/0/0/*))#t2zpj2eu
* Index: 0

Output:
* Address: bc1qvjtfmrxu524qhdevl6yyyasjs7xmnzjlqlu60mrwepact60eyz9s9xjw0c

For better performance it could take an array of indices to calculate an array of addresses, or it could output a cache that the consuming application can hold on to (that's what Bitcoin Core does).

@jgriffiths
Copy link
Contributor

Implemented in #310, please comment there if you would, thanks.

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

2 participants