-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
The HK key derivation stumbles in rare cases #1440
Comments
I haven't looked deep into what you are seeing, but it may be related to our hardened derivation bug. See bitpay/bitcore-lib#116 Try using deriveChild() instead of derive() and I bet it will give you the results you expect. |
Here is the code used to get the address:
How to you suggest to fix it? |
Yep, looks like same bug. @NicSil, to fix your script you will have to wait for availability of |
I guess it's clear this is a known bug in bitcore-lib that bitpay/bitcore-lib#116 should fix. |
I think it is a bug in bitcore as Mycelium's bitlib, Schildbach's bitcoinJ and blockchain.info agree to disagree with how to derive m/44' from a seed I have.
This is mainnet but the user agreed to share the secret as we got the funds out.
He was using a bitcore script but copay works to show the issue.
Restoring the wallet
"surface poem manual curve size banner truly just object soup inhale craft"
yields one set of addresses on copay and a different one on Mycelium, blockchain.info (tested by pasting the xpub that bitcoinj, bitcore and bitlib agree on) and bitcoinJ (tested with custom code. See below.)
Upon further investigation all libs get from phrase to seed to
m
xpriv and would agree onm/x
but not onm/x'
. Thus, starting with.derive("m/44'")
things diverge.I would kindly ask for your cooperation to keep our wallets interoperable. If you feel this is a bug in the other libs, please also let us know.
I got the test vectors by running:
those pairs of path + xpriv I used as such:
So the issue is with calculating the first derivation if hardening is involved.
The text was updated successfully, but these errors were encountered: