The state of Multi-chain: Part 1

The state of Multi-chain: Part 1

Layer 1 Chains and the Blockchain Trilemma

Introduction

One Wallet All Chains: that is what Liquality is all about. In this article, we will take a look at the Layer 1 chains in our wallet and present their consensus mechanisms, pros and cons, and how they are positioned within the blockchain trilemma. A future article will cover the Layer 2 solutions in our wallet in the same light.

The current definition of a Layer 1 chain is a blockchain that has all the function parts needed for their full functioning without relying on any other chain or external service. We will analyze five chains that Liquality is integrated with:

  • Bitcoin
  • Ethereum
  • BNB Chain
  • Avalanche
  • Solana

Why Multichain?

Over the development of public blockchains, a growing number of different blockchains were proposed as an attempt to provide a better solution to the blockchain trilemma: That no blockchain, where every node validates each transaction, can simultaneously possess all of these properties:

  1. Decentralization
  2. Scalability
  3. Security
Blockchain Trilemma - Source: Vitalik.ca

Decentralization can refer to several aspects, like how many block producers/validators can exist in a network. It also can be measured more qualitatively, like if a personal computer can participate as a node.

Scalability generally refers to the number of transactions a network can process, how much it costs to broadcast these transactions, or how much time is needed for the validation. This has been one of the biggest issues for public blockchains.

Security is often represented by the cost of taking control of 51% of the network’s hashrate or validators. For public blockchains like Bitcoin and Ethereum, this cost is in the billions of dollars.

Blockchains, consensus mechanisms, and characteristics

This section will analyze the blockchains, their consensus mechanisms, and how Security, Decentralization, and Scalability are handled in each Blockchain.

Bitcoin - Proof of Work

Bitcoin was the first blockchain application to gain massive popularity. Using its Proof-of-Work consensus mechanism to leverage the concept of decentralization, it became the most significant blockchain in market capitalization. It is mainly used to transfer its native token, BTC, from one address to another.

Decentralization: The Proof of Work consensus algorithm involves solving a computational puzzle to create new blocks in the blockchain. This process is known as ‘mining,’ and the nodes in the network that engages in mining are known as ‘miners.’ The incentive for mining transactions lies in economic incentives, where competing miners receive a block reward.

Proof of work schematics - Source: Bitnovo

While the miners propose the creation of a new block, the nodes are the ones that keep the network running. A full node is a program that validates transactions and blocks. Almost all full nodes also support the network by accepting transactions and blocks from other full nodes, validating them, and then relaying them to further full nodes.

The number of nodes on a network measures how decentralized it is. The higher it is, the less reliance on a handful of entities is needed to maintain the blockchain up and running. Bitcoin has a large count of full nodes (over 14,000), and the hardware requirements to run one are not so high.

Bitcoin Full Nodes Distribution - Source: Bitnodes

Scalability: Each new block takes, on average, 10 minutes to be mined. This happens because the mining difficulty is adjusted to reflect the hashrate available on the network. The objective is to give enough time for the newly minted block to be propagated to all the network as a strategy to prevent the creation of orphan blocks.

An orphan block happens when two blocks have a timestamp too close, and a temporary fork (two chains existing at the same time) is created, where each chain considers one of them. After resolving this situation, the block of the discarded chain is called “orphan block.” All the transactions on this orphan block return to the mempool to be included in a future block, and the work done mining is lost.

So there is a balance between the velocity of mining new blocks and the propagation time to reduce the appearance of orphan blocks. Unfortunately, this makes it difficult to reduce the block time, being a hindrance to increasing Bitcoin’s scalability.

There are solutions deployed outside BTC mainnet to improve BTC transaction speed, like lightning network or Rootstock (another chain that Liquality is connected to) to improve its usability as a payment network or a smart contract-enabled network.

Security: Changing an existing block requires regenerating all successors and recalculating the entire chain of “hard mathematical problems,” which is practically impossible. This protects the blockchain from tampering. The only possible way would be to take control of 51% of the entire network to make the nodes “agree” with the proposed values. It also has an almost impossible-to-pay cost.

