2 min read

How to run an ICO on the Ripple Consensus Ledger

How to run an ICO on the Ripple Consensus Ledger

This is a step by step tutorial of how to issue an ICO of a limited IOU on the RCL.

Updated July 13th 2017.

The process:

Creating the IOU

1: Download and setup Rippled: https://ripple.com/build/rippled-setup/#system-requirements

2: Create a founding wallet with this command:

/opt/ripple/bin/rippled wallet_propose

3: Write down the wallet address, secret key, back up the information printed out in your console.

4: From another funded wallet, send the generated address like 21 xrp or so.

5: Create another wallet, fund it as well, this wallet will act as our 'hotwallet' to distribute funds.

6: Issue a trustline from the hotwallet, to the issuing wallet. If you're using Gatehub, you need to click Advanced on the wallet screen, then set trust, then fill in the founding wallet address, currency code, and under advanced options how much of a limit you want to issue.

7: Issue this command from rippled, replace the dummy text with your public key for the founding account and the secret key of the founding account:\

/opt/ripple/bin/rippled submit sSECRETKEYFORFACCOUNT '{"Account": "rPUBKEYFORFACCOUNT", "Amount": { "currency": "PRX", "issuer": "rPUBKEYFORFACCOUNT", "value": "1000000000" }, "Destination": "rHOTWALLET", "TransactionType": "Payment", "Fee": "5000"}'

8: Congrats, your IOU has been created!

Enabling DefaultRipple

You want to set the DefaultRipple flag on the founding account to true. Otherwise you will not be able to easily send the tokens in peer to peer transactions.

To do this, simply issue this command, replace the dummy text:

/opt/ripple/bin/rippled submit sSECRETKEYFORFACCOUNT '{"TransactionType": "AccountSet","Account" : "rPUBKEYFORFACCOUNT","Fee": "12","SetFlag": 8}'

Setting the hard limit on IOUs.

Simply issue this command from rippled, replace the dummy text, keep the regularkey the same:

/opt/ripple/bin/rippled submit sSECRETKEYFORFACCOUNT '{"Flags": 0, "TransactionType": "SetRegularKey", "Account": "rPUBKEYFORFACCOUNT", "Fee": "12", "RegularKey": "rrrrrrrrrrrrrrrrrrrrBZbvji"}'

That rrrrrrrr account is an account no one knows the private key to.

Then issue this command to remove the ability to use your private key to control the account:

/opt/ripple/bin/rippled submit sSECRETKEYFORFACCOUNT '{"TransactionType": "AccountSet","Account" : "rPUBKEYFORFACCOUNT","Fee": "12","SetFlag": 4}'

Now no one, yourself included, can modify the IOUs issued or freeze them.

Verifying that it worked

If you issue this command:

/opt/ripple/bin/rippled account_info rPUBKEYFORFACCOUNT

You should see the regular key set to the rrrrrr key we set earlier.

Additionally check the flags number. My flags number is 3211264, you can go to this page to check which flags are enabled on an address.

On my address: 8388608, 1048576, 65536 are enabled, add those together you get 9502720.

If you followed the steps above, your flags number should be 9502720. Which confirms no one else, as long as the regular key is set to an account no one owns, can modify the account or issue more IOUs. Phew!

How to then sell those IOU tokens..

You have a hotwallet, now you just need people to send a trust line with your public key to be able to send/receive payments with that token. It is really not an IOU anymore, since no one owns them nor can issue more of them!

I have created a limited token on the RCL called PRX, located at this address: rPRXcb4T8r7VezKkgRbQBuzGrftsjgJcUu

For fun, I'm running an (experimental) ICO for PRX with the publication of this post, visit the other post on my site to learn how to participate and test it out!

Shoutout to T8493 for helping me understand flags, edwin90 for pointing me towards a guide, and bibbit/tulo for the original answers they posted.

Shoutout to JoelKatz for helping me fix the rippling issue I had on my first attempt.