Paima engine template

This topic is to discuss the proposal submitted by @SebastienGllmt
Please see below for the details of the proposal and discussion.

13 July, 2024
Current status: Under Consideration.
Opened for community discussion on : 13th July 2024

1 Like

Title

Onchain game leveraging Mina Protocol

Project Background

Paima Studios is a game studio building onchain games, and we are building our next commercial game leveraging Mina Protocol. However, multiple public-good infrastructure pieces are missing to enable this.

Notably,

  • It’s it’s hard to build a commercial product using Mina if you can’t tap into the EVM userbase
  • Core infrastructure and cryptographic primitives to build games that leverage Mina are missing

To solve this,

  • We will release MIT open-source primitives for Mina to solve the challenges missing above
  • We will release MIT open-source templates using these primitives so other companies have a starting point for building their own experience
  • We will release a commercial game leveraging the primitives (and idle game game where VDFs prove you have idled). Early preview of the Twitter (announced at the time of writing this proposal) here: x.com

Proposal Overview

  • Problem: there are missing pieces to build a successful commercial product in Mina
  • Solution: Create public-good infrastructure for Mina, templatize them for ease-of-use, and release a commercial game to prove their viability in business and bring adoption to Mina
  • Impact: this work will
  1. lower the development cost of using Mina by having more primitives and templates to leverage
  2. increase adoption of Mina by improving access to EVM users and creating a commercial game

Architecture & Design

Architecture

For the VDF specifically, there are 2 common algorithms for implementing VDF:

  • Wesolowski: complex, but faster
  • Piertzak: slower, but simpler (and recursive)

We will write a VDF verifier and not a prover in o1js, given writing a prover is significantly more complex (in implementation and performance), and isn’t required as the user can generate a proof on their local machine, and all we need in o1js is a verification of this local computation.

Given Piertzak’s implementation uses recursion, we believe this will be the easiest to implement into Mina’s recursion system. Both implementations have a Rust implementation which will serve as the basis of our o1js implementation. Notably, the Piertzak implementation can be found here

Vision

Our plan is to leverage this template to build commercial games leveraging Mina protocol

Existing work

Production timeline

  • May: Mina template for basic Paima Engine integration, including
  1. The ability to synchronize Mina events and actions from a rollup node
  2. The ability to connect to and verify signatures of Mina wallets from our SDK
  • June: Mina template that uses ZkProgram for local proof generation (needed for the game to scale by having the user run a lot of the proof generation on their machine). This will support
  1. EVM wallet usage, including a writeup about how the EVM verification ZkProgram works and benchmark vs other approaches
  2. Connecting it to a batcher system so that games can subsidize tx fees to allow it to be usable from MetaMask
  • July: Mina template leveraging a Verifiable Delay Function (VDF) verifier to enable use-cases that depend on timers (very common in games)

Additionally,

  • The template will be live and updated with new features every month
  • We plan to leverage this in a future commercial game (release date TBD)

Budget & milestones

Deliverables

  • A Paima Engine template that is updated into 3 parts. One for basic Mina support, another for ZkProgram support, and another for VDF support.

Mid-poiont milestone

  • A template with Mina support anybody can run, with an implementation for the EVM ZkProgram milestone

Project timeline: 3 months

Budget: 30k MINA

Budget breakdown: 10000 MINA/month on

  • 1 senior developer for the core implementation of the template
  • 2 senior developer part-time for as-needed support (Paima Engine feature requests, o1js support)
  • 1 project manager to review code and ensure milestones are properly met

Wallet Address: B62qmsMCXDA9bbubwrZDnwUabeXV9MoaWLXyVaAP78Cr7mQxBCNimvs

Team Info

Proposer Github: SebastienGllmt (Sebastien Guillemot) · GitHub

Proposer experience

  • Co-founded Zeko (zk rollup for Mina)
  • Co-founded Paima Studios which has built multiple games live to mainnet including our game Tarochi with 100+ ETH in volume

Team members

Achievements

  • Build Tarochi, a decentralized RPG game deployed to Arbitrum+Cardano which has 100+ ETH in lifetime volume
  • Built Paima Engine, one of the largest sovereign rollups in crypto
  • Build a lot of core infrastructure for Cardano including its most popular Rust SDK

Risks & Mitigations

  • The main risk we forsee is that even with ZkProgram usage, performance may still be too slow to build a game. We have many options to speed it up including leveraging Zeko which has faster block times and can be used to create L3 with less restrictions than the Mina L1 (ex: more account updates), so we think we can surpass these risks
  • VDF is a complex primitive and it is sometimes hard to predict subtleties in the implemenetation. We have made this the last milestone to take into account that future work may be required on it
2 Likes

Intersting proposal and really great article Paima ZK Layer Architecture | Paima Blog.

Curious to learn what are your thoughts regarding Smart Contract vs ZkProgram.