Inspiration
The idea for StarkDice came from something simple: nostalgia. I’ve always loved Ludo. It’s one of those games that never gets old, no matter who you play with. However, I also noticed that in most digital versions, you can’t be sure if the dice rolls are fair.
That made me think: what if I could rebuild Ludo to make it transparent and trustless? What if every dice roll could be verified on-chain, so no one, not even the game creator, could cheat?
That curiosity led me to create StarkDice, a multiplayer Ludo game built entirely on Starknet. It’s not just a game for fun; it’s an experiment in how blockchain can improve fairness in online play.
What it does
StarkDice brings the classic Ludo experience into the Web3 world. Players connect their Starknet wallets, join a game room, and play just like they would with a real board. However, every dice roll is on-chain, verifiable, and tamper-proof. Each move uses Cairo smart contracts, ensuring the randomness behind every roll is mathematically provable. The Torii indexer allows the frontend to update instantly as the on-chain state changes, keeping all players synced in real-time. It’s like seeing your favorite childhood game come alive again, but this time backed by cryptography.
How we built it
we built StarkDice using:
- Cairo + Dojo for the on-chain logic and entities.
- Torii to index and stream live game data.
- React + TypeScript for the frontend.
- BabylonJS to bring the dice rolls and movements to life with smooth animations.
The flow works like this:
- A player clicks “Roll Dice.”
- The app calls a Cairo contract that generates a deterministic random number:
[ r = H(s \, || \, t), \quad \text{where } s \text{ is the player’s seed and } t \text{ is the transaction hash.} ]
- The result is indexed by Torii, which immediately updates the board state.
- The React frontend listens to these updates, and BabylonJS animates the piece’s movement.
Challenges we ran into
There were plenty.
- The biggest was state synchronization, keeping the UI and on-chain data perfectly in sync.
- Designing randomness that’s both fair and efficient in Cairo took a lot of testing. Integrating BabylonJS animations into React without breaking the render flow was another headache.
- And getting multiplayer turns to update smoothly across players was a real puzzle at first.
There were days we broke the game entirely, but each time, I learned something new about how real-time blockchain games should behave.
Accomplishments that we're proud of
we're proud that we turned this idea into a working prototype. Watching players roll a dice and knowing that the number was generated and verified on-chain felt magical. I’m personally proud of how much I learned about Dojo, Torii, and Starknet while building it. Combining all that with React was challenging, but we worked through every bug and sync issue until it functioned. More than anything, we're proud that StarkDice reflects both our love for games and our passion for blockchain innovation.
What we learned
- How Dojo and Torii work together to power on-chain games.
- How to bridge Cairo smart contracts with a frontend built in React.
- How deterministic randomness can be implemented fairly on-chain with cartridge .
- The importance of designing systems that are both transparent and fun.
What's next for StarkDice
Next, we want to:
- Add matchmaking and private rooms so friends can easily join.
- Introduce token-based rewards for winners.
- Improve the UI/UX and make the animations more dynamic.
- Deploy it to Starknet mainnet and open it up for everyone to play.
Built With
- cairo
- cartridge
- dojo
- react
- torii
- typescript

Log in or sign up for Devpost to join the conversation.