ποΈ Overview
Descartes SDK is the simplest infrastructure that DApps can use to run computations that would be impossible or too expensive to execute on-chain, either due to their complexity or to the amount of data to be processed.
ποΈ How it works
Descartes SDK allows Cartesi DApps to specify and request verifiable computations to Cartesi Machines. Additionally, the SDK provides tools to facilitate and reduce the cost of inputing data into Cartesi Machines.
ποΈ Architecture
What follows is a summary of the architecture and the components that are involved in running a Descartes Application, meaning some DApp that makes use of our SDK. It is convenient to start with the description of the typical ingredients involved in a decentralized application. Namely, the blockchain node and the client software.
ποΈ Wallets
Cartesi is a second layer solution.
ποΈ Execution timeline
At this point, an overview has been given of what constitutes a Cartesi computation, who are the parties involved, and what the software components of Descartes are. It is important to understand better what events happen during the execution of a Cartesi Machine.
ποΈ Machines off-chain
Although an extensive documentation of Cartesi Machines can be found here, one may choose to skip this reading and jump right away to their usage inside the blockchain through Descartes. For that, it is enough to regard a Cartesi Machine as a black box that executes computations.
ποΈ Machines on-chain
Having discussed the concept of Cartesi Machines off-chain, capable of booting a Linux operating system and loading heavy-weight libraries, one naturally wonders how this will ever be stored or executed on the limited environment of a blockchain. The simple answer is that it wonβt be.
ποΈ On-chain API
Having informally discussed how Descartes represents Cartesi Machines on-chain, one can now describe in more details the API for requesting and retrieving computations in Descartes.
ποΈ Instantiate
This section describes the main ingredient of the on-chain Descartes infrastructure.
ποΈ Drives
This section describes in detail the Drive[] _inputDrives parameter of the instantiate call.
ποΈ Provider drives
After going through the last section, the reader is already able to specify drives if the data was available to the caller at the time of instantiation.
ποΈ Logger drives
A relevant limitation of the Cartesi Machines as they have been described until now is the size of their input drives.
ποΈ Topologies
When users interact with their blockchain DApps, they are free to manage and run their own blockchain nodes if so they wish. In a common scenario of the usage of the Ethereum network, DApps are accessed via browser and blockchain transaction requests are carried out by Metamask. The user signs the transaction which is typically sent to a remotely hosted node, such as Infura.
ποΈ Supported networks
Broadly speaking, the Cartesi layer-2 platform architecture should be perceived as blockchain-agnostic, given that in principle any network could use Cartesi Machines to move complex computations off-chain without compromising on decentralization.