Scaling Tezos with Layer 2 solutions
By DEKU team
How to scale a blockchain is a huge topic and Tezos core devs teams are exploring several designs. At Marigold, we want to share our R&D work with Tezos builders as soon as possible to get their feedback and improve our proposal. Since scaling blockchains is still an experimental field we're developing different solutions with different benefits.
This post aims to give a global overview of different scaling solutions for Tezos, introduce Marigold's work in this landscape and how they relate to each other.
When people refers to scaling they may have some objectives in mind:
- Increasing the throughput of the chain, like having faster TPS;
- Reducing the finality delay for a block;
- Having deterministic finality rather than a probabilistic one;
- Reducing gas consumption for processing operations.
In the meanwhile, they want to preserve the intrinsic properties of the blockchain like safety, censorship resistance or decentralization
Rollups are specialized to process large batch of operations while this chain may use more powerful hardware. It's a way to scale both horizontally and vertically.
As Layer 2 solutions, rollups have two main building blocks:
- a protocol in Tezos which manages communication and security between layers
- a daemon node which processes rollup transactions
Optimistic Rollups, or ORUs, are called optimistic, because they work on the assumption that blocks are correct until explicitly proven otherwise.
Jakarta2 introduced the first ORU solution into the Tezos ecosystem, so called TORU for Transactional Optimistic Rollup. While they are limited exclusively to transactions, TORUs are the very first solution that Tezos application builders can use to familiarize with ORUs.
TORU is an exploratory design exercise preparatory to the development of SCORU which will come along with a WASM VM to process smart contracts witin the rollup.
Both can be thought of as a rollup factory, meaning any rollup node builder may use their respective rollup protocol.
TORU & SCORU are called enshrined rollups because their rollup protocol is enshrined to the Tezos protocol.
This is a very innovative approach in blockchain which aims to give better warranties and faster throughput to rollups users.
Rollups are designed to increase throughput. And with TORU already reaching 200 TPS, we can expect 1,000 TPS from more mature solutions.
Since Rollups use Tezos' Tenderbake consensus, their finality is deterministic.
A TORU/SCORU node builder may choose their own, but for sure the fees will be lower than in Tezos.
Finality is the tradeoff of ORUs. So while it may not be a concern for an application living only in the rollups, when one needs to withdraw to Tezos, they have to wait until the end of the refutation period. The refutation period for TORU is 14 days. Though this is a very conservative estimate because TORU is still experimental. But it will remain in days.
A sidechain is a secondary blockchain paired to, and communicating with, a parent blockchain. A sidechain works like any blockchain and has the same core properties, with the added feature that its consensus is witnessed by the main chain.
As a scaling solution, a sidechain may accept some decentralization tradeoffs to explore new designs and to improve the throughput.
DEKU-C is a public, proof of authority blockchain that runs a Tendermint like consensus and a WebAssembly Virtual Machine. The authority for running this chain is the Tezos Core Teams.
Like rollups, the core assets bridged between Tezos and DEKU are Michelson Tickets.
DEKU Alphanet is starting this week and open to any application builder who want to explore it.
Stay alert, lot of info will be communicated this week
DEKU-P is the core system behind DEKU-C. We've open source it as a framework to build your own permissioned or private chain.
Current private blockchain solutions require deep knowledge: they are SDK either to build a full blockchain or a virtual machine. Those require a deep knowledge of blockchain internals to not be at security risk, meaning projects have more work on infrastructure than on their own business. This is very bad for time to market also.
Parametric aims to ease this by only requiring you to code your chain's state machine.
Business would be defined only with a state machine: this is exactly what DEKU-P do.
DEKU-P comes with TypeScript, Go & OCaml SDKs and more can be added.
To know more about DEKU-P, you can attend the talk "Introduction to DEKU, a parametric sidechain on Tezos", Friday 22th of July during the TezDev 2022 at Paris.
Proof of authority sidechains combined with top of the line hardware may rocket the throughput. DEKU-C Alphanet currently hits 5,000 TPS, we're working on reaching 10,000 TPS soon, and our actual objective is much higher.
Using Tendermint's consensus, finality is deterministic and only requires 2 blocks on DEKU.
DEKU has neither a minimum nor fixed block time: blocks are produced as fast as they can.
This comes at the price of less decentralization, which is why we want to build a trustable authority. We think that a consortium of core developers, excited to work in open source and accountable to the community, would be far more trustable than a VC funded opaque corporation, but we may be wrong!