NewIntroducing Cartesi’s Technical Evolution Plan. Click to explore.
Grokking Cartesi Nodes

Grokking Cartesi Nodes

Tech/Dec 1, 2023/EDUARDO TIÓ
Share:

If you’re generally familiar with blockchain technology, you know that nodes are a fundamental part of any network. Cartesi is no different. However, in the Cartesi Rollups architecture, nodes have a special role as decentralized middleware that supports the work done by the Cartesi Virtual Machine (CVM) that runs on top of them.

Let’s dive into Cartesi Nodes — not to be confused with Noether for CTSI staking — and look into what they do, how they work, and setting one up.

What are Cartesi Nodes?

The Cartesi whitepaper defines Cartesi Nodes as follows:

“The Cartesi Node is the software and hardware infrastructure that hosts the off-chain components of Cartesi dApps. Each user that wishes to interact with a Cartesi dApp must have a Cartesi Node at their disposal.”


(*Note: The exact context for these Nodes is that of a tool known as Cartesi Compute, but the same also applies to Nodes for Cartesi Rollups)

In other words, Cartesi Nodes are the network of individual computers that run the CVM and host Cartesi dApps. They’re very similar to nodes on other blockchains, but different in the sense that they operate within the context of a rollup solution like Cartesi Rollups. This is where we start to see the nuance around them.

A step-by-step look at what Cartesi Rollups do will help us break this down. When supporting dApps that run on the CVM, Cartesi Rollups need to:

  1. Read information from a main chain like Ethereum.
  2. Send that information to an off-chain machine, the CVM, where it is processed.
  3. Publish the results back to the main chain.

In order to do this, they need nodes that can interact with both on-chain smart contracts and an off-chain virtual machine. Cartesi Nodes are precisely that “middleman” that’s responsible for communicating between the two — albeit, in a secure and decentralized way.

Types of Cartesi Nodes

The responsibilities of Cartesi Nodes have to be two-fold in order to play this “middleman” role in Cartesi Rollups. They have to read information and verify information. Therefore, Cartesi Nodes can either be:

  • User or Reader Nodes (read-only): These only take care of retrieving information from the main chain and making it publicly available so that it’s usable to the CVM — they don’t publish information back to the main chain. Reader Nodes could be run by regular users.
  • Validator Nodes (read and write): These take care of verifying new information and publishing it to the main chain, just like regular nodes in L1 networks. In this case, they’re in charge of verifying the changes made to on-chain information while it was off-chain in the CVM. Validator Nodes are also in charge of guarding the network against dishonest parties in the event of a dispute over on-chain information. These added responsibilities require Validator Nodes to run in secure environments and remain inaccessible to users.

Right now, Cartesi Nodes usually operate as Validator Nodes that can fulfill both roles. Reader Nodes are currently under development by the Cartesi team.

How do Cartesi Nodes work?

Looking at some key concepts behind Cartesi Nodes’ operations will give us a high-level understanding of how they take care of their responsibilities. It will also familiarize us with the kind of terms that will show up when running a dApp on the CVM that makes use of Cartesi Nodes.

We can examine these as the inputs that Cartesi Nodes get from the main chain and forwards to the CVM or the outputs that it puts back to the main chain as “claims.”

INPUTS

Portals: Interactions with Cartesi Nodes would typically start with Portals. These are a way to communicate on-chain information to the CVM off-chain. Nodes use Portals to move assets from the main chain and into the dApp they’re running. Once there, these assets can be transferred and moved around using the typical software logic found in a Linux OS.

(Note: There are also app-specific inputs that come directly from users and don’t go through a portal. These inputs have no assets associated with them.)

OUTPUTS

Epochs: After the CVM processes the information that comes from the blockchain, Cartesi Validator Nodes batch these operations and publish them back to the main chain. Then these changes are reported to the main chain in the form of vouchers or notices. The cadence of these batches is what’s called an Epoch.

  • Vouchers: We can think of Vouchers as tickets that contain information about what kind of transactions should happen on the main chain after the results from the CVM are reported back. They contain instructions that can range from payments to a DeFi protocol to a request for a fund withdrawal.
  • Notices: Similar to Vouchers, Notices also contain information that is relayed to the main chain. The difference between Vouchers and Notices is they’re purely for informational purposes — they don’t make changes in the main chain. That means that notices don’t start transactions such as fund deposits or withdrawals.

*MISC

Reports: Then we have a different kind of operation that Cartesi Nodes take care of. Reports are generally used as logs or diagnostics for dApps that are running on the CVM. They’re commonly used to keep track of application errors and other information, but they do not have any on-chain effects.

Cartesi Nodes in action

Cartesi Nodes are already running many dApps in the Cartesi ecosystem. Each one of these makes use of Cartesi Nodes in the way explained above. You can explore how this mechanism for relaying information off-chain and back on chain has helped use cases in gaming, DeFi, and AI via Cartesi Rollups and the CVM.

In fact, if you have a dApp idea that makes use of Cartesi technology, it’s likely that you’d be setting up a Cartesi Node for yourself. The process for running one locally is very simple and outlined here.

Do you think you grokked Cartesi Nodes? Test your knowledge by taking the Grokking Cartesi Node quiz in the Cartesi questboard and earn community points.

Learn more about Cartesi in general by reading the docs. You can also stay in the loop with everything happening in the Cartesi ecosystem by joining the community.

Subscribe to The Cartesi Newsletter

Join our newsletter to stay up to date on features and releases

More from Tech

Tech/Jan 25, 2024

Grokking Cartesi Public Goods: Dave

A look into a public good developed by Cartesi that solves common issues in fraud-proof protocols that validate L2 claims on a main L1 chain.

Written By EDUARDO TIÓ

Tech/Jan 11, 2024

Grokking the Cartesi Explorer

An overview of Cartesi’s block explorers, CartesiScan and Cartesi Explorer, including their features and their specific roles in the wider ecosystem.

Written By EDUARDO TIÓ

Tech/Dec 1, 2023

Grokking Cartesi Nodes

Diving into Cartesi Nodes as a fundamental part of the Cartesi ecosystem, looking into why and how they support Cartesi Rollups and the CVM.

Written By EDUARDO TIÓ

© 2024 The Cartesi Foundation. All rights reserved.