top of page
  • Twitter
  • Telegram
  • Discord
  • GitHub
  • Youtube
  • Writer's pictureAndrey Shevchenko

Building Fast, Decentralized, Low-Cost Appchains: Choose Your Duo Wisely

Updated: Jun 2, 2023

The ever-evolving landscape of blockchain technology is presenting dApp developers with an increasing number of options for implementing their ideas. One of these might be to create their own customized blockchains or appchains.


The "appchain thesis" is often viewed as inevitable, given the fundamental scalability issues faced by "all-in-one" blockchains that attempt to accommodate every application within a single environment. This issue arises primarily from the exponential growth of Decentralized Finance (DeFi).


DeFi, which involves utilizing blockchain for financial purposes such as trading and yield generation, has become a dominant force in the ecosystem. A significant portion of DeFi activity involves arbitrage, which helps keep liquidity pools in sync with other markets, liquidate bad debt, and execute other transactions that capitalize on the $2B+ daily volume across the DeFi space. Consequently, DeFi transactions can remain viable even when paying 100-fold more for gas than NFT mints, domain registrations, or token transfers. As a result, if simpler use cases compete for the same block space as DeFi, they will inevitably be pushed out as activity increases.


The solution to this challenge lies in specializing block space for unique use cases and enabling communication between these chains when required. This long-term vision is shared by several projects, including Ethereum, Cosmos, Polkadot, Polygon, and others. Though the end goal is similar, developers must determine which platforms offer the best environment for building appchains today. What are the technical differences between rollups and sharded chains like Avalanche and Polkadot?


In this article, we will delve into the performance and decentralization features of appchain platforms, also drawing attention to certain "darker" aspects that are often overlooked in marketing materials.


Navigating Ethereum and Layer-2 Rollups

In recent years, rollups have gained traction as a highly regarded scalability solution for Ethereum. The so-called Rollup-centric roadmap has all but replaced the original vision of “execution shards,” which involved creating 64 independent but connected blockchains that would share the burden of running Ethereum between them.


Rollups, instead, focus on separating the burden of execution from that of validation. Rollups borrow their security from Ethereum by essentially “saving” their data directly on the blockchain in such a way that the EVM is able to verify its validity. Hence, if the Ethereum blockchain is secure, then so are all the rollups connected to it. This is a key principle that defines a blockchain as layer-2 instead of being an independent layer-1. If you want to dive deeper into these concepts, and their differences vs. appchains, visit our last blog post about Choosing the Right Scaling Solution: Appchains, zk Rollups, or Optimistic Rollups?


While shards will still exist, their sole function will be to serve as data availability layers, essentially providing additional space for posting rollup blockchain data. So far, two approaches for creating Rollups have been proposed: Optimistic Rollups and zkRollups. We won’t be going too much into the details of each type, as the relative differences are not that significant in the context of a comparison with L1 chains.


Instead, let’s focus on the two aspects that matter most for developing apps: Performance and Decentralization.


L2 Rollup Performance: Fast Block Times, but Unpredictable Costs


As we’ve mentioned before, rollups are based on the idea of posting their data to the Ethereum blockchain and using a particular verification mechanism (either fraud proofs or zero-knowledge proofs) to make sure that data is correct.


The data is published in the Data field of a simple Ethereum transaction, also called Calldata. Because it doesn’t need to interact with contract memory, posting Calldata is much cheaper. Still, more than 99% of a typical L2 transaction cost is destined as payment for publishing the data to the L1.


On Optimism, the average transaction consumes about 4000 mainnet gas, which is less than 10% of the cost of an average token transfer on mainnet (the specific compression factor depends on the type of transaction and is more significant for expensive transactions).



Other rollups have similar compression performance between 2000 and 7000 gas per transaction, including zkRollups. In theory, then, full adoption of rollups would increase Ethereum throughput 10x or more. According to l2fees, a transaction on an L2 is between 5 and 25-fold cheaper than on mainnet Ethereum (depending on its type).


