How Bets Work
Last updated
Last updated
Here's the anatomy of a bet on Zeebit:
A player selects their bet inputs, sets their stake and hits the button.
Within milliseconds, their bet hits a node on the blockchain validator (Solana x MagicBlock or Sonic), which communicates this transaction for processing to the network.
The game’s contract will interpret the request, perform validations and convert the bet into a ‘Game Instance’ (for example, schedule that the roulette wheel is to be spun).
The player’s bets are each validated with respect to the rules of the game, and if everything's in order, the contract will "lock" balance — both the player's wager as well as the potential payout the pool may need to make. This ensures that both the player and the protocol have the necessary balances to honour their side of the bet, should the bet go in either direction.
A request is invoked from the game contract to the verifiable randomness (VRF) oracle, which emits events to listening provider nodes. These nodes immediately pick up the transaction emit, take the inputs and produce verifiable randomness which is submitted (alongside a proof) back to the randomness program.
The randomness program checks that everything is in order, and invokes a callback to the game program which uses the randomness to determine the result of the game, and subsequently assesses the result and payouts of the bets.
The game contract determines what funds should be released - either to the liquidity pool in the case of a loss, or paid out directly to the player’s wallet, in the case of a player's win.
…and all of this happens across thousands of validators in just a few milliseconds.