How to generate the secret key in the getting started tutorial

Hi Everyone,

I’m totally new to the ripplex environment but not new to Nodejs, and am working my way through the tutorials.

I’m struggling on how to create the secret on the tutorial on the"waiting for validation" section on the “getting started” page here: Get Started with RippleAPI for Node.js -

I’ve searched around a bit but haven’t came up with anything that works just yet.

It’s the const “mySecret” here:

/* Credentials of the account placing the order */
const myAddr = 'rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn';
const mySecret = 's████████████████████████████';

Any guidance gratefully received.

All the best, Paul

Hi! The address and key define your account. Basically, the way this works is you run a key derivation function that chooses a secret key at random & derives the address from that secret. Then you have someone send XRP to the address you generated.

For testing and experimentation purposes, you can use the Testnet Faucet to give you a secret key and address that has been freshly funded with new test XRP. But you’ll need to be connected to a Testnet server (like wss:// to use that address, since the Testnet is a whole parallel network compared to the Mainnet.

When you’re ready to do things “for real” you can generate an address/secret using the .generateAddress() method of RippleAPI. Or, if you’re using a hardware wallet, it has the secret internally and you just pass the unsigned transaction instructions to it (the exact way varies depending on which hardware wallet you’re using). There are some other ways to generate keys, too, you just have to be careful to generate them securely because if someone else can figure out your secret, they can take all your money.

Hope that helps, and best of luck!

P.S. If you haven’t seen it, you may find the Send XRP Interactive Tutorial helpful!

1 Like