But here comes the “ugly” part: ETH L2 fees are proportional to the fees you pay on the L1. The compression certainly alleviates costs, but any increase in Ethereum gas prices is mirrored directly for the L2. Right now, prices are elevated (about $20 for a Uniswap trade) but not critically so, and L2 transactions already cost approximately $1. While this is much, much better than using mainnet Ethereum, it’s still significant for any use case that requires continuous transaction activity (like gaming).


So, when looking to deploy a rollup, especially for a custom use case, Ethereum may not be the best choice of “anchor” blockchain for non-DeFi activity. It’s also worth noting that established L2 players can count on a significant degree of batching of individual transactions, so independent rollups will likely cost more for users.


While Decentralized in Theory, Rollups Raise Real-World Centralization Concerns


From a consensus perspective, rollups are incredibly decentralized because they borrow the decentralization and security of Ethereum. Reorganizing a rollup chain requires reorganizing the Ethereum mainnet itself. But that’s the theory.


The entire history of the rollup can be reconstructed from the calldata it posts, so even if a rollup fails, the users can still be quite confident that they will be able to recover all funds. Again, in theory.


In practice, there are some implementation caveats to consider for each rollup system. For example, Optimism is currently not operating with the intended fraud-proof mechanism. There are also no escape hatches for users, so if the single validator fails, the users’ funds will be stuck in the L2. For all intents and purposes, Optimism is closer to a Proof of Authority (PoA) sidechain than a true rollup right now.


While this is obviously supposed to be temporary, it’s still a notable drawback worth keeping in mind, especially because Optimism is currently the only production-ready rollup to be preparing for a “white-labeling” of its technology through the modular OP Stack. Optimism can also be directly forked, which has been done by multiple teams to build things like OPCraft, an on-chain game inspired by Minecraft.


Other rollups will usually have some form of proving mechanism active, but they’re not fully decentralized. Arbitrum’s sequencers and “defensive” validators (responsible for fraud proofs) are permissioned, for example. ZkRollups are similar, though they’ve been live for much less time.


Sequencer decentralization is a weak part of all rollups. The sequencer is responsible for producing blocks and advancing the rollup chain, and in all cases, this software is run by centralized entities. While sequencers cannot steal money, they have exclusive access to MEV opportunities, and, importantly, they could go down.


Overall, L2 rollups offer some significant performance and security benefits, and the principle of separating consensus from execution is extremely powerful. But digging deeper, decentralization is still somewhat lacking.


The Sharded Blockchain Landscape: Polkadot and Avalanche


Now that we’ve reviewed how rollups work, it’s time to draw a comparison with other blockchains relying on a similar sharded architecture. The most notable examples are Polkadot and Avalanche, which both have a core set of validators who are directed to the individual appchains.


The “shards” in these chains are called parachains and subnets, respectively. Regardless, both rollups, parachains, and subnets are all different variations of the original concept of sharding, so let’s unpack all the differences!


Avalanche: Shared Validators in Theory, but Not in Practice


The Avalanche “blockchain” is actually a collection of several chains and subnets. The “native” chains are called C-Chain (the one everyone knows about), P-Chain (used for managing validators and staking), and X-Chain (a DAG-based ledger supposed to be used for payments and exchange).



An Avalanche Subnet is a custom appchain designed to connect to the Avalanche network and share validators with it. Ideally, subnet creators would rent validators from the primary network so that they’d also build blocks for the appchain.


In practice, the exact opposite is happening: validators for leading appchains, set up by these leading appchains, are also “allowed” to validate the primary network. As an example, all 8 validators of DeFi Kingdom Chain are managed by DeFi Kingdom.


In theory, Avalanche should be an interesting twist on shared security. While there is no separation between execution and validation, you do have a large central set of validators who are also supporting security inside the “shards.” In practice, Avalanche subnets are their own sovereign blockchains only tied to the main chain nominally.


Unlike rollups, Avalanche does have its Warp Messaging protocol to let these chains share messages, similarly to IBC or XCM. However, even here, the lack of shared security impacts the effectiveness of cross-chain transfers. Warp Messaging is only as secure as the weakest link, which will usually be the subnet (generally with less than a dozen validators).


In terms of performance, Subnets are fast: they have 2 seconds block time and finality and have a reasonable gas limit of 25 million (in case of an EVM chain like DeFi Kingdoms). This is a powerful feature for GameFi applications and other transaction-heavy uses. Since they are sovereign blockchains, the block space doesn’t need to be shared with anyone.


