Intro: What is Stellar?
Stellar is an open-source network for currencies and payments. It is public, there is no real owner as it is a decentralized network. See the intro section on their website, as it speaks for itself better than i could do.
Intro: Why do we issue our own asset?
We came up with the idea while experimenting with Stellar (and other blockchains) and decided to create an asset/token to hook it up to codeaffen on github. The token would function within that ecosystem as a reward for the sake of gamification while submitting code & contributing in other ways to the project. Every good role-playing game has its own XP, you get the idea.
The token was named AFFEN (german: “monkey”) and is represented by that neat and busy code monkey on our logo. There is a supply of 1,000,000 code monkeys to give away for contributing. AFFEN, anyone?
Intro: Where to start?
Best starting point is the official Stellar documentation, but there is also great public articles & videos regarding this topic. I recommend reading at least into the documentation before you start, just to get a feeling what to do and why to do it.
Howto: Let’s go
- You will need an active wallet, which you use to fund two new accounts with. Make sure you have 5 XLM in that wallet which can be transfered out into the two new accounts. I used my Lobstr wallet for this.
- Access Stellar Laboratory. Select “public” on the top right corner.
- Create an ISSUER account: Click
Create Account
, then clickGenerate keypair
. Note down the values forPublic Key
&Secret Key
. - Create an DISTRIBUTOR account: Click again on
Generate keypair
, also note down the second set of values forPublic Key
&Secret Key
. - Make sure you have noted both values for each account. Rule of thumb: do not ever hand out the
Secret Key
to anyone else, but you can share thePublic Key
anytime.
Howto: Fund ISSUER and DISTRIBUTOR accounts
- Activate the ISSUER account by sending 2 XLM to it through your Stellar wallet. Use the
Public Key
(ISSUER) as recipient. - Activate the DISTRIBUTOR account by sending 3 XLM to it through your Stellar wallet. Use the
Public Key
(DISTRIBUTOR) as recipient. - Give it a few seconds, then check both accounts on stellar.expert. Both accounts should be active and present the amount of XLM, which you just transfered.
Howto: Establish trustline from DISTRIBUTOR to ISSUER
- Access Stellar Laboratory. Select “public” on the top right corner.
- Select
Build Transaction
, paste thePublic Key
(DISTRIBUTOR) into theSource Account
field - Click
Fetch next sequence number for account starting with...
. - Scroll down to
Operation Type
and selectChange Trust
. - In the Asset field choose between
Alphanumeric 4
orAlphanumeric 12
. This defines the possible length of your Asset Code. - Enter your Asset Code in the corresponding field (e.g.
ABCDEF
). This will be your token’s name. Note down your Asset Code. - Enter the amount of tokens you want to generate into the
Trust Limit
field (e.g. 1,000,000) - Scroll down to
Sign in Transaction Signer
and click it. - Paste your
Private Key
(DISTRIBUTOR) into theAdd Signer
field. - Scroll down to
Sign in Transaction Submitter
and click it. - Scroll down to
Submit Transaction
and click it.
Howto: Send the new token from ISSUER to DISTRIBUTOR
- Access Stellar Laboratory. Select “public” on the top right corner.
- Select
Build Transaction
, paste thePublic Key
(ISSUER) into theSource Account
field. - Click
Fetch next sequence number for account starting with...
. - Scroll down to
Operation Type
and selectPayment
- Paste your
Public Key
(DISTRIBUTOR) in theDestination
field. - In the Asset field choose between
Alphanumeric 4
orAlphanumeric 12
as the length for your Asset Code which you picked earlier. - Below that enter your Asset Code (e.g.
ABCDEF
). - Below that enter your
Public Key
(ISSUER). - Choose the amount of your token you want to send to the DISTRIBUTOR (e.g. 1,000,000 for all token which you created earlier) in the
Amount
field. - Scroll down to
Sign in Transaction Submitter
and click it. - Scroll down to
Submit Transaction
and click it. - Give it a minute, then check both accounts on stellar.expert. Both accounts should present the amount of XLM, plus the amount of your new token (e.g.
ABCDEF
) on the DISTRIBUTOR account.
Howto: Publish information about your new token
Okay, that is your new token. In the process you have created two accounts by paying little XLM into both, established a trustline from DISTRIBUTOR account to ISSUER account, then you paid from the ISSUER to the DISTRIBUTOR account a specific amount of your new token. The DISTRIBUTOR account is going to handle outgoing transactions for your new token from now on.
Next: let’s advertise your new token. The process is well defined in the official Stellar documentation. All you need is to create a file called stellar.toml
and host it on your domain/webservice. Follow the documentation and fill the required fields, decide for yourself what on optional information you want to provide. Also, this is the right place to add a link to a shiny logo for your new token.
Important note: As an example, we placed the stellar.toml
file for our AFFEN
token in https://codeaffen.org/.well-known/stellar.toml
, because codeaffen.org
is our home domain. This can be quite tricky, if you don’t host your own domain, but maybe decided to use Github Pages with jekyll like we did. If you run into trouble just contact us.
As a last step, let’s connect the home domain with the ISSUER account, so everybody knows where that new token comes from.
- Access Stellar Laboratory. Select “public” on the top right corner.
- Select
Build Transaction
, paste thePublic Key
(ISSUER) into theSource Account
field. - Click
Fetch next sequence number for account starting with...
. - Scroll down to
Operation Type
and selectSet Options
. - Scroll down to
Home Domain
and enter your home domain. You can skip the other fields. - Scroll down to
Sign in Transaction Signer
and click it. - Scroll down to
Add Signer
and paste theSecret Key
(ISSUER). - Scroll down to
Submit in Transaction Submitter
and click it. - Scroll down to
Submit Transaction
and click it. - Give it a minute, then check both accounts on stellar.expert. Both accounts should present the amount of XLM, plus the amount of your new token (e.g.
ABCDEF
) on the DISTRIBUTOR account. On the ISSUER account you will see a new entry forHome domain
,Organization metadata
andPrincipals
. Search for your token inAssets
and you will find additional information inCurrency
Check your new token in your Stellar wallet
You can now add the new token/asset in your wallet, an active trustline from your Stellar wallet to the DISTRIBUTOR account is still necessary. On my Lobstr wallet, this is handled by the app itself while adding a new Asset
. All this information should be reflected in your Stellar wallet, along with that nice logo, about a few hours later.
What’s next?
As i mentioned in the intro why we issue our own asset, the next steps will be to automate the whole process by writing some code and hook it up to Github. Stay tuned for our next episode!