There are solutions deployed to improve BTC transaction speed, like lightning network or Rootstock (another chain that Liquality is connected to) to improve its usability as a payment network or a smart contract-enabled network.

Pros

  • Secure: Proof-of-Work consensus mechanism has been running for over ten years without any significant issues
  • Decentralized: there is not a single institution that coordinates or changes the protocol’s rules

Cons

  • Scalability: Slow confirmation times, not suitable for most financial transactions
  • Fees are high

Ethereum - Proof of Stake

Since the ‘Merge,’ Ethereum Mainnet is running on the Proof of Stake consensus mechanism. It was one of the first networks to adopt the concept of smart contracts (that run inside the Ethereum Virtual Machine) to enable a blockchain to perform extra functions besides being a decentralized ledger system. As a result, it sparked the creation of different crypto application sectors like DeFi and NFTs.

Decentralization: Proof of Stake (PoS) is an algorithm aiming to achieve distributed consensus in a Blockchain. Nodes on the network stake an amount of cryptocurrency to become candidates to validate the new block and earn a fee from it. Then, an algorithm chooses the node that will validate the new block from the pool of candidates. This selection algorithm combines the quantity of stake (amount of cryptocurrency) with other factors (like the randomization process) to make the selection fair to everyone on the network.

Proof of Stake simplified explanation

This validator verifies all the transactions and publishes the block. However, its stake remains locked, and the forging reward is not granted yet. That happens when the nodes on the network verify this block.

The validator gets the stake back and the reward if the block is considered valid. On the other hand, if other nodes do not verify the block on the network, the validator loses its stake and is marked as ‘bad’ by the algorithm.

The current number of Ethereum nodes is a little bit over 8,000. There is the requirement of staking 32 ETH and having specific software installed on your computer to become a validator.

Ethereum nodes distribution - Source: Ethernodes

Scalability: Ethereum’s block time is constant at 12 seconds under PoS, which generates a throughput of around 12 transactions per second. Currently, it is impossible to increase this number significantly before the next network upgrade, which will introduce a sharded database, allowing parallel block creation. This update is called ‘The Surge’ and is scheduled to happen in 2023. The image below shows the planned roadmap for the following years.

Ethereum’s Upgrades Roadmap - Source: Vitalik Twitter

Security: To conduct a 51% attack, the attacker will have to own 51% of the total cryptocurrency in the network, which is quite expensive. This deems making the attack too tricky, costly, and not so profitable. There will also be problems when amassing such a share of total cryptocurrency as there might not be so much currency to buy, also that buying more and more coins/value will become more expensive. Also, validating wrong transactions will cause the validator to lose its stake, thereby being reward-negative.

Pros

  • Security: All nodes need to agree with the suggested block.
  • Decentralized: It is economically challenging to make a 51% attack.
  • PoS is energy efficient.

Cons

  • Transaction fees are high
  • Scalability: Transaction processing time is high

Avalanche - Avalanche Consensus Protocol

Avalanche is a Layer 1 blockchain with smart contract functionality and compatibility with the Ethereum Virtual Machine (EVM).

Unlike Bitcoin, which has a single blockchain network, Avalanche has different types of transactions and consists of multiple blockchains: Exchange chain (X-chain), Platform chain (P-chain), Contract chain (C-chain), and subnetwork (subnet).

Decentralization: The Avalanche Primary Network is a particular type of subnet that validates X/P/C-chains. To be a member of this subnet (to become a network validator) is necessary to stake AVAX tokens (2000 AVAX).

Number of Avalanche Validators - Source: Avalanche

Avalanche’s Chains Configuration - Source: Avalanche Docs

X-chain is an Avalanche blockchain for creating and trading digital assets with a set of rules. X-chain is an instance of the Avalanche Virtual Machine (AVM). For example, $AVAX (Avalanche token) is traded on X-chain. X-chain implements Avalanche consensus protocol.

