Solo bets
Six games are played alone against the house: two dice, coin flip, roulette, slots, lottery and crash. A bet is a CreateApp transaction with one seat. Its outcome comes from randomness that did not exist when the bet was placed, and the apps pool pays a win.
Placing a bet
The bettor sends CreateApp with the game's type (16 to 21), the bet and the stake, in ZBC or in a token. The stake moves into the apps pool when the bet executes. Any account may bet, including accounts with Ethereum- or Bitcoin-style keys, which cannot take a seat in a multiplayer game (multiplayer apps).
A trailing byte N, from 1 to 100, plays the same bet N times from one seed, with the stake split evenly between the plays.
When and how the result is drawn
A bet included in block N is resolved at block N + 2, with that block's seed, about 30 seconds later. Each block's seed is computed by its producer from the previous seed with a verifiable random function (block seed (VRF)), so while the bet is landing in block N, the seed of block N + 2 does not exist yet. Nobody can predict the result, and the producer that included the bet cannot see it first. If the block at N + 2 is produced by the bettor's own node (the owner accounts are compared), the bet waits for a later block made by someone else.
The draw is a hash of that seed and the app's id, under a tag of its own:
r = LE64(first 8 bytes of SHA3-256("zbc-apps" ‖ seed ‖ LE64(app id) ‖ LE64(0)))
The first play of a multi-play uses r; the later plays use the outputs of a splitmix64 generator seeded with r. Anyone can recompute the result from public data and check the payout. There is no secret to reveal and no daily batch: every bet is settled on its own.
Payout tables
| Game | Bet | A win pays | House edge |
|---|---|---|---|
| Coin flip (17) | heads or tails | 1.98× | 1 % |
| Two dice (16) | under 7, or over 7 | 2.28× | 5 % |
| lucky 7 | 5.70× | 5 % | |
| an exact total | 34.20 ÷ ways (2 or 12: 34.2×) | 5 % | |
| Roulette (18) | a single number | 36× | 1/37, about 2.7 % |
| red or black | 2× | about 2.7 % | |
| Slots (19) | triple 7, another triple, any pair | 50×, 15×, 1.8× | about 10.7 % |
| Lottery (20) | one number from 0 to 99 | 90× | 10 % |
| Crash (21) | a target T from 1.01× to 10.00× | T, when the crash point reaches T | about 1 % |
For an exact dice total, the ways are the number of ways two dice can make it: 6 − |7 − total|. Roulette has 37 pockets, 0 being green, and its colours follow the real European wheel. Slots has three reels of eight symbols, for an expected return of 457.4/512. In crash the target is fixed when the bet is placed; there is no move to cash out early.
The house edge is built into each table. In a coin flip you win half of the time and a win returns 1.98 times the stake, so on average each ZBC staked comes back as 0.5 × 1.98 = 0.99 ZBC, and the remaining 1 % stays with the apps pool. A loss moves nothing, since the stake is already in the pool.
The bet cap
Before a bet is accepted, the node computes the largest payout it could ever produce, not its average, and compares it with a cap of 5 % of the pool's balance in the stake's asset:
largest payout ≤ floor(pool balance × 500 ÷ 10,000)
The largest payout is the bet's own multiplier for dice, 1.98× for a coin flip, 36× for roulette, 50× for slots, 90× for the lottery and T for crash. A bet over the cap is refused when it is submitted ("bet too large for the apps pool"), and one that reaches a block anyway is a paid no-op.
The cap means that no single lucky result can empty the pool. A second limit, the per-block allowance, can spread a very large win over several blocks (apps pool).