1

The ripple client application can generate new accounts using the elliptic curve algorithm. Is there a high-level function to perform this task?

2

Yes, there's a nice script written by you. https://github.com/stevenzeiler/ripple-wallet

0

You can use this script for it. It generates a secret and an address, and with using library ripple-keypairs you can get private and public keys too.

'use strict';
const RippleAPI = require('ripple-lib').RippleAPI;
var test_server = 'wss://s2.ripple.com';
var keypairs = require('ripple-keypairs');
const api = new RippleAPI({
    server: test_server // Public rippled server
});
api.connect().then(() => { 
    /* begin custom code ------------------------------------ */
    return api.generateAddress();
}).then(address_info => {
    console.log("Secret: " + address_info.secret);
    console.log("Address: " + address_info.address);
    var keypair = keypairs.deriveKeypair(address_info.secret);
    var privateKey = keypair.privateKey;
    console.log("Private key: " + privateKey);
    var publicKey = keypair.publicKey;
    console.log("Public key: " + publicKey);
    var address = keypairs.deriveAddress(keypair.publicKey);
    console.log("Address: " + address);
    /* end custom code -------------------------------------- */
}).then(() => {
    return api.disconnect();
}).then(() => {
    console.log('done and disconnected.');
}).catch(console.error);

Good luck =)

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.