Trustless zkMafia

$1,425.57 crowdfunded from 264 people

$3,374.25 received from matching pools

67%
average score over 1 application evaluations
Developing a trustless, onchain Mafia game with zero-knowledge proofs, providing open-source ZK primitives for Ethereum gaming and potential for client-side proof generation and ZK-enabled machine learning NPCs.

Grant Proposal: Trustless zkMafia

Introduction

We (Baz & Goblin Oats) at Accessor Labs are thrilled to submit our grant proposal to develop a trustless version of the game Mafia (a.k.a. "Werewolf"). By pushing the limits of what's possible onchain, this novel application will showcase the potential of zero knowledge proofs, and furthermore, will include the creation of several ambitious open-source ZK primitives that will be of use to other developers in the Ethereum ecosystem, both within and beyond gaming.

Without getting too buzzwordy, the fullest extension of this project will include:

  • A fun, open-source game to onboard people into the Ethereum ecosystem.
  • An open-source library to implement a general-purpose hidden information mechanic into games. This could potentially be applied to other contexts, such as the urgent matter of privacy in decentralised finance.
  • [Potential extension] A demonstration of the power of client-side proof generation, using GPU hardware acceleration, so that players can generate proofs locally and quickly instead of relying on centralised proof generators.
  • [Potential extension] An open-source library to implement client-side proof generation, for wider application both within and beyond gaming.
  • [Potential extension] A demonstration of the power of ZK-enabled machine learning, in the context of intelligent in-game NPCs, against which players can trustlessly compete.
  • [Potential extension] An open-source library to implement ZK-ML into your own games, especially to enable the creation of NPCs.

Project Overview

We plan to build a proof of concept game of Mafia with the following features.

The game itself will consist of several players all guessing who the killer is. They deliberate and vote together, and one-by-one, players are eliminated until either the killer wins or is eliminated. Using ZK, players can verify whether or not their vote correctly identified the killer, without revealing anything else (such as the killer's identity if they voted incorrectly). No central omnipotent third party is required.

Hidden information mechanics (such as these) are a core part of game design - from ancient poker to modern RPGs. However, hidden information is - by its very nature - hard to generate and interact with, in the context of a public, immutable, transparent ledger. Recent work by Geometry in conjunction with MatchboxDAO showcases how cryptographic innovation makes hidden information game mechanics possible, and we'd like to implement their research.

As a team we have prior traction and experience building out this system. We wanted to build this at the latest ZK Hack in Lisbon, but realised that the task was way too big for one hackathon. Instead, Goblin Oats, together with the team at Geometry, built a necessary component of the game's infrastructure to work on the Polygon Miden ZKVM, namely, ElGamal encryption, for which we were fortunate to be prizewinners.

The team also has professional experience building out privacy tooling in the context of gaming, at Epic Games, for some of the biggest games in the world, including Fortnite, Fall Guys, Rocket League, Pokémon Go and Among Us.

By also building an open-source library for generating a structurally similar hidden information mechanic in any game, this will create value to onchain game developers of all stripes. Furthermore, this will act as critical research into the relatively under-funded benefit of ZK compared to scaling - namely, privacy, which will have wider application to the future of decentralised finance.

Extension to hardware acceleration for proof generation

To achieve maximal trustlessness and remove the dependence on a centralised prover, we would ideally like to generate proofs locally, client-side. In today's world this is impossible given the enormous computational cost of proof generation, but in conjunction with the GPU hardware acceleration work being done by our friends at Ingonyama, we believe we can implement a proof-of-concept for client-side proof generation. This would represent a step forward for the industry and open up an incredibly exciting design space for fully decentralised, locally-generated proofs.

Potentially this could be extended into a general purpose open-source library for dynamic client-side proof generation in the context of trustless hidden information video games.

Extension to ZKML

The hot topic on everyone's lips! ZKML is very exciting because the possibility of verifying model execution has enormous benefits for verifying that a given model was run correctly, without revealing the sensitive private inputs to that model, or the proprietary internal tuning of the model itself.

Furthermore, bringing intelligent non-player agents into onchain games is important for enriching onchain games with NPCs that can have hidden internal psychology and biology, but can still behave verifiably and trustlessly. Trustless NPC infrastructure is a key component of Ethereum's future gaming ecosystem.

Ideally we'd like to create a version of Mafia where players can play using a live video stream, against an NPC detective who can guess who is lying and who is telling the truth, based on facial pattern recognition. Not only would this add an extra layer of fun gameplay, it would also act as critical research into an emerging, exciting technology.

Potentially this could be extended into a general purpose open-source library for ZKML in the context of NPC creation for onchain video games.

Final word

Thank you for getting this far! We are beyond excited about the potential of this project and would be grateful for your support in bringing it to life. Send us a message on Twitter / our Discord, we love to chat!

All best,

Baz and Goblin Oats,

Accessor Labs

Trustless zkMafia History

  • accepted into ZK Tech Round 1 year ago. 264 people contributed $1,426 to the project, and $3,374 of match funding was provided.

People donating to Trustless zkMafia, also donated to

Atom is revamping scientific research funding with a blockchain-based platform for transparent, efficient, and community-supported grants allocation.
Interactive novel-style adventure game guiding players through blockchain basics with practical tasks like wallet installation and exploration of Web3 applications.
App for learning Web3 interactively, facilitating wallet creation for over 1600 users, launched in March 2023 without using technical jargon.
Launched in March 2023, Revolte is an app making Web3 learning easy and fun, helping over 1600 new users create their first wallets.
Developing a climate-positive mobile school/home bus and Web3 Neighborhood Governance program for peer-governed, regenerative smart cities, including eco-technology research and implementations.