Polkadot vs Near Sharding: Which Design Is Better?

By Michael @ CryptoEQ | CryptoEQ | 29 Jun 2023


You are reading an excerpt from our free but shortened abridged report! While still packed with incredible research and data, for just $20/month you can upgrade to our FULL library of 50+ reports (including this one) and complete industry-leading analysis on the top crypto assets. 

67cbbf4723857b85c151585aa280e6d940346c501cef75bafd7dea02b44b24c9.png

Becoming a Premium member means enjoying all the perks of a Basic membership PLUS:

  • Full-length CORE Reports: More technical, in-depth research, actionable insights, and potential market alpha for serious crypto users
  • Early access to future CORE ratings: Being early is sometimes just as important as being right!
  • Premium Member CORE+ Reports: Coverage on the top issues pertaining to crypto users like bridge security, layer two solutions, DeFi plays, and more
  • CORE report Audio playback: Don’t want to read? No problem! Listen on the go.

 

Polkadot Sharding

Polkadot is a sharded blockchain. Sharding is database partitioning that spreads the computational and storage workload across a peer-to-peer (P2P) network so that each node isn't responsible for processing the entire network's transactional load - allowing networks to scale more efficiently. Shards on Polkadot operate as separate blockchain networks with transactions and data exchange across the sharded network executed in parallel with security guarantees. Blocks on Polkadot are published around every six seconds.

Sharding uses DA proofs to achieve scalability. Instead of all the nodes downloading all the data on the blockchain, each node downloads only a part of the chain data. The nodes can collectively combine their shards to reconstruct all the data of the blockchain. Any single shard can raise disputes to be resolved by all nodes on demand. The advantage of having shards as pure data layers is that it creates flexibility for rollups to dump data on multiple shards while remaining composable. A rollup can have throughput and fees unbounded by the data capacity of a single shard. With 64 shards, the max aggregate throughput of rollups is projected to increase from 5K TPS to 100K TPS. Regardless of how much throughput Polkadot generates as a whole, fees will be limited by the throughput capacity of a single parachain which is about 1000-1500 TPS. Polkadot developers are working on optimizing the network’s performance using Asynchronous Backing that will allow parachains to build blocks concurrently with the relay chain and reduce the block time from 12s to 6s.

Architecture Source

Beginning in phase 2 (2018) of the network rollout, Polkadot began using Nominated Proof of Stake (NPoS) as its consensus method. There are a limited, known number of validators, and the set number is decided by on-chain governance. Inclusion in the active set is determined by a validator’s total self-bonded and delegated stake. The minimum stake required to get in the active set varies and depends upon other validators and their stakes. The goal of NPoS is to prevent the formation of cartel-like oligarchies and give more weight to smaller DOT holders in the validation process. 

Developers looking to build on Polkadot must enter an auction for the right to build on a parachain in a contract lasting up to two years. This means a potential developer or team must first come up with substantial amounts of DOT prior to building their application. This is in contrast to the situation in Ethereum where developers have now started building dApps, gaining users, and then building a token into the project in later stages to monetize.

Parachains

Parachains are Polkadot’s solution to scalability. They are called “parachains” because they are unique chains/ecosystems running parallel to the relay chain with their own governance and token but connecting back to the relay chain and sharing its security. Instead of being incentivized by DOTs, each parachain has its own economics and incentive structures.

DOT parachains Visual of the relay chain-parachain architecture. Source: TechBullion

Each Parachain built within Polkadot uses the Substrate modular framework that supports developers building applications within parachains to fit their specific needs. This means that individual parachains can be optimized for specific use cases like DeFi, gaming, NFTs, etc. Substrate enables greater flexibility and optimization for developers than what they would experience building on a general-purpose smart contract blockchain like the EVM. Potential customizations enabled by Substrate include choosing your own transaction fees (even zero), data storage, speed, composability, and pallets (blockchain building blocks on Substrate). Furthermore, Polkadot can upgrade without the requirement for a hard fork.

