From: Ian Coleman Date: Fri, 26 Sep 2014 10:05:11 +0000 (+1000) Subject: bip32.org format not used for seed X-Git-Url: https://git.immae.eu/?p=perso%2FImmae%2FProjets%2FCryptomonnaies%2FBIP39.git;a=commitdiff_plain;h=bade150497a0459a8cb3b4a5cde315117b8430a7 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. --- 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("/");