Divi Games

Courses / Game money

Escrow, stakes and "not gambling"

When a game takes a stake, the tokens move into the module's escrow account module:<id>:

alice --stake--> module:tictactoe <--stake-- bob
                        |
                 winner gets 2 x stake

The escrow account holds a balance like any address, but it has no key: only the module's code can move funds out of it, and only through escrow_out.

Every ending pays out

A well-built module must send the stake somewhere on every ending. Tic-tac-toe does: a win pays 2 * stake to the winner, a draw refunds both, a cancel refunds the creator, and a timeout after 150 blocks lets the waiting player claim. Free games (no stake) move nothing. MAX_STAKE caps a game at 1000 GOLD.

Because a failed action is rolled back as a whole, a stake that was escrowed is returned if the action fails.

Not gambling

Divi Games is a game, not a casino: testnet funds only, play-money GOLD and TDIVI, no cash out. Randomness is public and checkable (the Divi checkpoint hash, or a committed hash chain for blackjack), so no one, including the house, can quietly pick outcomes. Keep your own games to the same rule.