The Parachains connect to the overarching Relay chain that secures the network’s parachains and maintains Polkadots consensus, transaction finality, and voting logic. Parachains periodically submit proofs back to the Relay Chain, which maintains consensus across all parachains and keeps the entire DOT universe in sync.

A critical differentiator of Polkadot is the shared security model. Polkadot seeks to enable disparate parachains to interoperate in a trustless way via shared security, meaning they do not need to bootstrap their own validator set like in Cosmos or Avalanche subnets. This allows developers to launch chains and applications leveraging a shared security model without having to worry about attracting enough miners or validators to secure their own chains.

This design decision places a significant strain on the Relay Chain. If the Relay Chain were to fail, the entire DOT ecosystem could be jeopardized. This centralization is also reflected in Polkadot's market capitalization, which is significantly larger than Moonbeam, Polkadot's largest parachain.

Network access is also a significant distinction between the two ecosystems: parachains on Polkadot must pay a costly admission price through auctions. In order to obtain a 2-year parachain space. Cosmos, on the other hand, has no entrance hurdles and does not collect setup fees or rent for app-chain maintenance.  In Polkadot, however, the benefit is shared security. Parachains pay in advance for shared security as a service, which includes free execution and guaranteed bandwidth for the duration of the lease. 

Polkadot also has capabilities for bridges that allow parachains to connect and communicate with external networks like Ethereum and Bitcoin.

Polkadot uses optimized quadratic messaging between nodes and a limited number of participants. Polkadot has 297 active validators and 1000 on Kusama. You currently need 1.75 million DOT, or approximately $33 million to be an active validator on the Polkadot relay chain. You only need 120 DOT to be a nominator. The total value staked is approximately $12 billion.

Polkadot has hierarchical inherited security. The central relay chain is connected to the parachains. The relay chain has validators, the parachains have collator nodes that collect transactions and produce state transition proofs for the relay chain to validate. The Cross-Consensus Messaging format (XCM) format allows for interoperability between the parachains. The inherited security makes arbitrary data passing possible. 14 parachains are currently live. They have different specializations like DeFi, EVM smart contracts, social media, privacy, and games. In development are bridges to Ethereum, Bitcoin, and other projects. Unified finality is guaranteed by the inherited security model. Under this model, parachains can safely pass arbitrary data among each other. 

The domain-specific parachains functionality becomes available when they are connected and synchronized to the relay chain via their collector nodes. A criticism of this mechanism is that different chains may not need the same level of security. The survival of the ecosystem should not depend on any single chain. Polkadot currently supports the idea that parachains do not need validators. A developer can use Substrate to create custom blockchains and cultivate a validator community without depending on the centralized relay chain. The parachain can have its DOT funds unlocked at the end of the lease period, and use bridges when cross-chain communication is required. There could be multiple relay chains developed which would benefit the Polkadot ecosystem overall. The hierarchical topology will probably remain because inherited-security-enabled cross-chain communication is much more efficient than using bridges between parachains.

A parachain may want to grow their own validator community so they can become a relay chain and lease security to other chains. A nested security-sharing mechanism could get increasingly complex but all sub-parachains would share common finality guarantees, and the total number of state transitions per second would increase. This would expand the aggregate computational throughput for the entire Polkadot network.

To obtain a slot on the Polkadot chain, a project must win an auction by locking up more DOT than other bidding projects. If won, your slot is only leased, anywhere from 3 months to 2 years. There is a limited number of parachains available, with more to be released in the future. Currently, the Polkadot developers believe ~100 different parachains can be supported in the current status.

 

Near's Nightshade Sharding

NEAR Protocol achieves scalability through sharding, a process that distributes computational stress by partitioning data on the network into smaller pieces called “shards.” In traditional sharded blockchain models, each shard is its parallel blockchain with its validator set. NEAR has implemented a slightly modified version referred to as “Nightshade.”

