How To Create Keys on Stellar Bifrost

Follow

Stellar Documentation

Why Stellar

A detailed description of the benefits of stellar in an ICO/Toke Distribution can be found here: https://www.stellar.org/blog/using-stellar-for-ico/

Bifrost Coin Distribution Walkthrough

Bitcoin and Ethereum Keys

Bifrost uses BIP32 hierarchical deterministic wallets for Ethereum and Bitcoin. A hierarchical deterministic wallet consists of a master public and private key (often generated from a human-readable mnemonic). New addresses keys can be generated deterministically from the public master key. Private child keys are necessary to access the funds sent to these addresses. Only the public master key should be stored with Bifrost, it is used to create a new receiving address for every user. The private master key must be kept secret under all circumstances!

Tools that support BIP32:

Important: https://iancoleman.io/bip39/ has not been audited and might have security flaws. For production use, we recommend using TODO.

  1. Create Bitcoin HD keys
    1. Open https://iancoleman.io/bip39/
    2. Select "Coin: BTC - Bitcoin"
    3. Click "Generate 15 words"
    4. Save the mnemonic (it is needed to re-create the keys) securely
    5. Save the "Account Extended Private Key" securely
    6. Save the "Account Extended Public Key" securely
  2. Create Ethereum HD keys
    1. Same as Bitcoin but this time select "Coin: ETH - Ethereum"

Create a new token on Stellar

For more details, please refer to: https://www.stellar.org/blog/tokens-on-stellar/
For a detailed step-by-step guide, please refer to: https://hackernoon.com/how-to-make-a-custom-token-on-stellar-ae5296512a2e

Important: The following steps should only be used for development/POC. Note that the steps below will have you create two stellar test accounts. We suggest you write and label all the keys in one document so it is easy to keep track of them.

For production we recommend Maybe scripts?.

Step 1: Create an issuing account on Stellar

  1. Go to https://www.stellar.org/laboratory/
  2. Ensure "TESTNET" is selected in the top right corner
  3. Click on "Account Creator"
  4. Click on "Generate keypair"
  5. Save the public and private key securely
  6. Click on "Fund this account on the test network using the friendbot tool below"
  7. Click on "Get test network lumens"

Step 2: Check the issuing account balance

Important: https://stellarterm.com has not been audited and might have security flaws. For production use we recommend using TODO.

The account should now own "testnet" lumens. You can double-check this with the stellarterm wallet:

  1. Go to https://stellarterm.com/#testnet
  2. Ensure "Network passphrase: Test SDF Network; September 2015" is displayed in the top right corner
  3. Click on "Account"
  4. Enter the issuing accounts private key
  5. Ensure that this account has a positive balance of XMLs

Step 3: Create a distribution account on Stellar

Using the same steps as Step 1, create a second account. This account will receive the new tokens we will create and will distribute them. This allows us to lock the issuing account, e.g. to limit the total supply of the tokens.

Step 4: Check distribution account balance

The account should now own "testnet" lumens. You can double-check this with the stellarterm wallet:

  1. Go to https://stellarterm.com/#testnet
  2. Ensure "Network passphrase: Test SDF Network; September 2015" is displayed in the top right corner
  3. Click on "Account"
  4. Enter the distribution accounts private key
  5. Ensure that this account has a positive balance of XMLs

If completed correctly you will have 2  Stellar accounts, 2 sets of keys, and each account should have a positive balance.

Step 5: Create a trust line for your token

After the distribution account is created, we need to setup a trust line between it and the issuing account.

  1. Go to https://www.stellar.org/laboratory/
  2. Ensure "TESTNET" is selected in the top right corner
  3. Click on "Transaction Builder"
  4. Enter the following values:
    1. Source account: The public key of the distribution account
    2. Click "Fetch next sequence number for account starting with ..." to populate the Transaction Sequence number field
    3. Operation Type: Change Trust
    4. Click "Alphanumeric 4" (or 12 for a longer token name)
    5. Enter the Asset Code. This is the name that you want to give the new token (e.g. BLCK).
    6. Issuer Account Id: The public key of the issuing account 
  5. Click on "Sign in Transaction Signer"
  6. Enter the distribution account private key in the "Add Signer" field
  7. Click on "Submit to Post Transaction Endpoint"
  8. Click on "Submit"

Step 6: Create a trust line for ETH and BTC 

