A fast, scalable, and transparent prediction game powered by Linera Protocol. Bet on outcomes, challenge friends, and let the chain decide — all on-chain, all fair.
ChainBet is a decentralized betting dApp built on the Linera Protocol, combining:
- 🦀 Rust smart contracts for secure, on-chain logic
- ⚡ TypeScript frontend for an elegant, reactive user experience
- 🔗 Linera’s parallel chains for scalable betting without gas wars
Each player places a bet on a specific outcome (e.g., a coin toss, sports result, or community event). The system:
- Locks each bet on-chain.
- Resolves the result using deterministic or oracle-fed data.
- Distributes winnings automatically.
Fair, transparent, and provable.
ChainBet/
├── chainbet/ # Linera smart contract + service (Rust)
│ ├── src/
│ ├── Cargo.toml
│ ├── linera.yaml
│ └── ...
├── frontend/ # React/TypeScript app
│ ├── package.json
│ ├── tsconfig.json
│ ├── src/
│ └── public/
├── README.md
└── .gitignore
cd chainbet
cargo build --release --target wasm32-unknown-unknown
linera publish --wasm-path target/wasm32-unknown-unknown/release/chainbet_contract.wasmcd frontend
npm install
npm run devVisit 👉 http://localhost:3000
To run locally:
linera net up --local
linera service run --port 8080Then, configure your frontend to use the service endpoint in .env:
VITE_LINERA_SERVICE_URL=http://127.0.0.1:8080
| Step | Action | Description |
|---|---|---|
| 🎯 1 | Create Game | Define the event and possible outcomes |
| 💰 2 | Place Bets | Users stake tokens on chosen outcomes |
| ⚖️ 3 | Resolve | The contract verifies result |
| 🏆 4 | Payout | Winnings automatically distributed |
| Layer | Technology |
|---|---|
| Smart Contract | 🦀 Rust + Linera SDK v0.15.4 |
| Frontend | ⚛️ TypeScript |
| Chain Runtime | ⚙️ Linera Protocol |
| Storage | ⛓️ linera-views |
| Hosting | 🌐 GitHub Pages / Vercel |
Pull requests are welcome! To contribute:
git clone https://github.com/prjktcode/ChainBet.git
git checkout -b feature/your-featureLicensed under the Apache 2.0 License © 2025 Zefchain Labs, Inc. & ChainBet Contributors
COMING SOON
Built with ❤️ on Linera — where speed meets decentralization.