Finding missing Native Currency Symbol from Substrate Framework

Puru Chaudhary
Blockchain musing
Published in
2 min readSep 16, 2022

Substrate framework let you build your own blockchain and there are many tutorials, blogs and articles for the same. But one thing you won’t find is easy to have your own currency symbol for the new chain you have created.

When you create a blockchain that uses balances pallet and try to visualise it on PolkadotJS App, you will see the amount in pre-seeded accounts but the units are unspecified. But for more prominent chains you can see DOT (PolkaDoT), ACA(Acala) and so on. So how substrate achieve this ?

For some reason you won’t find much about this on internet. Also, you need to differentiate between Asset pallet and Balances pallet. Balances pallet should be used for you native coin powering the chain i.e ETH, BTC and others. Asset pallet should be used to create token similar to ERC20 tokens on Ethereum.

Steps to Add Currency symbol to native token of substrate chain.

  1. Locate chain_spec.rs file. Mostly under node/src/chain_spec.rs
  2. Go to function where you want to change this config i.e local_testnet_config, development_config and others.
  3. Update the code as below:
Added:     let mut props: Properties = Properties::new();let value = json!("XAS"); // Currency symbol
props.insert("tokenSymbol".to_string(), value);
Updated:
Pass Some(props) for the property field in from_genesis function.

That’s it. Go PolkadotJS app and connect it your chain. Outcome will be something similar to below:

XAS- Our Currency symbol for Native Token

Connect me on LinkedIn if you have ideas and can build on substrate chains.

https://www.linkedin.com/in/purushottam-chaudhary-377330225

--

--

Puru Chaudhary
Blockchain musing

Co-Founder & CTO @brahmGAN | Blockchain | Generative AI | Web 3.0 | Gaming | Linkedin: https://www.linkedin.com/feed/