File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed
Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff 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 } ) ;
You can’t perform that action at this time.
0 commit comments