mirror of
https://github.com/OneKeyHQ/bip39.git
synced 2026-04-05 18:43:47 +00:00
fix bip85 root key when using non-xprv version bytes
This commit is contained in:
@@ -495,12 +495,16 @@
|
|||||||
|
|
||||||
var app = DOM.bip85application.val();
|
var app = DOM.bip85application.val();
|
||||||
|
|
||||||
var rootKey = DOM.rootKey.val();
|
var rootKeyBase58 = DOM.rootKey.val();
|
||||||
if (!rootKey) {
|
if (!rootKeyBase58) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
var master = libs.bip85.BIP85.fromBase58(rootKey);
|
// try parsing using base network params
|
||||||
|
// The bip85 lib only understands xpubs, so compute it
|
||||||
|
var rootKey = libs.bitcoin.HDNode.fromBase58(rootKeyBase58, network);
|
||||||
|
rootKey.keyPair.network = libs.bitcoin.networks['bitcoin']
|
||||||
|
var master = libs.bip85.BIP85.fromBase58(rootKey.toBase58());
|
||||||
|
|
||||||
var result;
|
var result;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user