Summary of "Re{solve} Hackathon Workshop: Building Provable Games with Dojo"
Summary of "Re{solve} Hackathon Workshop: Building Provable Games with Dojo"
Overview:
This workshop, led by Daniel Kronovc (Developer Relations Lead at Cartridge), provides a comprehensive introduction to building provable blockchain games using the Dojo Framework and Cartridge Toolchain on Starknet. It covers the entire development pipeline from coding smart contracts in Cairo to deploying and running games with blockchain infrastructure optimized for gaming.
Key Technological Concepts and Product Features:
- Dojo Framework:
- A software framework for building provable games and applications on Starknet using Cairo.
- Provides an end-to-end toolchain including contract development, testing, deployment, and integration with front-end clients.
- Introduces a "world" concept where the game state is managed as a collection of components and systems.
- Uses a database-like Object-Relational Mapper (ORM) model for managing contract state, simplifying state management compared to traditional Cairo contracts.
- Supports SDKs for connecting front-end clients (browser, Unity, mobile) to the blockchain backend.
- Cartridge Toolchain:
- Cartridge is the company behind Dojo, providing tools and infrastructure for Starknet game development.
- Includes Controller, a gaming-focused web wallet with advanced features such as session-based transaction policies to enable frictionless gameplay.
- Provides Slot, a cloud deployment infrastructure service for running Katana and Tori without self-hosting.
- Key Infrastructure Components:
- Katana: A high-performance Starknet sequencer optimized for gaming use cases.
- Written in Rust, uses gRPC for fast communication.
- Handles transaction ordering and block production.
- Tori: An indexer that processes blockchain state from Katana and creates a fast-queryable database.
- Also written in Rust with gRPC.
- Enables real-time UI updates by pushing state changes back to the client.
- These components together enable a real-time game loop: client sends transactions → Katana processes → Tori indexes → client UI updates.
- Katana: A high-performance Starknet sequencer optimized for gaming use cases.
- Development Workflow:
- Use the Dojo starter repo (
github.com/dojoine/dojo_intro) for a simple "spawn and move" game example. - Contracts (Cairo code) live in the
contractsdirectory; front-end client code lives in theclientdirectory. - Use Soo (a build tool built on top of ScarB) for compiling, inspecting, and migrating contracts.
- Run Katana sequencer and Tori indexer locally or via Cartridge’s Slot service.
- Front-end client connects via SDKs and Controller Wallet for gameplay interaction.
- The entire stack supports seamless deployment, development, and testing.
- Use the Dojo starter repo (
- Controller Wallet Features:
- Supports "sessions" with whitelisted policies to allow automatic transaction signing for predefined contract functions.
- Reduces friction in gameplay by minimizing transaction approval prompts.
- Integrates easily with Dojo games and supports wallet connection and user authentication.
- Examples and Advanced Use Cases:
- Demoed a simple game where a character spawns and moves on a map.
- Showcased Loot Survivor 2, a more complex roguelike dungeon crawler built with Dojo:
- Cartridge also provides an arcade platform to showcase Dojo-built games and build a community/audience.
- Integration and Extensibility:
- Dojo supports Unity SDK for building games with Unity front-ends while using the Dojo backend.
- The framework is not limited to games; it can be used for other high-performance blockchain applications.
- Encourages building composable, persistent game worlds that can interoperate and last indefinitely on-chain.
- Allows players and developers to create custom clients, modding game experiences.
Guides and Tutorials Provided:
- Step-by-step walkthrough of setting up the Dojo environment:
- Installing dependencies using ASDF.
- Compiling contracts with Soo.
- Running Katana sequencer and Tori indexer.
- Deploying contracts/world with Soo migrate.
- Running the front-end client with Controller Wallet integration.
- Link to the official Dojo documentation and tutorial repo for further self-study.
- Demonstration of the full game loop from user input to blockchain state update and UI refresh.
- Instructions on registering games on the Cartridge arcade platform.
- Explanation of how to use Controller Wallet sessions for smoother gameplay.
- Q&A addressing common questions about integration, wallet compatibility, and non-gaming applications.
Analysis and Key Takeaways:
- Dojo significantly simplifies blockchain game development by abstracting complex Cairo storage management into a database-like model
Category
Technology