P-chain is an Avalanche blockchain that coordinates validators, controls staking, manages active subnets, and creates new subnets. P-chain implements Snowman consensus protocol.

C-chain is an Avalanche blockchain that supports smart contract creation. C-chain is an instance of the Ethereum Virtual Machine (EVM) powered by Avalanche. C-chain implements Snowman consensus protocol.

Scalability: Subnets can be created on Avalanche (like Layer 2 on Ethereum). It will have its own state (no shared security) and more flexibility in design and implementation. Anyone can create a subnet by burning 1 AVAX token and paying some small additional fees. Validators from the Primary Network will add this subnet ID to their node configuration and download the custom VM binary. Once these steps are complete, validators will begin syncing it and start the validation.

Avalanche and Snowman Consensus Protocols

Evolution of Avalanche Consensus Protocol - Source: gyuho.dev

Security: Avalanche consists of a dynamic, append-only directed acyclic graph (DAG) of all known transactions.  A blockchain is a linear sequence of blocks, each having only one predecessor. A DAG is an architecture built on circles and lines. Each circle, also called a vertex, shows an activity that needs to be added to the network, while lines (also called “edges”) represent the order in which transactions are approved. The lines, or edges, lead in one direction only — hence the term “directional.” In DAGs, there is no path back to a given vertex, which is why these mathematical structures are called acyclic (since there are no “loops”). An Avalanche DAG defines one single circle, the "genesis" vertex, as the base one. As a result, DAG provides more efficiency because a single vote on a DAG vertex implicitly endorses all transactions that lead to the genesis vertex. And it also offers better security because, similar to the Bitcoin blockchain, the DAG interconnects transactions, thus making it difficult to revert past commits.

DAG example - Source: gyuho.dev

Snowman is a linearized version of Avalanche protocol and used for Avalanche Platform chain (P-chain) and Contract chain (C-chain). Snowman is a linear chain of totally-ordered blocks, whereas Avalanche is a DAG of vertices.

Although Avalanche native VM (AVM) makes it easier to define a blockchain-based application, Ethereum smart contract became the de-facto language in the industry. This is where Snowman comes in to support EVM-compatible smart contracts.

Pros

  • Scalability: Fast transactions and low fees
  • Security: DAG structure allows faster confirmations, making it more difficult to revert transactions

Cons

  • Decentralization: It is necessary to stake 2000 AVAX to become a validator

BNB Smart Chain (BNB Chain) - Proof of Staked Authority

Binance Smart Chain (BNB Chain) is a Layer 1 blockchain with smart contract functionality and compatibility with the Ethereum Virtual Machine (EVM).

BNB Chain uses the Proof of Stake Authority (PoSA) mechanism to achieve consensus in the network. PoSA combines Delegated Proof of stake (DPoS) and Proof of Authority (PoA).

Decentralization: The DPoS is a Proof of Stake variant model where the token holders vote in a specific number of delegates to become validators. So, instead of having just the requirement of a minimum number of tokens to become a validator, it is also necessary to have enough votes. This feature diminishes the chance of the network becoming sluggish with too many validators. In the case of BSC, the current number of validators is 23.

BNB Chain Validators - Source: BScScan

PoA, as used in Binance Smart Chain, represents a model where a central authority chooses the validators: Binance in the BNB Chain case. The exchange decides all validators that will be available for voting by the delegators (token holders). It works like a KYC process where Binance approves who can participate in block creation.

Scalability: BNB Chain has a block time of 3 seconds and a maximum block size of 100 million gas units (Ethereum’s numbers are 13 seconds for the block time and 30 million for the block size). This enables the network to achieve up to 160 transactions per second.

BNB Chain is introducing a zk-Rollup upgrade soon to improve its scalability capacities.

BNB Chain Roadmap - Source: BNB Chain Org

Security: The validators processing the transactions can have their stake slashed if proposing blocks with malicious intent, so there is an economic incentive to remain an honest validator. As the set of validators needs to be approved by Binance, the risk of a 51% attack is diminished (from an outside actor). However, this means that the users need to trust that Binance will remain at least neutral regarding how the network works.

