What Is MagicBlock? Understanding the Solana Onchain Game Engine
Onchain game engines make it easier to build games with no external dependencies beyond their underlying blockchain.
To me, this is one of the most exciting areas of development in crypto today, and that’s why my curiosity was piqued when I recently came across MagicBlock Engine.
MagicBlock is a game engine that’s innovated an Ephemeral Rollups architecture for powering flexible and performant onchain games on Solana.
I think MagicBlock is an interesting taste of what’s to come in the Solana gaming scene, so let’s catch you up on all the basics.
What Is MagicBlock?
MagicBlock is a gaming framework built on top of Solana, designed to facilitate the development of fully onchain games and apps.
Recently, MagicBlock Engine showcased its capabilities at an a16zcrypto Demo Day event.
The demo featured a real-time, fully onchain game deployed entirely on Solana, and two clients played the game simultaneously with no lag thanks to the MagicBlock’s ability to delegate accounts into fast Solana validators.
What Are Ephemeral Rollups?
MagicBlock extends Solana's capabilities by introducing Ephemeral Rollups (ERs), which are designed to efficiently facilitate state transitions without fragmenting a game’s state.
An ER operates as a specialized Solana Virtual Machine (SVM)-based runtime, which can be customized to support features like gasless transactions, transaction scheduling, and quicker block times.
The process here begins with developers delegating specific accounts from existing Solana smart contracts into the MagicBlock Engine. This delegation temporarily transfers the state to an auxiliary layer, i.e. an ER, which can process transactions at a higher throughput.
During this phase, the delegated accounts are locked, but remain readable on Solana. This means other transactions, such as token minting, can access the locked state and interact with it in real-time.
Crucially, even though game state is temporarily moved to an ER, the assets being interacted with like tokens and NFTs remain on the base layer of Solana. This design ensures that all the underlying programs and assets continue to reside directly on the mainnet, preserving their composability with the broader Solana app ecosystem.
Lastly, state transitions handled by an ER are committed by a validator and subsequently verified and settled on the mainnet. Once the ER concludes, control of the delegated accounts reverts to the original program without any state fragmentation.
MagicBlock’s Other Main Features
- ⚡️ BOLT — A framework that uses the Entity Component System (ECS) pattern to streamline the development of onchain games. It allows developers to quickly create modular, reusable, and extendable game components and logic.
- 🪪 SOAR — SOAR stands for Solana Onchain Achievement & Ranking. This reputation system lets developers readily define achievements based on onchain activities, track and display user rankings, and deploy rewards.
- 🔑 Session keys — MagicBlock recently helped add support for session keys in the Solana Unity SDK, making it easier for its game devs to eliminate the need for repeated wallet popups during frequent in-game interactions in a secure fashion.
Why MagicBlock?
The Ethereum gaming scene has various promising onchain gaming engines, e.g. MUD by Lattice, Keystone by Curio, and Dojo by Cartridge.
However, one common design pattern in this early scene is deploying games on their own distinct rollups, which can pose various composability and fragmentation challenges that are still being tackled.
MagicBlock’s angle is to bypass these fragmentation issues by keeping assets on mainnet Solana, thus maintaining the possibility for atomic composability, while still achieving scalability with ERs. This way you get high throughput, customizable runtimes, and the ability for games and apps to seamlessly interact without needing interoperability solutions.
What to Watch Going Forward?
- MagicBlock is new and still rearing up. Which onchain game will be the first to officially use this engine?
- The recent MagicBlock demo achieved 50ms latency, which is competitive with modern gaming standards. Can we expect further optimizations that bring this latency even lower for even better real-time gameplay?
- Earlier this year, Parallel announced its AI game Colony would be based on Solana. Could the Parallel team adopt MagicBlock Engine to meet its infrastructure needs here?
- With MagicBlock maintaining assets on the Solana mainnet, developers have the potential for atomic composability. What use cases will emerge from this capability?
- Onchain games benefit greatly from user-generated content (UGC) and user-generated logic (UGL). Will the SOAR system be used to incentivize these sorts of creations?
- MagicBlock doesn’t have to be used just for building games. What non-game apps might adopt this framework going forward?
The Bottom Line
While MagicBlock is still in its early stages, its potential to catalyze Solana’s fully onchain gaming scene seems considerable, as its Ephemeral Rollups architecture can help it bypass key challenges faced by other gaming engines while still ensuring high performance. Looking ahead, be sure to stay updated on the team’s progress by following them on Twitter—they’re ones to watch in my opinion!