Skip to content
Mental Poker

Mental Poker

Onchain texas holdem poker

Created on 28th April 2025

Mental Poker

Mental Poker

Onchain texas holdem poker

The problem Mental Poker solves

There are very few truly onchain entertainment apps that are fun to use—especially in the realm of games. A major problem with onchain games has been privacy. Without encryption, an onchain card game isn’t so fun if someone can just peek at the order of the cards in the deck. This was the main problem Mental Poker aimed to solve - and fortunately the solution could be applied to any group card or board game! Additionally, packaging the app to work in a Farcaster client mini app context helps solve the discoverability problem of onchain games.

Challenges I ran into

A significant hurdle during development was adhering to the Ethereum smart contract size limit of 24KB, requiring careful optimization of the Solidity code into multiple contracts to fit all the necessary logic. Tooling and debugging presented initial difficulties, but adopting Foundry (Forge and Anvil) and Wagmi generate proved invaluable in establishing a quick development and testing feedback loop for quicker iteration. Although sometimes deploying contracts to Base Sepolia and using Etherscan’s UI to debug was easier to determine the bug.

Ensuring a smooth and responsive user experience also posed a challenge, particularly in managing asynchronous data updates from the blockchain as quickly as possible to keep players from waiting. To mitigate issues with potentially stale data affecting shuffle and reveal functions, extensive front-end coordination was implemented to guarantee the availability of accurate information before initiating transactions. Sometimes submitting stale data still occurs and players will see an "Invalid card" error.

Generating test data was also a challenge. I had to generate many of the same tests in both Typescript and Solidity. To get test data in Solidity code, I had to format and output certain encryption examples from Typescript scripts because the EVM only has enough gas to verify certain encryption steps, not compute the encryption steps.

Tracks Applied (2)

Consumer

Mini-apps

Cheer Project

Cheering for a project means supporting a project you like with as little as 0.0025 ETH. Right now, you can Cheer using ETH on Arbitrum, Optimism and Base.

Discussion

Builders also viewed

See more projects on Devfolio