skip to content

Fuelmint: Sovereign FuelVM rollups on Celestia

/ 8 min read

Table of Contents
Fuelmint cover illustration

Preface

Modular Fellows is a program by Celestia to empower builders in the modular stack by providing guidance, engineering support, and a stipend over three months to build a project of their choice. As part of the program’s first cohort, I built “Fuelmint” as my project. This piece explains the components that go into Fuelmint and how they work together.

If you want more specific details on how it works or plan on building with Rollkit (execution environments, apps, etc.), do not hesitate to reach out.

Intro

So what exactly is “Fuelmint”? Named after the Fuel network and the pattern of using “mint” as a suffix (Tendermint, Ethermint, etc.), Fuelmint is an experiment on using the FuelVM as an execution environment for sovereign rollups on top of Celestia.

To understand what that all means, here is a short primer on the different components that make Fuelmint possible.

Celestia

Current blockchains are monoliths since they typically handle all the primary services we associate with a blockchain (execution, settlement, consensus, and data availability). In contrast, Celestia is a modular blockchain that focuses on a specific set of services (data availability and consensus) while letting other blockchains concentrate on the rest (execution and settlement).

Monolithic stack vs modular stack

Fuel

Since the creation of the EVM, other execution environments have risen to serve developers’ needs. The FuelVM is a new contender with many differentiating aspects, such as its easy parallelization thanks to its use of the UTXO model, its vast list of EIPs, a blockchain-optimized DSL based on Rust (Sway), and a seamless developer experience.

One of its main differentiators lies in the way it classifies itself. Fuel calls itself a modular execution layer, defined as “A verifiable computation system designed for the modular blockchain stack.” Meaning that Fuel can be deployed under different configurations across the modular stack.

Fuel configurations across the modular stack

Fuel configurations

Sovereign Rollups

Rollups are blockchains that post their blocks to another chain that provides consensus and ensures data availability. Since Celestia only focuses on consensus and data availability, it is a natural fit for rollups, as it allows rollups to choose how they handle execution and settlement.

Sovereign rollups are a type of rollup that does not rely on another blockchain for settlement but instead determines its canonical chain through the nodes in its p2p network. The latter means that a sovereign rollup is self-settling, thus having more freedom over the execution environment it runs, unlike traditional rollups (or governance rollups), which are usually constrained by their settlement and which types of execution environments they can run.

Fuelmint

Fuelmint is an experiment using the FuelVM as an execution environment for sovereign rollups on top of Celestia. That means Fuelmint uses the FuelVM for execution, Celestia for data availability and consensus, while taking care of settlement thanks to Rollkit. If you want the benefits of having a sovereign rollup (freedom to fork, dedicated blockspace, and more) while leveraging Fuel tooling to write smart contracts, you could deploy such a construct with Fuelmint.

Theoretical Fuelmint instances on top of Celestia

Rollkit + ABCI

To understand how Fuelmint works, we first need to talk about Rollkit, how it communicates with our FuelVM instance through ABCI, and how it helps build a sovereign rollup on top of Celestia.

Rollkit is a modular rollup framework that allows developers to deploy rollups throughout the modular stack. Rollkit provides an ABCI client implementation for rollups, meaning that it handles requests and forwards them to its local app instance through the Application Blockchain Interface (ABCI). As an interface, ABCI allows a replication engine (blockchain) to communicate with the state machine (the application) by providing a set of methods with defined requests and responses. In other words, ABCI allows a blockchain client and an application to communicate with one another, even if they are written in different languages.

Tendermint

Tendermint Core (now CometBFT) is the most well-known ABCI client implementation and the most adopted thanks to its use in the cosmos-sdk. It provides consensus and a set of RPC endpoints for transaction submission and querying, and it communicates with the application through ABCI.

Simple Cosmos chain overview

This is how most Cosmos chains work today, but there are no requirements to use the cosmos-sdk to benefit from ABCI. Some chains use a custom stack while still using Tendermint for consensus. It is also possible to swap out Tendermint for another blockchain client as long as it can make ABCI requests, as shown in a Paradigm post. However, although the software is modular, the resulting chains are not because every Cosmos chain has to take care of its own execution, settlement, data availability, and consensus.

