Mnemonic with ripple-keypairs, w/o ripplelib

node v8.16.1
version: 2.0.0
endpointsharetweet
const bip39 = require("bip39"); const bip32 = require("ripple-bip32"); const ripple = require('ripple-keypairs') var mnemonic = 'novel matter final only nice cheese address cradle civil crash great flame struggle consider crowd surface purpose saddle mango endless mixed trial tape wrap' // Or generate: // mnemonic = bip39.generateMnemonic() console.log('mnemonic: ' + mnemonic) const seed = bip39.mnemonicToSeed(mnemonic) // add second argument for 25th word encrypted console.log('seed: ', seed) const m = bip32.fromSeedBuffer(seed) console.log('m: ', m) const keyPair = m.derivePath("m/44'/144'/0'/0/0").keyPair.getKeyPairs() const address = ripple.deriveAddress(keyPair.publicKey) console.log('privateKey: ' + keyPair.privateKey) console.log('publicKey: ' + keyPair.publicKey) console.log('address: ' + address)
Loading…

1 comment

  • posted a year ago by phuong
    Hi, how to get the secrect? the ripple-lib use secrect to sign

sign in to comment