Closed MoistCarrot closed 3 years ago
Your problem has nothing to do with uprv/xprv difference.
Your problem has to do with wif / extended-key(xprv/uprv/yprv etc.) difference.
The extended key encodes a ton of info, private key, chaincode, depth, fingerprint, etc.
Wif only encodes a private key and a single byte "version".
You are essentially throwing the chaincode etc in the garbage can by encoding into WIF.
Solution: Don't use WIF.
Hi,
I have the following code below that generates a BIP49 uprv key based on a mnemonic. Because this key is so long though, I am exporting it as a WIF to make it more readable. However, I have been unable to figure out how to import this WIF back into its original uprv format.
I tried encoding and decoding the uprv manually using the "wif" library, but decoding the privatekey in the decoded object returned by wif.decode() is not the same as the original uprv key. This is the code that I was using to do this:
I also tried using ECPair.fromWIF(), but again, I was unable to get the original uprv key back from its respective wif.
Here is the entire pseudocode for what I am trying to do:
I remember reading somewhere in the repo that this library does not support uprv/upub keys. Perhaps that is why I am unable to import the WIF back into its original uprv format? If this is the case, how can I go about converting the WIF back to its original uprv format?