C

Cryptomafias

Online Multiplayer Mafia party game built on Ethereum. Stake coins! Win the Game! Get the reward!

C

Cryptomafias

Online Multiplayer Mafia party game built on Ethereum. Stake coins! Win the Game! Get the reward!

The problem Cryptomafias solves

Inspiration

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.

What it does

We have built a blockchain incentivized online multiplayer mafia party Game.

  1. We maintain the game history of a player as an NFT.
  2. When you sign up, your profile is minted as an NFT and stored as a textile bucket with an IPNS link and you will also get some CMC(Crypto Mafia Coin) which is our in-game currency as a registration bonus.
  3. When you sign in, your profile will be retrieved from the IPFS and it will be used to generate your unique avatar from the hash of your token_id.
  4. There are 2 game modes: 1) casual game - which is just normal gameplay, 2) competitive game - In this, you will be staking your coin and can win/lose the coins.
  5. You can create a new room or join an existing room.
  6. In the Game we have Mafia, Doctor, Detective, and Villagers, the aim is for either Mafia to kill everyone else or for Villagers to find all Mafia and eject them from the game during the voting phase. The doctor can choose to save a player from being killed every night while the detective can inspect the role of a player during the night.
  7. You can chat in-game with fellow players and decide who to vote on!
  8. The winning party will get all staked coins and distribute them equally among themselves with a small fee deducted from the stack so that we can maintain game servers smoothly

Challenges we ran into

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.

Discussion