How to Create Token On Stellar Blockchain Network?
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:
- Step 1: Create two accounts (One for Issuance, Another for Distribution)
- Step 2: Create a trustline between two accounts
- Step 3: Lock the issuer account
- 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)
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:
Once you open this URL, it will return a JSON object and you will notice a balance of 10,000 testnet Lumens.
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.
All information will be kept confidential.
DeFi Development We provide decentralized finance development services to help clients bring transparency, trust and security into their finance operations by developing decentralized finance applications. Our DeFi Development ServicesAs a DeFi Development Company, we...read more
EHR Interoperability allows the electronic sharing of patients’ health records between different EHR systems and healthcare providers.read more
A fintech app should be easy-to-use and highly secure. Hiring an experienced development team can help you ensure robust fintech app development.read more