<p>Yes, there's a nice script written by you.
<a href="https://github.com/stevenzeiler/ripple-wallet" rel="nofollow">https://github.com/stevenzeiler/ripple-wallet</a></p>

CC BY-SA 3.0
2014-02-22T05:03:30.850Z
2014-02-22T05:03:30.850Z
Vahe Hovhannisyan
<p>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.</p>

<pre><code>'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(() =&gt; { 
    /* begin custom code ------------------------------------ */
    return api.generateAddress();
}).then(address_info =&gt; {
    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(() =&gt; {
    return api.disconnect();
}).then(() =&gt; {
    console.log('done and disconnected.');
}).catch(console.error);
</code></pre>

<p>Good luck =)</p>

CC BY-SA 4.0
2018-05-30T14:03:41.973Z
2018-05-31T12:09:15.953Z
2018-05-31T12:09:15.953Z
Дима Марков
<p>The ripple client application can generate new accounts using the elliptic curve algorithm. Is there a high-level function to perform this task?</p>

<ripple><ripple-api>
How do you generate a Ripple address and secret using the ripple-lib javascript library?
Steven Zeiler
# How do you generate a Ripple address and secret using the ripple-lib javascript library?

(Asked by: username_0 on 2014-01-11)

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

**Tags:** ripple, ripple-api


---

## 2 answers

### Answer by username_1 on 2014-02-22. Score: 2

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


---

### Answer by username_2 on 2018-05-30. Score: 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 =)


---

