]> git.immae.eu Git - perso/Immae/Projets/Cryptomonnaies/BIP39.git/commitdiff
bip32.org format not used for seed
authorIan Coleman <coleman.ian@gmail.com>
Fri, 26 Sep 2014 10:05:11 +0000 (20:05 +1000)
committerIan Coleman <coleman.ian@gmail.com>
Fri, 26 Sep 2014 10:05:56 +0000 (20:05 +1000)
ie put the bip39 seed directly into bip32 without hashing it first like
bip32.org does with passphrases.

bip39-standalone.html
src/js/index.js

index 99fa5290f5fe4cd5b5a9b99607bf28a68bb9ca21..22d712009740d7fb8ccd6b464df136be63dee6a4 100644 (file)
@@ -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("/");
index 7f39ad2e737f39a8e735557fbe1af460a4f7a934..cd3a5063c6e34162b498e9be13769b496a9a7252 100644 (file)
 
     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("/");