bip32 for ripple
compatible with ledger wallet nano s
There is no ripple secret key of the ripple address created using this library, so care must be taken when handling it. You can not use the ripple ecosystem handling existing ripple secret keys.
npm i ripple-bip32
npm i bip39
const bip39 = require("bip39");
const bip32 = require("ripple-bip32");
const mnemonic = bip39.generateMnemonic()
// bip39 mnemonic
console.log(mnemonic)
const seed = bip39.mnemonicToSeed(mnemonic)
// seed hex string
console.log(seed.toString('hex'))
const m = bip32.fromSeedBuffer(seed)
// master xprv
console.log(m.toBase58())
// xprv
console.log(m.derivePath("m/44'/144'/0'").toBase58())
// xpub
console.log(m.derivePath("m/44'/144'/0'").neutered().toBase58())
// ripple address
console.log(m.derivePath("m/44'/144'/0'/0/0").getAddress())
// publickey / privatekey
console.log(m.derivePath("m/44'/144'/0'/0/0").keyPair.getKeyPairs())
To sign using the private key generated using this library, please see below.