From bade150497a0459a8cb3b4a5cde315117b8430a7 Mon Sep 17 00:00:00 2001 From: Ian Coleman Date: Fri, 26 Sep 2014 20:05:11 +1000 Subject: [PATCH] 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. --- bip39-standalone.html | 3 +-- src/js/index.js | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/bip39-standalone.html b/bip39-standalone.html index 99fa529..22d7120 100644 --- a/bip39-standalone.html +++ b/bip39-standalone.html @@ -22865,8 +22865,7 @@ WORDLISTS = { function calcBip32Seed(phrase, passphrase, path) { var seed = mnemonic.toSeed(phrase, passphrase); - var seedHash = Bitcoin.crypto.sha256(seed).toString("hex"); - bip32RootKey = Bitcoin.HDNode.fromSeedHex(seedHash, network); + bip32RootKey = Bitcoin.HDNode.fromSeedHex(seed, network); bip32ExtendedKey = bip32RootKey; // Derive the key from the path var pathBits = path.split("/"); diff --git a/src/js/index.js b/src/js/index.js index 7f39ad2..cd3a506 100644 --- a/src/js/index.js +++ b/src/js/index.js @@ -164,8 +164,7 @@ function calcBip32Seed(phrase, passphrase, path) { var seed = mnemonic.toSeed(phrase, passphrase); - var seedHash = Bitcoin.crypto.sha256(seed).toString("hex"); - bip32RootKey = Bitcoin.HDNode.fromSeedHex(seedHash, network); + bip32RootKey = Bitcoin.HDNode.fromSeedHex(seed, network); bip32ExtendedKey = bip32RootKey; // Derive the key from the path var pathBits = path.split("/"); -- 2.41.0