console.log('mnemonic: ' + mnemonic)
console.log('mnemonic: ' + mnemonic)
const seed = bip39.mnemonicToSeed(mnemonic)
const m = bip32.fromSeedBuffer(seed)
const keyPair = m.derivePath("m/44'/144'/0'/0/0").keyPair.getKeyPairs()
const key = ripple.KeyPair.from_json(keyPair.privateKey.substring(2))
var privateKey =key.to_pri_string();
var address=key.to_address_string();
console.log("private Key   "+keyPair.privateKey)
console.log('privateKeyWif: ' +privateKey ) // to_wif
console.log('publicKey: ' + keyPair.publicKey)
console.log("address   " +address)
  • Be aware that Ripple had a little Not-invented-Here (NIH) and decided to re-invent base58-check encoding and decoding, no real value added just a pain in the... Also believe Ripple migrated from secp256k to ed25519 elliptic curves. – skaht Apr 2 at 1:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.