MinaFoundation / ecosystem-ideas

Get inspired to build on MinaProtocol.
MIT License
1 stars 0 forks source link

Unity/Godot Game engine SDK #16

Open hgedia opened 1 week ago

hgedia commented 1 week ago

Summary

Unity and Godot are two of the most popular game engines currently used. This proposal's deliverables would be SDK extensions to either of the game engines to allow integration with o1js. Extensions should permit zkApp transactions and account transfers.

There are two ways the extensions can interface.

  1. Native

This requires an extension to use the o1js library to do all computations locally (including signing/proving). Client-side transaction proving depends on the extension to support o1js. o1Js is a typescript library, and the engine needs to provide a way to call it via bindings/bridges (in case it is not supported). There are also considerations related to proving time, updating contracts, deploying new artifacts, etc.

  1. zkCloudWorker

Integration with zkCloudworker - should enable this with minimal friction —a rough schematic of the workflow.

image

  1. On-game event (mint collectibles, marketplace, achievements) - invoke an HTTP call to zkCloudWorker requesting a payload. Provide the public key mapped to the private key.
  2. zkCloudworker creates the payload for the user signing and sends back the response.
  3. The user signs this using the mina-signer package locally.
  4. Send signed payload to zkCloudWorker
  5. zkCloudWorker runs proving and creates transactions.
  6. zkCloudWroker publishes transactions to Mina L1.

Note:

Resources

vvro commented 17 hours ago

An example of integration of Web3 and Unity https://gaming.chainsafe.io/