Important: These sets of steps will be repeated twice. The only value that should change is the Asset code.

  1. Go to https://www.stellar.org/laboratory/
  2. Ensure "TESTNET" is selected in the top right corner
  3. Click on "Transaction Builder"
  4. Enter the following values:
    1. Source account: The public key of the distribution account
    2. Click "Fetch next sequence number for account starting with ..." to populate the Transaction Sequence number field
    3. Operation Type: Change Trust
    4. Click "Alphanumeric 4" (or 12 for a longer token name)
    5. Enter the Asset Code. Set it to ETH or BTC.
    6. Issuer Account Id: The public key of the issuing account (always use this when repeating the steps)
  5. Click on "Sign in Transaction Signer"
  6. Enter the distribution account private key in the "Add Signer" field
  7. Click on "Submit to Post Transaction Endpoint"
  8. Click on "Submit"

Step 7: Check trust line for each asset code

Again, this can be checked using Stellar Term:

  1. Go to https://stellarterm.com/#testnet
  2. Ensure "Network passphrase: Test SDF Network; September 2015" is displayed in the top right corner
  3. Click on "Account" 
  4. Enter the distribution accounts private key
  5. Click on "Accept assets"
  6. Ensure that this account accepts the new assets
  7. Verify that each asset has the same Issuer value.
  8. If the assets does not have the same Issuer value 
    1. Remove the asset and repeat the steps needed to create it

Step 8: Create your personal tokens

Tokens can be created by simply making a payment to an account with a valid trust line for that specific token:

  1. Go to https://www.stellar.org/laboratory/
  2. Ensure "TESTNET" is selected in the top right corner
  3. Click on "Transaction Builder"
  4. Enter the following values:
    1. Source account: The public key of the issuing account
    2. Click "Fetch next sequence number for account starting with ..." to populate the Transaction Sequence number field
    3. Operation Type: Payment
    4. Destination: The public key of the distribution account
    5. Click "Alphanumeric 4" (or 12 for a longer token name)
    6. Enter the Asset Code. This is the name that you want to give the new token (e.g. BLCK).
    7. Issuer Account Id: The public key of the issuing account
    8. Amount: The amount of tokens you want to create
  5. Click on "Sign in Transaction Signer"
  6. Enter the issuer account private key in the "Add Signer" field
  7. Click on "Submit to Post Transaction Endpoint"
  8. Click on "Submit"

Step 9: Create ETH and BTC tokens 

Important: These sets of steps will be repeated twice. The only value that should change is the Asset code.

  1. Go to https://www.stellar.org/laboratory/
  2. Ensure "TESTNET" is selected in the top right corner
  3. Click on "Transaction Builder"
  4. Enter the following values:
    1. Source account: The public key of the issuing account
    2. Click "Fetch next sequence number for account starting with ..." to populate the Transaction Sequence number field
    3. Operation Type: Payment
    4. Destination: The public key of the distribution account
    5. Click "Alphanumeric 4"
    6. Enter the Asset Code. Set it to ETH or BTC.
    7. Issuer Account Id: The public key of the issuing account
    8. Amount: The amount of tokens you want to create
  5. Click on "Sign in Transaction Signer"
  6. Enter the issuer account private key in the "Add Signer" field
  7. Click on "Submit to Post Transaction Endpoint"
  8. Click on "Submit"

Step 10: Check the balance of your tokens

  1. Go to https://stellarterm.com/#testnet 
  2. Ensure "Network passphrase: Test SDF Network; September 2015" is displayed in the top right corner
  3. Click on "Account"
  4. Enter the distribution accounts private key
  5. The balance for each token should be the amount sent in the payments.

If the amount of tokens in circulation should be limited you have the option to lock the issuer account now (see https://www.stellar.org/blog/tokens-on-stellar/ for more information).

Step 11: Create an offer for your token

  1. Go to https://www.stellar.org/laboratory/
  2. Ensure "TESTNET" is selected in the top right corner
  3. Click on "Transaction Builder"
  4. Enter the following values:
    1. Source account: The public key of the distribution account
    2. Click "Fetch next sequence number for account starting with ..." to populate the Transaction Sequence number field
    3. Operation Type: Manage Offer
    4. Selling:
      1. alphanumeric
      2. asset code: your token (e.g. BLCK)
      3. issuer account id: public key of the issuer account 
    5. Buying:
      1. alphanumeric
      2. asset code: ETH
      3. issuer account id: public key of the issuer account 
    6. Amount you are selling: The maximum amount of tokens you are selling in this event
    7. Price of 1 unit of asset for sale: 1
    8. Offer ID: 0
  5. Click on "Sign in Transaction Signer"
  6. Enter the distributor account private key in the "Add Signer" field
  7. Click on "Submit to Post Transaction Endpoint"
  8. Click on "Submit"

Repeat the steps above to make an offer to buy BTC.

Security

0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.