mirror of
https://github.com/OneKeyHQ/bip39.git
synced 2026-04-28 13:20:41 +00:00
bip32.org format not used for seed
ie put the bip39 seed directly into bip32 without hashing it first like bip32.org does with passphrases.
This commit is contained in:
@@ -22865,8 +22865,7 @@ WORDLISTS = {
|
|||||||
|
|
||||||
function calcBip32Seed(phrase, passphrase, path) {
|
function calcBip32Seed(phrase, passphrase, path) {
|
||||||
var seed = mnemonic.toSeed(phrase, passphrase);
|
var seed = mnemonic.toSeed(phrase, passphrase);
|
||||||
var seedHash = Bitcoin.crypto.sha256(seed).toString("hex");
|
bip32RootKey = Bitcoin.HDNode.fromSeedHex(seed, network);
|
||||||
bip32RootKey = Bitcoin.HDNode.fromSeedHex(seedHash, network);
|
|
||||||
bip32ExtendedKey = bip32RootKey;
|
bip32ExtendedKey = bip32RootKey;
|
||||||
// Derive the key from the path
|
// Derive the key from the path
|
||||||
var pathBits = path.split("/");
|
var pathBits = path.split("/");
|
||||||
|
|||||||
+1
-2
@@ -164,8 +164,7 @@
|
|||||||
|
|
||||||
function calcBip32Seed(phrase, passphrase, path) {
|
function calcBip32Seed(phrase, passphrase, path) {
|
||||||
var seed = mnemonic.toSeed(phrase, passphrase);
|
var seed = mnemonic.toSeed(phrase, passphrase);
|
||||||
var seedHash = Bitcoin.crypto.sha256(seed).toString("hex");
|
bip32RootKey = Bitcoin.HDNode.fromSeedHex(seed, network);
|
||||||
bip32RootKey = Bitcoin.HDNode.fromSeedHex(seedHash, network);
|
|
||||||
bip32ExtendedKey = bip32RootKey;
|
bip32ExtendedKey = bip32RootKey;
|
||||||
// Derive the key from the path
|
// Derive the key from the path
|
||||||
var pathBits = path.split("/");
|
var pathBits = path.split("/");
|
||||||
|
|||||||
Reference in New Issue
Block a user