To further grok a sharded blockchain architecture, it is critical to understand the role nodes play in a blockchain and the resource burden over time. Nodes (typically) perform three tasks in a decentralized blockchain:

  1. Compute: Process new transactions
  2. Consensus: Relay valid blocks to the other nodes in the network
  3. Storage: Store the state/history of the entire network 

However, each of these activities places an increasing demand on nodes. As the volume of transactions increases, more computing power is required to process them. Relaying transactions and blocks increases network bandwidth requirements. As the amount of data to store increases, more storage is required.

In sharded blockchains, each shard stores only its local state and only relays transactions associated with its state. While this does reduce the resource load on nodes and improves scalability, it introduces increased complexity in the form of cross-shard interoperability. All the shards must know where all/specific states reside at all times and coordinate in validator selection/slashing. Designs like Ethereum and Polkadot have a Beacon/Relay chain at the center to help coordinate these things.

Solana actual TPS jan 2023 Source: Xangle

Differentiation from Beacon Chain

Nightshade takes a step away from the Beacon Chain model of sharding. In Beacon chains, multiple blockchains are secured by different validators, with each chain being its shard. This creates separation within the overall security of the total system as validators are separated per chain (shard). So, if there are 10 shards in a system with each shard having its validator, to achieve the same level of security as a non-sharded chain, each shard requires 10x the validators.

Contrasting Beacon Chain and Nightshade. Source: NEAR Protocol Contrasting Beacon Chain and Nightshade. Source: NEAR Protocol

Instead, Nightshade operates as a single blockchain, as each block contains all transactions from all shards while simultaneously adjusting all shards' whole states. No one node downloads the full state of the network. This is how the NEAR protocol performs dynamic sharding.

This has three advantages that benefit NEAR:

  • There’s less opportunity for the network to fork, granting higher security
  • The network operates faster as participants are only responsible for their shards
  • Increased cross-shard composability

Nightshade lists the transactions within a block and splits them into chunks (one chunk:one shard). Generally, NEAR ideally has one chunk per block, though it's possible that chunks are missing due to network delays. This functionality corresponds with DoomSlug in ensuring that blocks can still be validated and added to the chain even when data is missing.

In Ethereum's case, every transaction must be confirmed by the beacon chain, which limits scalability based on the throughput of the beacon chain. The interblock sharding method of Near does not rely on a single chain for transaction validation and, therefore, does not suffer this limitation.

Stages of Nightshade

The Nightshade sharding implementation is being rolled out in stages. Nightshade was initially released as Simple-Nightshade, a phase 0 launch in November 2021 that enabled the basics of Nightshade to begin providing transactions four times as fast for validators. Phase 1 was recently completed in Q3 2022 and introduced a new form of validator on NEAR, the chunk-only producers. Hypothetically, this will add decentralization to the network by countering the network’s previous 100 validator limit.

Phase 2 is the full release of Nightshade for validators in which both the state and processing of the state will be 100% sharded. This eliminates the need for validators to track all shards, reducing the hardware requirements to make the network far more accessible to those who wish to participate directly. This rollout is projected sometime in 2023, though developers are notably behind schedule.

Lastly, Phase 3 is projected for some time in 2023 and will include the ability for the network to split and merge shards entirely based on resource use dynamically. This means that less used shards can be combined with other under-utilized shards to help the network increase overall efficiency.

How do you rate this article?

78


Michael @ CryptoEQ
Michael @ CryptoEQ

I am a Co-Founder and Lead Analyst at CryptoEQ. Gain the market insights you need to grow your cryptocurrency portfolio. Our team's supportive and interactive approach helps you refine your crypto investing and trading strategies.


CryptoEQ
CryptoEQ

Gain the market insights you need to grow your cryptocurrency portfolio. Our team's supportive and interactive approach helps you refine your crypto investing and trading strategies.

Send a $0.01 microtip in crypto to the author, and earn yourself as you read!

20% to author / 80% to me.
We pay the tips from our rewards pool.