Trustless fair-play gambling using TEE and Oasis Sapphire — no cheating, just the game
TR.I.G.O. (Trustless Implementation of Gambling Online) is a blockchain-based framework that ensures fairness and transparency in online gambling. It addresses the critical issue of trust in digital casinos, where players currently have no guarantee that games are not rigged or manipulated by the house.
By leveraging Oasis Sapphire, a privacy-focused blockchain platform that integrates Trusted Execution Environments (TEE), and ROFL, an EVM-compatible chain supporting verifiable randomness and confidential smart contracts, TR.I.G.O. eliminates the possibility of tampering, peeking, or cheating by centralized operators.
In TR.I.G.O., all sensitive operations—like deck shuffling, card distribution, and game rule enforcement—are securely executed inside the TEE. Each card is encrypted with the player’s public key, and a cryptographic commitment (hash) of the deck is shared at the start of the game. At any time, the player can verify the integrity of the entire game by checking that the revealed deck matches the original commitment.
The system is game-agnostic and supports a variety of card and tile-based games (e.g., Poker, Black Jack, Mahjong, Domino). A future roadmap includes supporting P2P gambling without a centralized house, expanding to multi-table games, and creating a contract factory for decentralized deployments.
TR.I.G.O. is a step toward provably fair and trustless online gambling — where the only gamble is the game itself, not the platform.
For this project, we chose to implement Blackjack as a use case. The smart contract is responsible for shuffling the deck, validating its integrity, and generating a commitment (hash) that defines the exact card order, while keeping the deck's content hidden to prevent cheating. The smart contract can only be accessed by an application running inside a TEE (Trusted Execution Environment) using ROFL. This application, running as a Telegram bot, handles the entire game logic, which is modular and can be extended to support any game. It also leverages ROFL to provide a remote attestation, certifying both the integrity of the game code and the untampered state of the deck, ensuring a fully trustless and verifiable gaming experience.