r/ethdev • u/russkiy78 • 1d ago
My Project Made fully on-chain hold'em with no dealer, and a player who ghosts mid-hand doesn't kill the game anymore
Found this thread from a while back where someone asked if fully on-chain poker is actually doable. The most detailed answer was basically "I tried, but mental poker falls apart the moment a player stops responding, the hand just gets stuck". Yep, been there. Took me a while, but I think I got around it.
Short version: there's no dealer. Players shuffle the deck themselves. Each one encrypts it, shuffles it and proves in zero knowledge they didn't swap anything. As long as one of them is honest, nobody knows the order. To open a card, everyone in the hand has to chip in their piece of the key. The contract checks all the proofs and runs the betting. No server, no admin keys.
Now the fun part: someone ghosts. Every move has a deadline. Miss it and you're folded, you pay a penalty, and your chips stay in the pot. Whoever's left builds a fresh deck and draws the missing board cards from it. Cards already in play get filtered out without anyone seeing them. So the hand always finishes, and stalling always costs whoever stalls.
What it can't fix: people colluding over Discord (no online poker can), and whoever gives the last key share sees that card a split second before everyone else. That one is provably unfixable without a trusted party, so the best I could do was make it hard to exploit.
Crypto is BLS12-381 via the EIP-2537 precompiles, so it runs on any EVM chain that has them, mainnet included.
Wanna try? https://russkiy78.github.io/trust-poker-beta/
It's testnet only for now (Plasma testnet, free test tokens, no real money). There are bots sitting at the tables, so you'll always have someone to play against.
Ask me anything, I'll be around.