ripple

How should I properly create a Ripple Paper Wallet using Ripple-lib or an official api?


I'm trying to create a paper wallet using the official Ripple Api, ripple-lib.

The generateAddress() accepts some parameters.

'use strict';
const RippleAPI = require('ripple-lib').RippleAPI;

const api = new RippleAPI({
  server: 'wss://s1.ripple.com' // Public rippled server
});
api.connect().then(() => {
  return api.generateAddress();
}).then(info => {
  console.log(info);
  console.log('getAccountInfo done');

  /* end custom code -------------------------------------- */
}).then(() => {
  return api.disconnect();
}).then(() => {
  console.log('done and disconnected.');
}).catch(console.error);

This code actually creates a Secret key and an "Address".

{
  secret: 'sheWb..................HRyLhk',
  address: 'rNLJ.......................qu3nbb'
}

Ok. Now I have my account created. And If I fund it with the 20XRP Reserve it would become an active Ripple account. Yay !

But I don't understand:

May anyone sheed some light to these concerns ?

EDIT: I think now that the options object passed to generateAddress() is the same options parameter passed to the constructor RippleApi() described here https://ripple.com/build/rippleapi/#parameters May anyone confirm this ?


Solution

  • For paper wallet what you need is only address(public) and secret(private):

    https://github.com/Bithomp/xrp-paper-wallet

    Actually, only secret would be enough, as you can get an address from the secret.

    https://github.com/Bithomp/bithomp-tools

    In Ripple you not have to use a new account for each new order/user. For each new transaction you can use a destination tag. That's how you can identify customer/order. Ripple also supports a key rotation, so if master key got exposed you can disable it and use a regular key. In best practices you assign a regular key and use it to sign transactions online, and master key always offline. If a regular key got exposed, you can replace it with a new regular key.

    In ripple you can sign transactions with a keypair (public key + private key), or with the secret.

    you can get keypairs for ripple here https://iancoleman.io/bip39/

    ripple-lib's generateAddress() gives you:

    1) a ripple address (your public address) starts with r

    you can share it, it can be used to send you payments. You can search for the public address in the explorer.

    for example: https://bithomp.com/explorer/r9fVvKgMMPkBHQ3n28sifxi22zKphwkf8u

    2) a secret - a master key, which will be used to sign transactions.

    3) You can also assign a regular key (https://developers.ripple.com/assign-a-regular-key-pair.html)

    Options has only two parameters:

    hope it helps..