project screenshot 1
project screenshot 2
project screenshot 3
project screenshot 4
project screenshot 5
project screenshot 6

Mental Poker

Trustless poker game using SRA encryption and zero-knowledge proofs on Aleo.

Mental Poker

Created At

ETHGlobal Trifecta - Zero Knowledge

Winner of

Aleo

Aleo - Best private dApp on Aleo 2nd place

Project Description

Mental Poker is a trustless multiplayer poker game built on the Aleo blockchain, leveraging zero-knowledge proofs and commutative SRA encryption to ensure privacy and fairness. In traditional poker games on-chain, card data is public by default due to transparent ledgers. Our system solves that by enabling all players to encrypt the deck without revealing any card content.

Each player encrypts the deck with their own key and shuffles it. Due to the commutative nature of the encryption, cards can later be revealed only after all players have decrypted them in reverse order. This allows players to reveal only the cards they need to see—no one has access to the full deck.

The game flow is maintained using a custom state machine that enforces turn logic, manages card states, and validates plays. All key cryptographic operations are executed through Aleo’s Leo language, which compiles into provable logic to maintain game integrity without exposing player data.

This project demonstrates how zero-knowledge cryptography can enable provably fair games on-chain without compromising privacy.

How it's Made

We built Mental Poker using Aleo’s zero-knowledge framework and Leo programming language to handle encrypted card logic, deck shuffling, and multi-party decryption. Each card is a ciphertext encrypted using SRA commutative encryption, implemented in Leo.

The frontend is built using TypeScript and communicates with the game logic via Leo Smart Contract. Players interact with a browser-based UI that manages the state machine for turn-based gameplay, using local signatures and on-chain proof verification.

The core state machine handles actions like: shuffle, encrypt, decrypt, deal, and reveal — each represented as separate Leo programs producing zero-knowledge proofs. These proofs are used to validate actions without exposing private data on-chain.

We implemented SRA manually within Leo due to its unique commutative property and built a modular game client that supports adding more games using similar mechanics in the future. All of the gameplay functionality lives on the smart contract. There’s no centralized server — the entire logic is designed to be distributed and trust-minimized, showcasing a practical zero-knowledge application.

More information at: https://github.com/ottodevs/zkpoker/blob/main/README.md

background image mobile

Join the mailing list

Get the latest news and updates