Skip to main content

Balances

This section will cover how Edgeware accounts and balances and how they are represented on-chain.

Address Format

Edgeware accounts each have an AccountID.The address format used in Substrate-based chains is SS58. SS58 is a modification of Base-58-check from Bitcoin with some minor modifications. All Edgeware addresses will start with a lowercase letter like j, m, l, i.

Addresses belonging to a particular Substrate-based chain are identified by an address type prefix. For Edgeware, this prefix is 7.

You can find other network prefixes here, here are some notable ones:

  • Polkadot addresses always start with the number 1.
  • Kusama addresses always start with a capital letter like C, D, F, G, H, J...
  • Generic Substrate addresses start with 5.

It's important to understand that the different formats for different networks are merely different representations of the same public key in a private-public keypair generated by an address generation tool. While it's currently recommended that you use different public-private keypairs across chains, it's possible to reuse them. Addresses are compatible across Substrate-based chains as long as you convert the format. More information on address portability within Substrate and Polkadot networks can be found here.

Balances Pallet

The balances pallet defines EDG, the native token for Edgeware. More specifically, it defines storage items that track the tokens a user has, functions that users can call to transfer and manage those tokens, APIs which allow other modules to burn or mint those tokens, and hooks which allow other pallets to trigger functions when a user's balance changes.

The balances pallet is used throughout the Edgeware Runtime. Allowing the chain to keep track of governance and council votes, treasury balances, earning staking rewards, and depositing EDG into the contract and EVM pallet to run permissionless smart contracts.

Existential Deposit

When you generate an account (address), you only generate a key that lets you access it. The account does not exist yet on-chain. For that, it needs the existential deposit: 0.001 EDG. At current market prices, this means that almost anyone around the world can have an Edgeware account.

Having an account go below the existential deposit causes that account to be reaped. The account will be wiped from the blockchain's state to conserve space, along with any funds in that address. You do not lose access to the reaped address - as long as you have your private key or recovery phrase, you can still use the address - but it needs a top-up of another existential deposit to be able to interact with the chain.

Here's another way to think about existential deposits. Ever notice those Thumbs.db files on Windows or .DS_Store files on Mac? Those are junk, they serve no specific purpose other than making previews a bit faster. If a folder is completely empty save for such a file, you can remove the folder to clear junk off your hard drive. That does not mean you lose access to this folder forever - you can always recreate it. You have the key, after all - you're the computer's owner. It just means you want to keep your computer clean until you maybe end up needing this folder again, and then recreate it. Your address is like this folder - it gets removed from the chain when nothing is in it, but gets put back when it has at least the existential deposit.

Balance Reservations

When interactions with other pallets occur, certain reservations may be incurred by an individual's balance. A few terms are useful to define.

Total: The total amount of EDG held by any address.

Free: The total amount of EDG that a user is able to transfer to another account. We get this by subtracting Total from any reserved tokens.

Reserved: The amount of EDG that has been used by other pallets. This would include voting for governance votes as well as participating in staking. While these tokens are still owed by an account holder, they may be slashed by another subsystem or pallet. For example, when a user nominates a validator they stake tokens for the opportunity to validate transactions. In the balances pallet, their tokens will be reserved, in the event of slashing, this amount may be deducted from the user's balance.