Skip to content

Commit 514c3a6

Browse files
committed
Added some debug into to mnemonic extraction.
1 parent a596068 commit 514c3a6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tools/extract-mnemonic/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,17 @@ function extractMnemonic(json, password) {
9393
var mnemonic = bip39.entropyToMnemonic(aes.decrypt(cipherText))
9494
var root = HDNode.fromSeedBuffer(bip39.mnemonicToSeed(mnemonic));
9595
var node = root.derivePath("m/44'/60'/0'/0/0");
96+
var privateKey = node.keyPair.d.toBuffer(32);
9697
var publicKey = node.keyPair.Q.getEncoded(false);
9798
var computedAddress = keccak256(publicKey.slice(1)).substring(24);
9899
if (computedAddress !== address) {
99100
reject(new Error('wrong password'));
100101
return;
101102
}
103+
//console.log('Mnemonic Phrase: ' + mnemonic);
104+
//console.log('Private Key: 0x' + privateKey.toString('hex'));
105+
//console.log('Public Key: 0x' + publicKey.toString('hex'));
106+
//console.log('Address: 0x' + address);
102107
resolve(mnemonic);
103108
}
104109
});

0 commit comments

Comments
 (0)