Skip to main content

The one rule

Callbacks always exchange the decimal value. 12.45, never 1245. Zero-Dash converts to and from integer storage internally; you never see minor units on the wire.

How Zero-Dash stores money

Internally every monetary value is a 64-bit integer. Each currency carries a decimal_places value that converts between that integer and the decimal exchanged in callbacks. This matters to you for one reason: it fixes the precision each currency gets, and anything beyond it is truncated.

Fiat

Fiat values are stored in centsdecimal_places = 2.
Currencies whose ISO definition has 0 or 3 decimals — JPY, TND and others — are nonetheless stored and exchanged with 2 decimal places. 1 JPY is 100 internal units and travels as 1.00, not 1.If your platform stores JPY as whole yen, convert at the boundary. Sending 1 where 1.00 is expected is the same number; sending whole yen where the decimal is expected is not.

Crypto

Every crypto asset is capped at 8 decimal places, even when the chain supports more. Worked examples of the internal representation:
ETH, BNB and SOL have more decimals on-chain than Zero-Dash carries. Any value you send or receive must fit within the precision in the table above. Sending 0.000000000000000001 ETH does not produce a tiny bet — it produces a value that truncates to zero.

Precision on your side

Use a decimal type, never a float

BigDecimal, decimal.Decimal, shopspring/decimal, Prisma.Decimal — anything exact. IEEE-754 binary floats cannot represent 0.1, and rounding errors in a wallet turn into reconciliation tickets.

Parse JSON numbers as strings

Most JSON parsers hand you a double before you can intervene. Configure the parser to keep raw numbers — json.Number in Go, parse_float=Decimal in Python, JsonNumberHandling in .NET — then build your decimal from the text.

Round only at the boundary

Compute in full precision; truncate to the currency’s places only when writing the value out.
Where a value could be ambiguous, sending it as a JSON string is accepted. Create free rounds campaign documents this explicitly for amount: send "2.50" if your language cannot emit 2.5 faithfully. Zero-Dash parses both as a decimal.

Currency codes

Codes follow ISO-4217EUR, USD, BTC, ETH — and crypto uses the same convention.
FUN is the virtual currency used by free-to-play sessions. It never reaches your wallet: demo sessions produce no callbacks at all.

Currency consistency

One currency is fixed for the entire life of an account ID. It must be the same value across:

Launch

The currency parameter you pass to Obtain game launch URL.

Authorization

balance.currency returned by Player authorization.

Every movement

stake.currency and payout.currency in each debit, credit and rollback.

Free rounds

currencyCode on both the campaign and the bonus code.
A mismatch anywhere in that chain is rejected. There is no conversion step in the middle.

Balance semantics

The balance you return is the balance after the operation was applied.
Games display this value to the player immediately. Returning the pre-movement balance shows a number that is one transaction stale, and players notice within a single round.