-
Notifications
You must be signed in to change notification settings - Fork 79
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
Possibility to obtain ypub / zpub from xpub? #28
Comments
Should be possible I suppose. What's the use case? |
Funny enough, it's actually for your other package (hd-wallet-addr) as this one only checks the addresses that should be obtained from an extended public key (i.e. 1... for xpub, 3... for ypub and bc1... for zpub according to SLIP-0132). Because of Ledger's implementation of only using xpub's and derive the required addresses, I need to check the xpub, ypub and zpub of a given xpub (to see whether it has been used). My thought was thus to use the hd-wallet-derive (which we already have implemented) to obtain the ypub and zpub from a given xpub and throw those into the hd-wallet-addr. I guess the better solution would be to implement a parameter (like --addr-type=p2sh-segwit in hd-wallet-derive) into hd-wallet-addr? I can open a pull request for that instead if that's your preferred way of going? |
If you can create a PR for hd-wallet-addrs, that would be great. As I recall, there is some trickiness (a lot of setup) required to make a given key generate x, y, or z type addresses, as the bitcoin-php lib doesn't really support it cleanly yet. I opened an issue for it. You should be able to port over what I did in hd-wallet-derive though, or let me know if difficulties. |
Since we have the plumbing available to create p2sh-segwit and bech32 addresses from an xpub. Would it be possible to also have the ability to derive a ypub or zpub from a given xpub?
The text was updated successfully, but these errors were encountered: