3

Can someone give an example of how to use the keystore's addHdDerivationPath() method, that actually runs properly? The code I have below (using the default hdPath) is giving a strange error

lightwallet.keystore.deriveKeyFromPassword(password, function(err, pwDerivedKey) {
    let ks = new lightwallet.keystore(seed, pwDerivedKey);
    console.log(ks.isDerivedKeyCorrect(pwDerivedKey));//true
    ks.addHdDerivationPath("m/0'/0'/0'", pwDerivedKey, {curve: 'secp256k1', purpose: 'sign'});
})

EDIT: OK, I solved it myself - turns out my hdDerivationPath is wrong - it had a "/i" at the end (in my local version), which somehow caused the KS's encSeed to reset to undefined, and the error above. The code snippet I posted above actually works.

Badr Bellaj
  • 18,780
  • 4
  • 58
  • 75
  • encryptedStr is undefined; including how you're getting encryptedStr could help others find the problem. – eth Jul 15 '16 at 01:36

0 Answers0