We created a Tezos-compatible L2 chain using Smart Rollups.
One can interact with it as with any other Tezos public network.
Visit https://teztnets.better-call.dev/rollupnet (opens new window) to give it a try!
# Smart Rollups
A few weeks ago, a significant event occurred in the Tezos ecosystem: the latest Mumbai upgrade enabled the creation of optimistic rollups that settle on the Tezos blockchain. While there are numerous comprehensive articles detailing smart rollups, I would like to highlight two groundbreaking and innovative aspects that set Tezos apart in an already competitive space:
- Tezos core developers played their trump card with regular and well-established protocol updates to implement settlement and fraud proof mechanics at the protocol level, instead of relying on smart contracts.
- Tezos also aligns with the recent trend of modular blockchains by offering their Kernel SDK in Rust, which allows for the construction of smart rollups with custom execution logic.
As a result, we now have a highly cost-efficient and fine-tuned settlement layer on a considerably decentralized network, alongside an exceptional developer experience, particularly for Rust enthusiasts.
We couldn't stay away and got right into the action!
# What's this all about
Why do we need rollups in the first place? Many believe (me included) that the future of web3 lies in customizable infrastructure, hidden from users and deployed across thousands or even millions of application-specific chains. Numerous examples of dApps migrating to their own chains already exist, as this approach enables the best user experience.
Rollups represent the technological breakthrough that will hopefully bring this approach to the mainstream. The concept of application-specific chains has been around for years, starting with platforms like Cosmos and Polkadot, and culminating with Polygon supernets and Avalanche subnets.
However, only rollups offer a relatively affordable (no need to gather/rent and pay a set of validators) and secure (inherited from L1) scaling solution that also provides a wide array of options, such as enshrined/sovereign setups, centralized/decentralized sequencers, and optimistic/validity execution. These trade-offs enable the selection of the optimal solution for a specific case, and this flexibility is, in my opinion, the key to success.
# Why Michelson rollup
So, we have the tool — a framework for building rollups — but what should we do first? Should we target EVM, like other L2 scaling solutions, CosmWasm, Solana Sealevel, or even create something custom using a newly invented DSL?
When deciding to build something new, I personally like to follow this rule of thumb:
- I should be well-versed in the tools being used
- Or have a solid understanding of the domain area
In this particular case, Rust was a new language for me (despite my previous C/C++ experience), but nearly five years in Tezos provided me with a comprehensive understanding of the protocol. Thus, the choice was clear!
Initially conceived as an enjoyable and educational project, it has since grown into something more substantial. We now have several intriguing use cases that could potentially lead to real pilots and, hopefully, production deployments. However, it is still early days.
# What's inside
How does an L2 solution work in practice? We can generally identify four main components:
- A standard L1 node used for broadcasting operations and querying L1 state (public networks can also be utilized for this purpose).
- The rollup node itself, which is responsible for executing L2 operations and publishing state commitments.
- The kernel that encapsulates the L2 protocol logic, distributed as a wasm binary that is loaded and executed by the rollup node.
- The facade node, which provides a compatible interface (in our case, the Tezos RPC API) for reading L2 chain data and injecting L2 operations.
The typical lifecycle of an L2 operation can be outlined as follows:
- The user submits an operation through their wallet, which calls the injection endpoint of the facade node.
- The facade node converts the operation payload into an inbox message and forwards it to the rollup node.
- The rollup node constructs a special operation type that populates the inbox, signs it, and broadcasts it to the L1 network using the L1 node.
- The inbox message is included in an L1 block.
- The rollup node retrieves the inbox contents for the next level and executes the kernel.
- The kernel processes the inbox message, updates the state, and generates an operation receipt.
- The user opens the operation page in the explorer, triggering an RPC request to the facade node.
- The facade node accesses the rollup node's state and transforms the data accordingly.
Another aspect that is not immediately obvious is the rollup origination process. Due to operation size limitations, a typical workflow involves initially deploying a lightweight "installer" kernel that functions as a bootloader. Once executed by the node, the installer kernel attempts to fetch the actual "payload" kernel page by page, utilizing a specialized "reveal" mechanism.
All the code is located in the following repo baking-bad/tezos-on-tezos (opens new window) and includes several crates:
- The kernel itself and its installer
- The Tezos protocol and Michelson VM implementation
- Facade node
Your bug reports and feature requests are very welcome, please feel free to raise an issue!
# What's next
The ultimate goal of this project is to create an application-specific chain equipped with Michelson contracts, allowing both existing Tezos app developers and newcomers interested in Tezos technology to access the most customizable solution.
Here are just a few potential features:
- Lower operational costs for running oracles and contract automation
- Custom MEV-resistant techniques for TradeFi
- Chain-native tokenomics
- Feeless experience for seamless onboarding
- Contract wallets as first-class citizens (account abstraction)
- Permissioned chains (e.g., KYC enabled)
Smart rollups are the ideal solution when smart contracts are insufficient to express your idea or ensure a smooth user experience. We eagerly anticipate mass adoption and the continued development of data availability and zero-knowledge solutions, which should make rollups even more superior!
Special thanks to:
- Nomadic Labs (opens new window), Trilitech (opens new window), and Functori (opens new window) – for their assistance and numerous fruitful discussions
- Airgap (opens new window) team – for the Tezos SDK in Rust, which made the overall development process a breeze
- Tezos Foundation (opens new window) – for supporting this project