Dev.to
7/24/2026

Prediction Markets Show Your Bet Instantly — So I Hid Mine With Zero-Knowledge Proofs
Short summary
The author built Hidden League Forecast, a privacy-focused prediction market MVP on Midnight blockchain where participants' picks stay hidden until reveal time using zero-knowledge proofs. The smart contract, written in Compact, uses witness variables to keep the chosen team, secret key, and salt off-ledger, while only stakes and commitment hashes are publicly recorded. The article walks through the contract code showing how each phase (open, reveal, resolved, claim) protects participant privacy.
- •Built a privacy-preserving prediction market on Midnight blockchain using ZK proofs
- •Compact language enforces secret values stay off-ledger via witness declarations and disclose() type system
- •Only stake amounts and commitment hashes are public; team picks hidden until reveal phase
Generated with AI, which can make mistakes.
Is this a good recommendation for you?



