ZooBC wiki
Tokens and markets

Decimals and the step

You are looking at an old version of this page: revision #85 by zoobc.how, 2026-10-26 20:39 UTC. See the current version

Every balance on ZooBC, of ZBC or of any token, is counted in the same atomic unit: one hundred-millionth (10⁻⁸). A token's decimals, a number from 0 to 8 chosen when it is issued, do not change that unit. They say how many of the eight decimal places the token uses, and therefore the smallest amount of it that can move.

The step

Every amount that moves a token must be a whole multiple of its step:

step = 10^(8 − decimals) atomic units

The token's total supply must be a multiple of the step too. An amount finer than the step is refused.

Eight decimal places for a token with 2 decimals: the first two in use and the last six always 0; the step is 1,000,000 atomic units, 0.01 token
Eight decimal places for a token with 2 decimals: the first two in use and the last six always 0; the step is 1,000,000 atomic units, 0.01 token
DecimalsStep, in atomic unitsSmallest amount
0100,000,0001
110,000,0000.1
21,000,0000.01
3100,0000.001
410,0000.0001
51,0000.00001
61000.000001
7100.0000001
810.00000001

Whole units and fine units

Because the atomic unit never changes, one whole token is always 100,000,000 atomic units, whatever its decimals. A wallet converts what a person types into atomic units: 12.5 tokens is 1,250,000,000 atomic units, a valid amount for any token with at least 1 decimal.

The decimals therefore describe how finely a token can be divided:

  • a token with 0 decimals moves only in whole units, like tickets or seats;
  • a token with 8 decimals moves down to 0.00000001, like ZBC.

The fourteen genesis coins all have 8 decimals.

Where decimals matter

  • Order-book markets accept only tokens that use all 8 decimals: both assets of a market's pair need 8 (see markets and orders).
  • Swap offers accept any decimals (see swap offers), so a token with fewer decimals trades there.
  • A fee paid in the token gives up units rounded up to the token's step (see issuing a token).

So an issuer who wants the token traded on an order book chooses 8 decimals at issue.

See also