Skip to content

ChainBet is a Decentralized, high-performance sportsbook built on Linera, enabling fast, fair, and trustless sports betting through microchains.

License

Notifications You must be signed in to change notification settings

prjktcode/ChainBet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🎲 ChainBet — Decentralized Betting on Linera

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.


🚀 Overview

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

🧠 Core Idea

Each player places a bet on a specific outcome (e.g., a coin toss, sports result, or community event). The system:

  1. Locks each bet on-chain.
  2. Resolves the result using deterministic or oracle-fed data.
  3. Distributes winnings automatically.

Fair, transparent, and provable.


🏗️ Project Structure

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

⚙️ Installation & Setup

🦀 Backend (Linera Smart Contract)

cd chainbet
cargo build --release --target wasm32-unknown-unknown
linera publish --wasm-path target/wasm32-unknown-unknown/release/chainbet_contract.wasm

💻 Frontend (Typescript)

cd frontend
npm install
npm run dev

Visit 👉 http://localhost:3000


🌐 Connecting to Linera

To run locally:

linera net up --local
linera service run --port 8080

Then, configure your frontend to use the service endpoint in .env:

VITE_LINERA_SERVICE_URL=http://127.0.0.1:8080

🎮 Gameplay Flow

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

🧩 Tech Stack

Layer Technology
Smart Contract 🦀 Rust + Linera SDK v0.15.4
Frontend ⚛️ TypeScript
Chain Runtime ⚙️ Linera Protocol
Storage ⛓️ linera-views
Hosting 🌐 GitHub Pages / Vercel

🤝 Contributing

Pull requests are welcome! To contribute:

git clone https://github.com/prjktcode/ChainBet.git
git checkout -b feature/your-feature

🧾 License

Licensed under the Apache 2.0 License © 2025 Zefchain Labs, Inc. & ChainBet Contributors


Preview

COMING SOON

Built with ❤️ on Linera — where speed meets decentralization.

About

ChainBet is a Decentralized, high-performance sportsbook built on Linera, enabling fast, fair, and trustless sports betting through microchains.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published