About Cartesi Werewolf
Our implementation is a simple proof-of-concept of the integration of werewolf game and Cartesi Rollups infrastructure. The simplified game flows as follows: 0. Since some rounds of communications need to be encrypted, players need to first generate their RSA key pairs, and send the public keys on-chain.
- Once enough players join the game (have their pk sent on-chain), the back-end randomly decide who to be the moderator and publicly announce it.
- Each player keeps inspecting the backend to find out whether itself is the moderator or not. If yes, then the moderator will randomly decide who to be werewolf and villagers, encrypt each role with the corresponding role player’s public key and send them on-chain. So each player will only know its own role by decrypting using its private key.
- Game begins by moderator announcing the “night falls”. Werewolf decides who it would kill. Werewolf and villagers all need to send out (encrypted) messages so werewolf doesn’t get caught by being the only one sent out a message.
- Moderator announces “day breaks” and who was killed. Villagers (and werewolf) who are still alive vote for the most likely werewolf player and send publicly on-chain.
- Moderator inspects the backend until all votes received by the backend. If the voting finishes the game, moderator sends publicly on-chain that the game finishes. Otherwise, another villager was voted out and the game continues with step 3. After the game finishes, the moderator reveals all players’ secret keys so all game steps are reproducible and verifiable.
Describe what could be next for your project?
The current implementation simplifies a lot of the game rules. So the next step could be to enrich game rules for more fun. The front-end could improve a lot to make the game flow more smooth. Need to work on the incentives for people to play this decentralized game rather than the more mature centralized version.