All projects
BanhMiCast
Privacy-preserving prediction market with encrypted batching and LMSR AMM
Prediction Markets
What it is
BanhMiCast by Phú Nhuận Builder — Project Description
BanhMiCast is a privacy-preserving decentralized prediction market built on Ethereum Sepolia that enables users to bet on future events without exposing their trading intentions to the public mempool.
Traditional prediction markets suffer from two structural problems:
- Liquidity fragmentation — each outcome has its own pool, making markets inefficient and shallow.
- Front-running and copy-trading bots — bets submitted to the blockchain are visible before execution, allowing bots to exploit user intent.
BanhMiCast solves these issues using two key innovations: - Joint-Outcome AMM (WorldTable)
Instead of separate liquidity pools for each outcome, BanhMiCast uses a single unified liquidity pool powered by the Logarithmic Market Scoring Rule (LMSR).
This design:
- Ensures continuous liquidity for all outcomes
- Guarantees probabilities always sum to 1
- Provides deterministic pricing across nodes
All computations use 18-decimal fixed-point BigInt arithmetic to maintain deterministic results across distributed nodes.
- Encrypted Batching via Chainlink CRE
To prevent front-running, BanhMiCast introduces encrypted intent batching.
The process works as follows: - Users encrypt their bet payload locally in the browser
- Only a commitment hash is submitted on-chain
- The Chainlink Runtime Environment (CRE) periodically processes a batch
- CRE nodes threshold-decrypt the batch, compute the LMSR pricing update, and produce an execution result
- The result is verified on Ethereum Sepolia using DON signatures and applied to the market state
Because bets remain encrypted until the batch is sealed, no validator or bot can see user intent before execution.
Architecture Overview
The system consists of four layers:
Frontend
- React + Vite interface
- Client-side encryption of bet payloads
- Market exploration, trading, and portfolio management
Smart Contracts (Solidity) - BanhMiCastMarket — AMM state and outcome pricing
- BanhMiCastEscrow — collateral locking and payouts
- BanhMiCastVerifier — Chainlink DON signature verification
Off-chain Compute (Chainlink CRE) - Batch decryption
- Deterministic LMSR computation
- Execution result generation
Workflow Runtime - Go-based CRE workflow compiled to WASM
- Triggered by cron schedule
- Outputs verifiable execution data for on-chain settlement
Security Features
BanhMiCast includes multiple protections to ensure fair and secure markets: - Encrypted order batching prevents front-running
- Threshold decryption ensures no single node can access plaintext bets
- Deterministic LMSR math avoids consensus divergence
- Replay protection using batch IDs
- Emergency refund mechanism if batch settlement fails
Impact
BanhMiCast demonstrates how privacy-preserving off-chain computation combined with deterministic on-chain settlement can significantly improve decentralized market infrastructure.
This architecture enables prediction markets that are: - Fairer — no front-running or copy-trading
- More liquid — unified outcome liquidity
- Scalable — heavy computation handled off-chain
- Trust-minimized — verified by Chainlink DON signatures
How it Works
We built this project with 100% Google Antigravity IDE
Links
Created by
- Bernie Nguyen
- Phung The Anh
- Khai Truong