Rollkit

Extended Rollkit chain overview

Instead of having blocks go through a consensus process like Tendermint, Rollkit uses a sequencer to order transactions, communicates with an application through ABCI, and provides Tendermint-like RPC endpoints. By publishing blocks to Celestia and running the ABCI application, Rollkit takes care of execution and settlement while leaving the job of consensus and data availability to Celestia.

How Fuelmint Works

Thanks to Rollkit and ABCI, using the FuelVM as an execution environment for a rollup sounds straightforward: create an ABCI wrapper for the FuelVM and hook that to Rollkit. There were a few challenges:

  • Most tooling for building ABCI applications is specific to the cosmos-sdk and thus uses Go, while the Fuel stack is written in Rust.
  • The only VM that has been ABCI-wrapped before is the EVM. Ethermint relies on the cosmos-sdk, and the only other example of an ABCI-wrapped EVM is in Paradigm’s N/B repo.
  • Out of all the live Cosmos chains, testnets, and projects, there are only two examples of an ABCI app written in Rust: the repo mentioned above and Penumbra.
  • Given the difference in languages between Rollkit (Go) and the FuelVM (Rust), the simplest way to have them interact through ABCI would be to use socket connections. Rollkit did not natively support communicating with an app using sockets at the time.

Fuelmint does not use the cosmos-sdk. Instead, it uses Penumbra’s tower-abci, an interface for ABCI built on Tower’s service abstraction, and a simple Go app that defines an ABCI relayer application that Rollkit runs.

With tower-abci handling the logic of receiving requests and sending responses, all that is left is defining the Fuelmint application and the ABCI methods to communicate with it. The application has multiple components; the main ones are a transaction pool service and a block producer, responsible for processing transactions from the transaction pool and executing them with the FuelVM to produce a block.

The other component of Fuelmint is the ABCI relayer, which allows Rollkit to communicate with the tower-abci server where the application logic lives. An instantiated Rollkit sequencing node will communicate with a given ABCI application, but Rollkit does not support socket connections to an application. The relayer wraps an ABCI socket client as an ABCI application, letting a node pass requests to it, which are then forwarded to the app (the tower-abci server) and returned through the relayer.

Now that we have a Rollkit sequencer and an application capable of processing FuelVM bytecode, we have a FuelVM sovereign rollup ourselves. We still need a vital component of any blockchain: an RPC service. Rollkit provides Tendermint RPC methods, which expect Tendermint-style requests. Without a Fuel RPC service, deploying a Sway smart contract would require serializing the deployment transaction and passing it to Rollkit through a Tendermint RPC method such as broadcast_tx_commit.

Thankfully this was taken into consideration. Similar to Fuel, Fuelmint runs a modified Fuel GraphQL client; the only difference is that the Fuelmint client sends transactions to Rollkit for sequencing. With this modified Fuel RPC service, it is possible to use Fuel tools such as forc to compile and deploy Sway smart contracts straight out of the box.

Fuelmint RPC flow

Conclusion

During Celestia’s Modular Fellows program, I ran a sovereign rollup that uses the FuelVM as an execution environment by leveraging Rollkit, ABCI, and Fuel’s core library.

Writing an ABCI wrapper for a new execution environment sounded daunting. While it was not simple either, it was simpler than I imagined, but the problem is that there are few examples out there. I hope that by writing this article and sharing the code for Fuelmint, I can inspire more people to build modular.

As for Fuelmint, it is important to note that it is not production-level code and is all experimental.


Acknowledgement

Special thanks to NashQueue for pushing me to work on Fuelmint as my Modular Fellows project, to Josh Bowen for guidance on building execution environments, to Ismail Khoffi and Zaki Manian for helping me understand ABCI, to Cami Ramos, Brandon Kite, and John Adler for their help with everything Fuel related, to Tomasz Zdybal for helping out with Rollkit, and to Josh Stein, Nick White, and Yaz Khoury for their support.