https://cartesi.io/

in #great5 years ago

Cartesi is a layer-2 platform for the development and deployment of
scalable decentralized applications. Cartesi DApps are composed of
both blockchain and off-chain components. Off-chain components
run inside Cartesi Nodes that represent the interests of each DApp
user. Cartesi Nodes provide DApp developers with reproducible
Cartesi Machines, where large scale verifiable computations can
be run. These verifiable computations are easily integrated into
smart contracts by powerful primitives that provide strong conflict-
resolution guarantees. More precisely, any dispute arising over the
result of computations run inside Cartesi Machines can be fairly
adjudicated at negligible cost on the blockchain. Cartesi Nodes also
allow DApp developers to run native code. Native computations can
leverage the node’s full processing power, including any available
GPUs. Whether performed natively by the node or inside Cartesi
Machines, off-chain components run under a complete Linux oper-
ating system that provides the full ecosystem required by complex
computations. Cartesi enables DApp developers to use all the pro-
gramming languages, tools, libraries, software, and services they
are already familiar with. By moving most of the complex logic of
their DApps to portable off-chain components, developers are freed
from the limitations and idiosyncrasies imposed by blockchains. In
this way, Cartesi empowers developers to select the best run-time
environment in which to host each part of their DApps.
1 Introduction
Public blockchains are mechanisms through which networks can
maintain decentralized consensus over a shared state. Typically, this
state holds, among other data, a payment system. The stake held by
participants in the resulting economy works as their incentive for
making the state widely available to others and for rejecting invalid
transactions. In this virtuous cycle, the payment system is built on
top of the decentralized consensus, which only functions due to
incentives created by the payment system itself. Both the payment
system and the consensus can then be used for other purposes.
As new applications for blockchain technology are envisioned, the
demands on the underlying infrastructure are constantly increasing.
At the moment, the two major obstacles to widespread adoption of
blockchain technology are its poor scalability and lack of a solid
development environment. The main contribution of Cartesi to the
blockchain ecosystem is overcoming both these issues.
Scalability Currently deployed consensus mechanisms are based
on full redundancy [Nakamoto 2009; Wood 2018]. They require
every transaction to be stored permanently and to be validated by
every participant. This inefficiency is the key limiting factor to the
growth of the transaction rate, the amount of data involved, and the
intensity of computations within transactions. High transaction costs
and increased latency have become a barrier to many innovative
applications that would otherwise benefit from the flexibility that
smart contracts bring to the blockchain.
Attempts to improve blockchain scalability can be divided into
layer 1 and layer 2 solutions. Layer 1 scalability solutions change
the underlying blockchain infrastructure itself. Examples include
the optimization of block sizes, sharding, and Delegated Proof of
Stake (DPoS). Because they operate at the infrastructure level, these
solutions are burdened by the requirement of preserving global con-
sensus. Certain aspects of the state, such as the payment system, are
of critical importance to all parties and therefore require global con-
sensus. Otherwise, for most interactions mediated by the blockchain,
it is perfectly safe to limit access and verification responsibility to
the few parties that can potentially be affected. The blockchain can
then be used to provide finality and to guarantee local consensus in
the rare occasions where a dispute arises between these parties. In
other words, global consensus is a precious resource that should be
used with parsimony. In recognition of this fact, layer-2 scalability
solutions such as plasma, side chains, TrueBit, or state channels
move as much data and computation as possible off-chain. Layer-1
and 2 scalability solutions are discussed at some depth in section 2.
Computation environment Every computation that can influence
a transaction, whether performed on-chain or off-chain, must be re-
producible by all parties playing a validating role. Reproducible
computational models must be self-contained and deterministic. In
other words, the complete state for the computation and the entire
sequence of modifications to this state must be fully specified and
agreed upon. Sadly, real computing architectures were not designed
with these constraints in mind, and therefore are not reproducible.
Blockchain platforms solve this problem by employing custom vir-
tual machines (VMs) when processing smart contracts. These VMs
are reproducible, but also domain specific. On the one hand, they
offer native support for features useful to smart contracts (e.g., ac-
counting, rollback, associative memory, authentication, cryptogra-
phy etc). On the other hand, they lack valuable features found in
general-purpose architectures (e.g., floating-point arithmetic, virtual
memory, interrupts etc).
The revolution in software capability the world experienced over
the last few decades can be attributed to two key factors. The first
is an exponential increase in the speed at which modern hardware
platforms can process vast amounts of data. The second, and equally
important, is the ever-increasing expressive power of software devel-
opment environments. Indeed, general-purpose computations do not
happen in isolation. Rather, they are assembled from inter-dependent
building-blocks created by a worldwide collaboration of software
developers. These components and services rely on standard-library
facilities hosted by an underlying operating system (memory man-
agement, process management, file systems, networking, etc). It is
the operating system that ties everything together. Such facilities
are not available from the free-standing programming languages and
compilers that typical blockchains offer to smart contract developers.
Reproducibility and scalability concerns have made on-chain com-
putation environments very restrictive. To boost productivity and
widen the scope of blockchain development, we need a reproducible
computation model that supports modern operating systems.
Cartesi
This paper describes Cartesi, a layer-2 platform for the develop-
ment and deployment of scalable decentralized applications. Cartesi
DApps are hybrid, i.e., they include both blockchain and off-chain
components.
The off-chain component runs in a network of Cartesi Nodes (sec-
tion 6), each representing the interests of a DApp user. The off-chain
component is further divided into two modalities. Native compu-
tations run directly in the host hardware. Although native compu-
tations have access to the node’s full processing power.