Mar 14, 2024

Microchains in Linera

Pink Flower
Pink Flower

Linera’s contribution to web3 is to move the space beyond a monolithic approach to blockchain networks and towards the era of the personal blockchain. To understand this paradigm shift, we need to reintroduce familiar components such as chains, wallets, nodes, and applications and take a fresh approach to their roles within a network.

Let’s start with the blockchains themselves. As we’ve seen, microchains are a fundamental part of a new paradigm in blockchain network design that is tailored to some of the most promising use cases in web3. Let’s define them, understand how they work, and explore some of their implications for web3 development.

What are microchains, exactly?

“Microchains are lightweight chains that operate in parallel within a common set of validators. In a microchain-based network, the role of proposing blocks is separate from the role of validating them. In many cases, block production is delegated to users, allowing an unlimited number of microchains to run in parallel, while ensuring low transaction fees, quick transaction finality, and giving users direct local access to their on-chain data.”

Microchains were first introduced in the Linera whitepaper as a new approach to build horizontally-scalable blockchain networks. Consistent with the core idea of a blockchain, a microchain is made of a chain of blocks, where each block contains a sequence of transactions. Blockchain networks based on microchains distinguish themselves in two important ways:

  1. Microchains are validated and executed in parallel in the same set of validators. This allows the blockchain network to scale horizontally by incentivizing each validator to be itself a scalable service.

  2. Users can create their own microchains, in which they can store assets and execute transactions by proposing blocks directly from their wallet.

How microchains work on Linera

By using microchains, the Linera protocol revisits how users interact with a blockchain network:

  • In Linera, user wallets act as nodes in the protocol (but not as validators), synchronizing and proposing blocks in their own chain.

  • A block contains a sequence of transactions signed by the user wallet. Transactions may initiate user operations or receive messages from other chains.

  • Once validated and finalized, blocks are added to the chain, causing transactions to be executed on the chain and, optionally, outgoing messages to be delivered to other chains.

Another specificity of Linera is that block production can be configured differently for each microchain. The three main configurations are currently known as: single-user, permissioned, and public chain.

When the blocks of a chain can be produced by a single user, we say that this user “owns’’ the chain. “Single-user microchains’’ are at the core of the Linera protocol, notably for user wallets.

Another available configuration is for “permissioned microchains,” as described in the latest whitepaper. This configuration delegates block production to a small number of users. It is used to support use cases such as game instances and atomic swaps.

Finally, some microchains, called “public”, may be run by validators themselves. These chains follow a traditional model where blocks are produced by all validators, successively, using a leader election protocol.

Scaling validators vs scaling blocks

One of the main motivations to use a blockchain network based on microchains is that an unlimited number of microchains — and therefore users — can be active simultaneously.

Moreover, microchains can interact seamlessly with each other because they all share the same set of validators with the same level of security. In practice, efficient cross-chain communication is key to the performance of Linera applications.

The implications of this approach are significant. In many cases, microchains offer a way for application developers to offload scalability concerns entirely to validators.

A primary benefit of scaling at the validator level is to give developers more control on performance, and ultimately on user experience, when designing web3 applications at scale. To make a Linera application scalable, a key technique is to organize data and computations so that they take place on user chains whenever possible, and to use messaging for coordination between chains. Common limitations in blockchain networks such as transactions-per-second become irrelevant if each chain is only concerned with a small number of transactions affecting a particular user wallet.

Validators, in turn, can respond more easily to scalability concerns. Linera validators may leverage existing web2 infrastructure to respond to network needs. Data centers and cloud service providers can ensure that the system counts with the same resources for scalability that power the rest of the Internet.

On decentralization

Decentralization is often measured as a function of two key indicators: the number of nodes in the protocol and the Nakamoto coefficient, defined as the minimum number of malicious validators needed to disrupt the protocol (even so briefly). Many modern high-performance blockchains aim to maximize their Nakamoto coefficient while enforcing strong hardware and connectivity requirements on their validators. However, this approach may lead to a reduction in the number of nodes able to follow the protocol and execute all the blocks, raising concerns over the resilience of the network.

Linera’s approach based on microchains presents a unique opportunity to solve the dilemma between resilience and performance by ensuring the general transparency and auditability of the network. Indeed, microchains are designed to be cheap to synchronize and execute in isolation. Our goal is that Linera users should eventually be able to audit the blocks of any microchain using a regular wallet and be rewarded for their work.

Next, we will look at the role of wallets in a personalized approach to building onchain and how they enable users to propose new blocks.

Start building on the Linera Devnet today and learn more about microchains by reading the whitepaper. Stay tuned for the latest updates on the Linera project by following us on X.