How bitpolito/mininggame works
Bitcoin Block Mining Simulator is an educational browser game: players compose affordable, fee-maximizing blocks and solve proof-of-work challenges, then build a chain toward a goal. Easy and Hard modes share transaction and game rules; solo play runs locally, while multiplayer adds room creation/joining, independent player chains, host race monitoring, and server-side mine reporting. The graph follows documented capabilities and sampled call references; unsampled subsystems use exact paths from the tree, and their internal links are omitted where evidence is unavailable.
Main entry points: App.jsx App and session flow · HardGame.jsx Hard mode · room.js Room handler · gameEngine.js Game engine
Components 26
Game experience
- App and session flow
src/App.jsx - Easy mode
src/games/EasyGame.jsx - Hard mode
src/games/HardGame.jsx - Mining interface
src/components/game - Mempool table
src/components/game/MempoolTable.jsx - How-to-play guide
src/HowToPlay.jsx
Mining rules
- Game engine
src/lib/gameEngine.js - Transaction selection
src/lib/txSelection.js - Game drafts
src/lib/gameDraft.js - Mempool generation
src/lib/mempool.js - Hashing and targets
src/lib/targetHash.js - Nonce challenge
src/lib/powDice.js
Multiplayer rooms
- Room invitations
src/components/RoomInvite.jsx - Host dashboard
src/components/HostDashboard.jsx - Room API client
src/lib/roomApi.js - Room joining
src/lib/roomJoin.js - Room identity
src/lib/roomAuth.js - Room configuration
src/lib/roomConfig.js - Race projection
src/lib/raceProjection.js
Room service
- HTTP server
server.js - Room handler
api/room.js - Key-value storage
api/kv.js - Health endpoint
api/health.js
Shared experience
- Locale context
src/i18n/LocaleContext.jsx - Modal focus
src/hooks/useModalFocus.js
Other components
- Player
Connections 33
- Player → App and session flow: starts or joins
- App and session flow → Easy mode: opens mode
src/App.jsx - App and session flow → Hard mode: opens mode
src/App.jsx - App and session flow → Room API client: requests room actions
src/App.jsx - Easy mode → Game engine: validates mining
src/games/EasyGame.jsx - Hard mode → Game engine: validates mining
src/games/HardGame.jsx - Hard mode → Room API client: reports mine
src/games/HardGame.jsx - Easy mode → Game drafts: loads game draft
src/games/EasyGame.jsx - Hard mode → Game drafts: loads game draft
src/games/HardGame.jsx - Easy mode → Mining interface: renders
src/games/EasyGame.jsx - Hard mode → Mining interface: renders
src/games/HardGame.jsx - Mining interface → Mempool table: renders
src/games/HardGame.jsx - Easy mode → How-to-play guide: opens rules
src/games/EasyGame.jsx - Hard mode → How-to-play guide: opens rules
src/games/HardGame.jsx - Game engine → Transaction selection: checks selection
src/lib/gameEngine.js - Game engine → Mempool generation: generates transactions
src/lib/gameEngine.js - Game engine → Hashing and targets: computes proof
src/lib/gameEngine.js - Hard mode → Nonce challenge: uses nonce challenge
src/games/HardGame.jsx - Room invitations → Room joining: builds join link
src/components/RoomInvite.jsx - App and session flow → Room joining: reads join code
src/App.jsx - App and session flow → Room API client: creates room
src/App.jsx - Host dashboard → Race projection: projects race
src/components/HostDashboard.jsx - Host dashboard → Room configuration: reads capacity
src/components/HostDashboard.jsx - Room API client → Room handler: sends requests
- HTTP server → Room handler: routes requests
server.js - Room handler → Key-value storage: reads and writes
api/room.js - Room handler → Game engine: validates room mining
api/room.js - Room handler → Room configuration: uses room limits
api/room.js - Room handler → Hashing and targets: checks targets
api/room.js - HTTP server → Health endpoint: routes health checks
server.js - App and session flow → Locale context: uses translations
src/App.jsx - How-to-play guide → Modal focus: traps dialog focus
src/HowToPlay.jsx - Room invitations → Modal focus: traps dialog focus
src/components/RoomInvite.jsx