How to Create Token On Stellar Blockchain Network?

decentralized finance

Most of the startups released their tokens on Ethereum because it has a good ecosystem and is Turing-complete. But Ethereum has some downsides as well. Ethereum carries out 14 transactions per second. It is becoming a real issue now and is causing existing dApps to move off the Ethereum platform. Therefore, it is good to look for other options.

Stellar Lumens is one of the best blockchain platforms that allow you to create a custom token to form the basis of an ecosystem. In this article, we will explain how to issue and create a token on the Stellar network. 

This article will be aimed at answering all major questions regarding DeFi, such as:

  1. Step 1: Create two accounts (One for Issuance, Another for Distribution)
  2. Step 2: Create a trustline between two accounts
  3. Step 3: Lock the issuer account
  4. Step 4: Distribution

Here are the steps to create a custom token on the Stellar Blockchain

Step 1: Create two accounts (One for Issuance, Another for Distribution)

The first step of creating a token on the Stellar platform is to create an issuing account used to issue the token supply to a distribution account. We create an issuing account to lock it after generating tokens and prove to our users that the token supply will not be increased in the future.

To do that, Go to Stellar Laboratory and make sure to select the “test” tab. Then click on “Generate keypair” and take a note of secret and public keys in a safe place.

Once the key pair is generated, the next step is to fund the issuing account on the test network using the friend bot tool. It will copy your public key into the text box, then click “Get test network lumens.”

When the account is funded, you will see a green bar that confirms your new account’s successful funding with test lumens.

Similarly, create and fund another account for the distribution and note down the public and private keys. Once it is done, you can check to ensure both accounts have a balance by appending every public key to the end of the following URL:

https://horizon-testnet.stellar.org/accounts/your public key

For example, in our case, it looks like:

https://horizon-testnet.stellar.org/accounts
/GDO3DT4QDLWF7532E2CEDX6C6GSPGGB53XUDKNWLXLCJEF4XCQUDQRTV

Once you open this URL, it will return a JSON object and you will notice a balance of 10,000 testnet Lumens.

},
“balances”: [
{
“balance”: “10000.0000000”,
“buying_liabilities”: “0.0000000”,
“selling_liabilities”: “0.0000000”,
“asset_type”: “native”
}
],

Step 2: Create a trustline between two accounts

The next step is to create a trustline that implies the distribution account trusts the issuing account. To make a trustline, go to the transaction builder page and enter the public key for the distribution account into the source account field.

Then, click on “Fetch next sequence number for account starting with..”

TAfter clicking, you will get a transaction sequence number.

We can keep the next three fields: Memo, Base Fee and Time Bounds alone and move to operation type and set that to “Change Trust.”

After selecting operation type as “change trust”, set the asset to alphanumeric 4 or 12 based on the number of characters you want to use and enter the asset code of your choice. For example, we are creating a token for the gold asset; therefore, select Alphanumeric 4 and enter “Gold” in the asset code field.

Add your issuing accounts public key in the “Issuer Account ID.”

Enter the number of tokens you want to generate in the “trust field” field. For example, we are going to generate 200,000 tokens.

Complete the transaction by clicking the “Sign in transaction signer” button at the bottom of the page.

It will navigate you to the next page where you need to scroll down to the signatures section. We will add the distribution account secret key in the “Add Signer” field. We would use a ledger if we were doing it in reality, since it is just an example, we will paste the key as described above.

Once the secret key is pasted, scroll to the bottom and click “Submit in transaction submitter.”

Step 3: Lock the issuer account

The final step is to lock down the issuing account so that no more tokens can be created. To do that, go to the transaction builder page again and enter the public key of the issuing account in the source account field and fetch the next sequence number as we did earlier.

Then, scroll down and select the “operation type” as Set Options and the master weight to 0 and click “Sign transaction in signer” at the bottom of the page.

After that, add the issuing account secret key in the “Add Signer” field and click “Submit to post transaction endpoint,” and then “submit” to finalize the transaction.

THere you go and the token is created on the Stellar network. Now, check your newly created token on testnet by adding a distribution account into the URL:

https://horizon-testnet.stellar.org/accounts/your distribution public key

Step 4: Distribution

As our token exists and everything is set up, the final step is to hand them to the people. You can find many ways to do that. One of the significant features of Stellar is the decentralized exchange. You can create an offer to sell these tokens and trade them live Stellar exchange.

Make sure to remember the following tips when distributing tokens:

  • Inflating token supply in a predefined schedule with pre-authorized transactions.
  • Issue a dividend.
  • Restrict who can hold your token.
  • Conducting an auction for your tokens.

Now, we have successfully issued a token on the Stellar network. Also, it is easier to do as compared to Ethereum. Transactions on the Stellar network will be cheaper and quicker.

If you are also looking to build a custom token on the Stellar network but do not have technical expertise, consult our Stellar Developers who can do it for you the way you want.

Author’s Bio

Akash Takyar
Akash Takyar
CEO LeewayHertz
Akash Takyar is the founder and CEO at LeewayHertz. With the experience of building over 100+ platforms for startups and enterprise allows Akash to rapidly architect and design solutions that are scalable and beautiful.
Akash's ability to build enterprise-grade technology solutions has attracted over 30 Fortune 500 companies, including Siemens, 3M, P&G and Hershey’s. Akash is an early adopter of new technology, a passionate technology enthusiast, and an investor in AI and IoT startups.
Start a conversation by filling the form
Once you let us know your requirement, our technical expert will schedule a call and discuss your idea in detail post sign of an NDA.

All information will be kept confidential.

 Send me the signed Non-Disclosure Agreement (NDA)

Insights