Welcome to Bit-Toss! This is a fun, interactive demo dApp where you can play an Odd/Even prediction game on live Bitcoin block data. 🎲✨
- 🔮 Odd/Even Prediction Game – Guess if the last bit of the next block hash will be odd or even!
- ⛓️ Live Block Data – Pulls real Bitcoin block data from Sandshrew.
- 🏆 Win/Lose Feedback – See if your guess was right, plus a random BTC loss (just for fun).
- 📊 Block Explorer – View recent blocks and their details.
- 💻 Modern UI – Built with React + Vite for a smooth experience.
- React (TypeScript)
- Vite
- React Router
- CSS Modules
- Vercel (deployment)
- Node.js (v16+ recommended)
- npm (v7+)
git clone https://github.com/juanezamudio/bit-toss.git
cd bit-tossnpm installnpm run devOpen your browser and go to: http://localhost:5173
- Build the app:
npm run build
- Preview the production build:
npm run preview
- Click Odd or Even to lock in your guess for the next block.
- When a new block arrives, the app checks the last bit of the block hash:
- If your guess matches, you win! 🎉
- If not, you lose (and see a random BTC loss for demo fun).
- Try again on the next block!
frontend/
├── src/
│ ├── components/ # Reusable UI components
│ │ ├── Navbar.tsx
│ │ └── Explorer.tsx
│ ├── pages/ # Page components
│ │ ├── Home.tsx
│ │ └── Explorer.tsx
│ ├── services/ # API and service layer
│ │ └── api.ts
│ └── App.tsx # Root component
├── public/ # Static assets
└── index.html # Entry HTML file
- Home Page: Odd/Even prediction game, recent block info, interactive UI
- Explorer Page: Browse and inspect block details
Check it out live: https://bit-toss-nine.vercel.app/
PRs welcome! Have fun and toss some blocks! 🚀
MIT
Made with ❤️ by BitToss Team @ Pleb.fi Miami Hackathon 2025