How It Works
KAJINO uses Pyth Entropy, a decentralized random number generator, to produce verifiable randomness for every game outcome. No server-side secrets, no manipulation — just math and cryptography.
The Formula
Each callback returns one Pyth Entropy V2 random value. KAJINO expands that value with a domain-separated hash, so each game can derive multiple deterministic outputs from the same verified source.
Domain Separator:
"KAJINO_V1"
Result Formula:
keccak256(abi.encodePacked("KAJINO_V1", randomNumber, saltNumber))The randomNumber is delivered by Pyth Entropy V2 through _entropyCallback. The saltNumber is derived from game-specific state, such as bet index or player action, when a game needs more than one random draw.
Pyth Entropy Flow
1. Player submits a wager plus the Pyth Entropy fee.
2. The game contract calls requestV2 and stores the returned sequence number.
3. Pyth calls back with the verified random number for that sequence.
4. The game derives the final result with KAJINO_V1 domain separation.
5. Payout or loss is settled inside the callback transaction.
Refund Mechanism
If the Pyth Entropy callback fails or never arrives, players are protected by an on-chain timeout. After 2000 blocks (~1.7 hours on Kaia), players can request a refund of their wager minus a small penalty (20%). This prevents funds from being locked indefinitely. A commit-wait period of 20 blocks prevents front-running refund attempts.