Cartesi Descartes SDK is the future of Linux Dapps, built to bring mainstream scalability to dapp developers. Hence, it forms a bridge between Linux open-source software and the blockchain technology while retaining the intrinsic security of the blockchain technology.
The Descartes SDK enables dapp developers to build computationally intensive dapps with Linux tools while preserving the full decentralization and security of the blockchain. Descartes SDK creates a simple and conducive environment for dapps to run large, complex, and expensive on-chain computations. SDK makes dapps run these computations completely off-chain without compromising the integrity and verifiability of the blockchain.
Normally, computations on blockchain smart contracts need to be run by all nodes or by a process called sharding. However, these create a restrictive environment for blockchains because of the block limit especially when every dapp competes for the blockchains’ native computation.
How it works
On Cartesi Descartes SDK, dapp participants can achieve consensus off-chain about the computation. But, if one party refuses to agree the blockchain can resolve the dispute. The blockchain sits as the presiding judge to resolve whatever dispute between the participants and this does not require full computation to resolve the dispute.
The Descartes SDK simplifies all the mechanisms, making it very easy for the developers to use. The developer doesn’t need to understand the nitty-gritty of how Cartesi works. The participants use simple API to run complex computations off-chain with guaranteed automatic dispute resolution. Also, Cartesi Descartes SDK reduces the cost of inputting data into the Cartesi machines. One major feature that makes Cartesi Descartes SDK essential for achieving consensus is the feature of being fully reproducible.
Think of a Cartesi Machine as a black box. A Virtual Machine with a set of input drives and a single output drive. When switched on, the machine boots a Linux operating system and passes the control to the software coded by the developer. This program is able to read the content of the input drives using traditional file operations available in any major programming language, process them, and write results to the output drive.
Here are but a few examples of computations that can be performed inside a Cartesi Machine:
Checking who won a match of chess or another complex game involving two players who wrote their moves into input drives;
Verifying that someone has successfully solved a puzzle, a major optimization problem or some artificial intelligence task;
Calculating the hash of a certain input using some costly algorithm, such as script;
Verifying a cryptographic signature using some algorithm not yet implemented on the blockchain;
Running a complex query on a large database contained inside the machine specification.
However, as the number of participants grows, some adjustments are needed.
The Cartesi team is currently implementing safe ways to allow for an absolute number of participants for the Descartes SDK. This is an important feature with a high priority on the development pipeline. Until then, the SDK is restricted to two participating nodes, who will assume the roles of the claimer and challenger.
The claimer is the Descartes Node in charge of posting the result of the computation to the blockchain. Although challengers are equally interested in the result, they do not post a claim to the blockchain. Instead, the challenger runs the same computation off-chain, verifying the result informed by the claimer. Challengers remain silent on-chain during the challenging period unless they disagree with the claimer’s result. In that case, they start a dispute resolution process.
DApp users are not required to know if their nodes are playing the role of a claimer or challenger. These roles are managed automatically by the Descartes Node logic as explained below.
The framework of Cartesi Descartes SDK
For an application that uses the Descartes SDK, one also needs the Descartes Infrastructure, which is composed of an on-chain and an off-chain component.
The on-chain component of Descartes is a set of smart contracts developed by Cartesi. For convenience, the DApp developer interacts with a single of these contracts, named Descartes.
The off-chain component of Descartes is called the Descartes Node, which plays a very similar role as the blockchain node. More precisely, in the same way, that a blockchain node allows clients to interact with the first layer, a Descartes Node allows clients to interact with Cartesi. It is expected that both users (claimer and challenger) have a Descartes Node working on their behalves.
Cartesi is a second layer solution. In particular, this means that it needs to send transactions on the main Ethereum chain in order to enforce particular results on the first layer. This is done through a wallet contained inside the Descartes Node. It is very important that this wallet be different from the user’s main wallet in order to protect their funds in case of a compromise in the machine where the Descartes Node is installed.
For more details: https://cartesi.io/docs
Cartesi’s Ecosystem Links: