We found that most of the blockchain game projects in this space are using traditional web2 technology for hosting gameplay. So, we decided to create a game that utilizes web3 technologies as much as possible for our project and create services like real-time chat, game rooms, player profiles that can be used by other games. These services are very common among modern online multiplayer games and we need a reliable and scalable alternative that uses a web3 tech stack. So, we have decided to create a game that incorporates all these features.
We have built a blockchain incentivized online multiplayer mafia party Game.
One of the first challenges we ran into was due to the nature of the game. We can't use blockchain to make gameplay fully decentralized because in mafia roles of the player should be secret. Also, we want to make the role distribution verifiable at the end of the game so the normal centralized way of shuffling the role didn't sound good. That's why we decided to use chainlink VRF to get a random number and use the number we get from signing the random number we got from the VRF and use it as a seed for shuffling roles. So, In the end, we can disclose the signature and players can verify that. We also want to make the role distribution process verifiable. So, we come up with the idea of encrypting a secret AES key with a public key of the player and broadcasting it over all the players. We will then encrypt the role with that AES key and broadcast it. So, the player who is recipient can get the role immediately and at the end of the game player can disclose the AES key and everyone can verify the role.
Technologies used
Discussion