StarkPong is an unfinished MVP for a fully P2P real time multiplayer game secured by StarkNet.
Players use off-chain burner addresses to communicate via state channels, connecting via BitTorrent and WebRTC. The game can be played off-chain and settled on-chain, but the whole game logic is also available on-chain, allowing for conflict-resolution and even a theoretical fully on-chain play session.
The idea for the project is not simply to develop a game, but a preset or interface for simple, multiplayer, fully P2P (no central server of any kind, just Starknet + the frontend) games with money at stake to be more easily developed.
- Cairo1 contracts are nearly complete. There's a token for making bets, a Game Room Factory that deploys new Game Room contracts, and the whole game is coded and theoretically playable on-chain. Conflict resolutions have also been implemented, so that players can play safely, secured by the smart contract logic.
- The frontend includes a token faucet for the testnet and allows players to create and join rooms. Connection between players uses Starknet to verify the other player's identity, and then continues to work off-chain by having the players send each other signed messages with burner addresses (public keys are stored on the contract game room).
- The game somewhat ok on the browser, and the state can be verified on-chain.
What is missing:
- I couldn't get to where I wanted, so the frontend is somewhat limited. There's no interface yet to finish the game or to have conflict resolution. Anyways, all of this is implemented on the Cairo1 contracts and I will continue working to finish the frontend.
The repo: https://github.com/grillolepic/pragma_cairo1_hackathon
Deployment to: https://starkpongfrontend.vercel.app