Overall, Avalanche is a decent option if seen as an L1 framework for launching sovereign chains based on the Avalanche consensus mechanism. However, just like with Cosmos, there isn’t much in the way of shared security, so there is a lot of work involved in making sure the chain is safe and performant, without mentioning decentralization.


Polkadot: Fully Decentralized and Low-Cost, but with Some Speed Trade-Offs


Finally, the Polkadot ecosystem offers perhaps the closest alternative to the original Ethereum sharding vision.


Polkadot has a central Relay Chain that highly focuses on staking. Then, it has a network of customizable parachains that offer the actual smart contract and appchain capabilities that underpin the network.


Polkadot parachains have a unique verification and block production mechanism that makes them closer to layer-2 blockchains. A subset of Polkadot validators is responsible for validating and finalizing the blocks submitted by each parachain. However, the actual blocks are proposed and constructed by so-called Collators, who are a separate set of actors recruited by the individual parachains.


Unlike nearly all other similar chains, there’s a good number of both collators and validators who are run by the community. For example, Moonbeam alone has 72 active collators. In terms of the function they perform, collators are pretty much exactly like a rollup’s sequencer.


For developers, setting up a parachain is relatively cheap. A Polkadot auction slot can be acquired for an equivalent of less than $900k in funds staked, usually sourced through community crowdloans. On Kusama, slots can be acquired for as little as $46k in KSM collateral.


Perhaps the biggest downside of Polkadot is that it’s relatively slower than some of its brethren. Parachains have a fixed block time of 12 seconds, which makes them significantly slower than rollups. Although this should soon be improved to 6 seconds via the Asynchronous Backing technology.


Individual blocks are also not huge, so the overall transaction capacity of a single parachain is a bit less than one Ethereum’s worth. We can see it with Moonbeam, which has a gas limit of 15 million, roughly what Ethereum had before EIP-1559 in 2021 (now it’s 30 million). WASM-native chains will likely be a bit faster, but they’re more difficult to compare.


However, unlike rollups, parachains “pay” for a certain period of security (the parachain lease) only once and don’t need to have the users pay for L1 gas on a continuous basis. What’s more, a parachain lease is just holding the funds as collateral, returning them at the end. All told, the only cost of a parachain slot is the dilution from the inability to stake DOT, which is about 20% APR.


This means that Polkadot is actually very low-cost, with the average Moonbeam transaction only requiring a few cents of gas. Since there are 43 active parachains, the usable throughput of the network is quite significant, even if individual chains may not be extremely fast yet.



Pick Your Weapon: Performance or Decentralization?


In today’s landscape, layer-2 chains on Ethereum are all the rage. And indeed, it’s difficult to argue against their adoption, especially in DeFi. But it’s safe to say that in their current state, rollup developers cut quite a few decentralization corners.


Rollups are quite centralized. Optimism, the leading modular kit used to build rollup appchains, currently lacks all of the key ingredients of an optimistic L2. Even if you take other types of L2 stacks, sequencers are still a centralized pain point.


In terms of costs, rollups offer tremendous savings over Ethereum mainnet, but that’s still not enough on its own to bring us to mainstream adoption levels.


Alternative sovereign blockchain stacks, such as Cosmos and Avalanche, may offer inexpensive transactions but often lack enhanced security features that are critical to protecting against vulnerabilities in the network.


Finally, Polkadot comes at the opposite spectrum of rollups: fully and meaningfully decentralized, but with lower performance if you really start pushing it. The Polkadot network as a whole probably has more throughput than Ethereum plus rollups, but for smaller apps, the UX aspect of two-second finality is certainly a convincing argument for “faster” solutions.


The choice of the “best” network for building appchains ultimately depends on what developers need. Large projects could definitely go for the sovereign L1 approach. DeFi use cases are probably best served by rollups, but for anything else, Polkadot and Substrate offer a richer and more cost-effective environment.


Worth mentioning, though, that both the rollup and Polkadot ecosystems are working on improving their downsides, so the comparison may certainly change in the near future!

293 views0 comments

Comments


bottom of page