Pros

  • Scalability: It has fast transactions and low fees
  • Has successful own DeFi Projects (PancakeSwap)

Cons

  • Security: Heavily dependent on Binance
  • Decentralization: Network Validators are not decentralized

Solana - Proof of History

Solana is a Layer 1 blockchain that uses a hybrid consensus model that combines a Proof of History (PoH) algorithm with a Delegated Proof of Stake (DPoS) version.

The Proof of History is a sequence of computations that can provide a way to verify the passage of time between two events cryptographically. It produces a unique output that validators can efficiently and publicly verify. So, instead of trusting the timestamp on the transaction, you could prove that the transaction occurred sometime before and after an event. A Verifiable Delay Function generates this output.

Proof of History + extra information on the time points - Source: Medium

Decentralization: The Solana blockchain uses PoH to ensure a proper progression of transactions before assigning it to a suitable leader. The Solana PoH elects slot leaders upfront before arriving at a consensus. And these leaders are chosen from the delegators/validators from the DPoS. Chosen leaders have the task of keeping a record of the time sequence of the specific slot allocated.  As a block generator working in a DPoS consensus mechanism, you depend on PoH to gain a slot and produce one block. So the chaining provided by PoH receives extra information to its time points (from the block produced) by incorporating it into the hash input. In the case of Solana’s blockchain, it adds the transactions that arrive during each PoH run.

The current number of validators in the Solana blockchain is 2048, with a so-called superminority of 30 validators.

Security: This superminority represents the smallest number of validators that control more than 33% of the total stake together. These entities could theoretically censor/halt the network if they colluded. The current list is shown below, and several known players in the industry are on it.

Solana Top 10 Validators - Source: Solana Beach

Scalability: As the PoH elects slot leaders ahead of time, each validator knows the order of upcoming leaders due to Solana's architecture. So clients and validators forward transactions to upcoming leaders before acting as leaders in the network. This allows validators to start processing transactions ahead of time. This results in fewer transactions cached in validators’ memory and faster confirmation time.

Solana projected block time is around 400ms (around three blocks per second). Its block size is 10 Mb, which gives it a massive theoretical TPS count (over 50,000).

Solana’s transactions per second - Source: Solana Explorer

As the network is still in beta release, the current TPS is hovering around 2400 TPS.

Pros

  • Fast and cheap transactions
  • Scalability: No need for sharding, Layer 2, or other scaling solutions
  • Security: Proof of History resolves block ordering

Cons

  • A big part of network activity is communication between nodes
  • Decentralization: Solana has 2048 validators, but only 30 are needed to halt the network. Also, the hardware to run a validator is expensive.

Summary

Comparison table between blockchains - ¹A significant part of Solana’s transactions are voting for their consensus mechanism.

Most of the newer L1 chains took the approach to provide more transaction bandwidth to users, as this is a pain point for public blockchains like Bitcoin and Ethereum. They did this by aiming to be seen as a viable alternative (‘Ethereum killer’ if you will). Decentralization was the part of the trilemma that got traded off mostly. The consensus mechanisms chosen to enhance the output often rely on centralization (leader, delegation, authority) to solve the issue.

Bitcoin and BNB Chain have higher Daily User numbers. At Bitcoin, the same address is usually not used more than once, making this number higher than the actual user counting.  Each transaction can also send funds to more than one recipient (that’s why the number of users is higher than the number of transactions). In BNB Chain, ¼ of this number is directly related to PancakeSwap, the most popular DEX on that chain.  

The TPS shown in the table is the value measured on the chains using their block explorers. The current numbers show that Avalanche is a chain that, within current market conditions, still has a lot of room to grow while capable of a higher TPS. Being a blockchain capable of processing a larger number of transactions is not enough to guarantee that a thriving ecosystem will be built and the users will start to use it. A specific narrative (or a strong sponsor) also plays an important part in fostering a user base.