
How Commit–Reveal Makes a 50-50 Coin Flip Actually Fair on Base
Everyone in crypto says "provably fair". Fewer people are willing to walk through the exact mechanics. This is how we implemented a true 50-50 P2P USDC coin flip on Base using a simple commit–reveal pattern, zero rake, and non-custodial smart contracts: 1. The design constraints We started with a few hard rules: No house edge or rake. Winner takes 100% of the pot. Yoss.gg never holds user funds in a custodial wallet. Every flip must be independently verifiable on-chain. UX has to work for someone who has never touched a wallet before. Those constraints immediately kill most "crypto casino" architectures. So we built a minimal primitive instead: one contract, one coin, one flip. 2. Why commit–reveal and not just blockhash Using blockhash or timestamps for randomness looks simple but is trivial to manipulate—especially for miners/validators and contracts that can choose when to settle. Commit–reveal gives you: A private secret at commit time A public commitment stored on-chain A reveal s
Continue reading on Dev.to
Opens in a new tab



