Discover more from VeradiVerdict
VeradiVerdict - Issue #269
Image Source: https://starkware.co/resource/dojo-on-starknet-game-on/
Dojo is a Cairo-based on-chain game engine for Starknet, aiming to use Cairo’s STARK-friendly language trait, to provide a best-in-class developer platform for high-quality blockchain games.
Dojo combines ECS game-dev with a blockchain dev stack, consisting of Torii (automatic indexer), Katana (gaming sequencer), and Sozo (development and deployment toolchain)
Dojo ecosystem applications span the range of open-economy RTS, MMO, TCG, and RPG games, especially where resources can be traded between players. Examples include Realms Eternum, Roll Your Own, Briq
Dojo creates blockchain-recorded, user-defined “autonomous worlds” that provide a new medium for creative expression, and Dojo and Starknet are well-positioned to become the industry-leading tech stack in this vertical
Dojo is a provable on-chain game engine for Starknet, providing developers with a toolkit to create high-quality games where all in-game assets, user actions, and transactions all take place on-chain on Starknet . Let’s explore Dojo’s use of the Cairo language, before discussing Dojo’s features and functionality. We will then examine some of the applications built using this novel on-chain gaming framework, and finally discuss some of Dojo’s implications for the evolution of on-chain gaming.
Dojo Features and Functionality
Dojo as a game engine contains a wide variety of subcomponents, including a Cairo-native ECS (Entity Component System), the Torii automatic indexer, the Katana gaming sequencer, and the Sozu development and deployment toolchain. Let’s walk through each of these in brief.
Entity Component System (ECS)
Using Pikachu to explain ECS. Source: Original Content.
ECS is a design pattern that is commonly used in game design that breaks down in-game interactions into “entities,” “components”, and “systems”.
Essentially, the entity represents an agent in a game, such as Pikachu. This agent has several components, which are essentially modular groupings of features. Some components might include position, movement, and attack. These components do not include any logic, only data. The logic is defined in the systems of the game, which the user interacts with. For example, the user might interact with the “User System,” which then reads data from the “Attack” component, then triggers an update in the “Movement System,” which then updates the movement and position components. Furthermore, different entities or classes of entities may share different groupings of these components. For example, an NPC (non-player character) might only have the movement and position components, but not an attack component.
Thus, ECS is an incredibly flexible, intuitive, yet powerful framework that game developers can use to specify how all these different agents interact with each other within the setting of a game. One of Dojo’s highlights is to implement this flexible and familiar framework into Cairo, so that game developers can quickly develop games in a familiar process .
Torii: Automatic Indexer
Having a Cairo-native ECS framework is great, but our task isn’t to develop just any ordinary game, but in particular blockchain games, in which all of the assets, state, and logic is stored on a public blockchain like Starknet. To do so, we need some way to interact with the public blockchain and monitor on-chain information: a blockchain indexer.
This is where Torii comes in, as a Dojo-specific Automatic indexer. Torii automatically indexes Dojo Worlds and provides a low latency, high performance GraphQL and GRPC interface for game clients, allowing them to render game state changes in real time. Using Torii allows the user to quickly index any events happening in the game worlds deployed on-chain built on Dojo. Using Dojo’s Torii therefore reduces the need for developers to write their own indexer for their specific game, which can introduce unnecessary overhead and errors .
Katana: Gaming Specific Sequencer
The next feature in the Dojo toolkit is the Katana gaming specific sequencer. Katana is designed around the unique requirements of on-chain games development and deployment. It is intended to operate as a centralized sequencer, optimized for low latency and high throughput, supporting both local development and production deployments. In production deployments, its architecture enables execution sharding and regional deployments that roll up into a canonical parent chain, allowing games to horizontally scale to large user bases.
Sozo: Development and Deployment Toolchain
Lastly, Sozo is a set of scaffolding code that allows developers to easily build, develop, test, and deploy their scripts. Sozo has a list of project commands, such as init, build, test, migrate that allow developers to save time developing the boilerplate code, especially on the deployment side . With a simple sozo migrate command, the user is able to quickly deploy their game world on-chain, and the Sozo libraries will reconcile the state differences between the existing on-chain data and the newly deployed code .
Dojo Ecosystem Applications
From the above, we can see that Dojo provides a comprehensive development infrastructure that merges some of the common practices of traditional game development (such as the ECS model) as well as that of blockchain development (Torii, Katana, Sozo). Now we will discuss some applications within the Dojo ecosystem that run on Starknet, either using Dojo currently or planning to use Dojo for future versions  .
Loot Realms, built by BibliothecaDAO, is not just a single game. Rather, it is a loose collection of on-chain IP that is being used to successively create numerous collections of related games, with its own lore and history . Born from the text-based Loot NFT collection in 2021, today Loot has become the basis for a number of games. As a major source of IP that is fully on-chain, Loot-based games and culture may become a significant force within both the Dojo ecosystem as well as the broader on-chain gaming scene in the future.
One of the major games developed using the Loot Realms IP is Realms: Eternum, which is a MMO strategy game based on players’ Loot Realms NFT. Essentially a Realms NFT is a map of a geographic area that has traits such as cities, regions, harbors, and rivers and resources such as copper, stone, coal, and ruby . These traits of the NFT dictate how much resources a player can develop on their Realm, and all these resources can be traded on liquid markets. As players need to constantly make strategic decisions and balance resources, this provides a sense of player agency and allows for strategic depth in the game.
Another game based on the Loot IP is Loot Survivor, a text-based survival game inspired by the text-based origin of Loot . Essentially, players develop RPG-style strategies, compete with others to obtain loot, and progress in a real-time strategy manner.
Roll Your Own
Roll Your Own is a multiplayer strategy game released by Cartridge Gaming Company, one of the main developers behind Dojo . It was originally made in 2021 in Cairo Zero, but with the Starknet upgrade to Cairo, the smart contracts had to be rewritten, and Cartridge used Dojo to do so . In fact, Dojo was initially developed to specifically rebuild RYO, a process led by the Cartridge team.
In a recent playtest deployed on a Katana sequencer, RYO recorded over 70k+ transactions over 2500+ rounds played. This greatly demonstrates how the Dojo toolkit is able to enable and handle the large computational load typical of gaming applications .
Briq is a third interesting gaming project on Starknet, whose team is one of the developer teams maintaining the Dojo software. Essentially, Briq seeks to create an “on-chain lego” idea, allowing players to mint “briq” collections, and build their own creations, which can then be exported as NFTs. Existing “briq” structures can also be deconstructed back into their constituent bricks, which can then be used to build other structures .
Dojo’s Implications for On-Chain Gaming
From the architecture and applications of Dojo, we can see that there is a significant emphasis towards open game designs, where resources can be traded between players. This may in fact be a crucial aspect of how blockchains promise a new form of gaming experience – one where because resources are shared and registered upon a common public blockchain (such as Starknet), this enhances the multiplayer interactivity of given games.
Arguably, this blockchain-enabled enhanced multiplayer experience of gaming is the core promise of “autonomous worlds” . A “world” under this definition is a self-contained space with its own rules and distinct culture. Having a blockchain-recorded but user-defined “autonomous world” provides a new platform for creative expression, which may be an important long term value proposition for the evolution of blockchain gaming.
Within this grand picture, Dojo and the Starknet ecosystem is well-positioned to become the industry-leading tech stack that enables this development. Whether it be through Cairo’s language advantages over Solidity, Starknet’s sophisticated and performant STARK proving system, or Dojo’s comprehensive test suite and architecture, this seems to be an ecosystem that has the technological capabilities to unleash the full potential of on-chain gaming and “autonomous worlds,” and ultimately allow Cairo to become an easy-to-use, general-purpose, and widely-adopted programming language.
 On Dojo implementing ECS in Cairo: https://book.dojoengine.org/cairo/hello-dojo.html
 For more in depth explanations for game mechanics, refer to https://mirror.xyz/vanishk.eth/Q6vV8WY3mVKV6W9YuVOntw2muzPUIFXeeSHfD2T6rk8
 See for an updated list of Dojo-related games: https://www.notion.so/Dojo-Engine-Community-Hub-d316194b998941c48ddf771a4dd5ff08
- Paul Veradittakit
LETS MEET UP
Las Vegas, November 16-17
New York City, December 8
Walks and coffee meetings in San Francisco throughout the year!
Hi, I’m Paul Veradittakit, a Managing Partner at Pantera Capital, one of the oldest and largest institutional investors focused on investing in blockchain companies and cryptocurrencies. I’ve been in the industry since 2014, and the firm invests in equity, early stage token projects, and liquid cryptocurrencies on exchanges. I focus on early-stage investments and share my thoughts on what’s going on in the industry in this weekly newsletter.
Thanks for reading VeradiVerdict! Subscribe for free to receive new posts and support my work.