FRAMED: A fully onchain & trustless hidden information game (Mafia) built with fhEVM
Blockchains are open and transparent which allows for decentralized finance and a trustless economic world. However due to this, it is tough to build fun experiences onchain. Recent developments in FHE allow for novel onchain game experiences, allowing you to play games with hidden information completely trustlessly!
We built a game called FRAMED!, (similar to Mafia), where an art thief stole a painting from a museum! Players are randomly assigned roles as either a citizen, thief, cop or detective stored as encrypted values onchain. The game's objective is for the thief to eliminate citizens while they work together to identify and vote out the hidden thief. There is an element of discussion and social deduction among the players and they must collaborate and deceive the other party.
What sets this game apart is its ability to store encrypted states directly on-chain. FHE enabled smart contract allows for computation to be run on encrypted data without the need for decryption. This innovation addresses privacy limitations and guarantees and allows for a new era of smart contract development.
The core game logic of FRAMED! Is implemented on the Inco Testnet as a fully homomorphic smart contract.
“Framed!” was meticulously crafted using advanced technologies including React for building the user interface, WAGMI for game mechanics, and the Inco Testnet for network testing. Privvy, a sponsor, was integrated for social login functionality, ensuring smooth user access. The game utilizes Fully Homomorphic Encryption to facilitate on-chain private actions and role assignments, enabling players to interact and make decisions, such as taking actions against other players, while maintaining privacy. This technology allows for encrypted computational operations directly on-chain without the necessity for decryption, setting a new standard for on-chain gaming experiences.