Scalability, Gas Fees and Interoperability: The case of Polkadot
Canonicality and Validity i.e. in conformity with, or in the manner prescribed for – these are the two words used within Polkadot’s whitepaper to bluntly describe the issues faced by the present-day (circa 2015) blockchain architectures’ consensus mechanism. The paper highlights 5 key failures pertaining to lack of mainstream adoption for blockchain technology:
(a) Scalability: How much resources are spent globally on processing, bandwidth and storage for the system to process a single transaction and how many transactions can be reasonably processed under peak conditions.
(b) Isolatability: Can the divergent needs of multiple parties and applications be addressed to a near-optimal degree under the same framework?
(c) Developability: how well do the tools work? DO the APIs address the developers’ needs?
(d) Governance: Can the network remain flexible to evolve and adapt over time?
(e) Applicability: Does the technology actually address a burning need on its own?
Albeit a bit outdated, the need to further investigate scalability and isolatabilty of current blockchain networks within the crypto world definitely is present.
The “canonicalization” mechanism essentially is the key to how many transactions a blockchain network can process per second. The mechanism, which dictates the consensus architecture, is cointegrated with “state transition” i.e. essentially meaning that the blockchain needs to incorporate the current profile of a set of agents into the current state before it can be allowed to generate the next state [1]. This is true for public, permissionless blockchains i.e. Proof-of-Work or Proof-of-Stake. So to summarize, the public, permissionless blockchains which utlizie the consensus architecture require wide timing margins – in terms of the expected processing time which essentially limits such blockchain networks to roughly around 30 transactions per second. This is due to the coupling of the state-transition mechanism with the consensus architecture which essentially means that interests of multiple agents at different levels of the process are bundled together – leading to delays and wide safety margins in terms of expected processing times.
For consensus mechanisms that stray away from relying on competition (aka Proof-of-Work or Proof-of-Stake), may end up using validator nodes at the block level or transaction participants at the transactions level – to determine whether or not new transactions are valid [1].
Hence, one solution to achieve scalability is quite straightforward in this regard – decouple the consensus architecture from the state-transition mechanism. This is something Polkadot adopts as its solution to the problem of scalability.
One of the earlier solutions to the scalability problem came in terms of “Chain fibers” in June 2014 – which envisaged a single relay-chain and multiple homogeneous chains providing a transparent inter-chain execution mechanism – something Polkadot was inspired from and which would be discussed in detail later in the article.
Before jumping on to the relevance of a network like Polkadot in the medium/long term, it makes sense to zoom out a bit and look at how big of an issue scalability is in the current times while also examining the possible proposed solutions/current developments.
Reasons for existence of Bitcoin and Ethereum: Recap
The existence of Bitcoin as a peer-to-peer payments system without the involvement of any middleman only showcased one use-case (although probably the most feasible) for blockchain technology. The problem with Bitcoin (and most first generation blockchains) was that they essentially only allowed exchange or transfer of monetary value between two entities without allowing them to attach any particular constraints to the transaction. Having the option to transfer decentralized money via blockchain technology does give the individual a sense of ownership over his/her monetary asset but having the option to attach conditions to this transfer of wealth was something that could enable undertaking complex tasks using similar technology.
This is where smart contracts come in. Ethereum (ETH) with its Ethereum Virtual Machine (EVM) made it easy to create blockchain applications on its platform. The possibility of incorporating complex conditions within a smart contract enables creation of Decentralized Autonomous Organizations (DAO) i.e. fully autonomous decentralized organizations with no single leader which are essential to replace centralized structures within a traditional organization, hence eliminating the need for a centralized body governance.
Decentralized applications built on top of a blockchain network can vary quite a bit in terms of their individual use cases which adds to the complexity of incorporating them all within the same blockchain network. ERC-20 i.e. Ethereum Request for Comment 20 refers to a guide of rules and regulations (6 compulsory rules and 3 optional ones) that provide a blueprint for ETH based smart contracts to formulate their tokens such that they would be optimally designed to be deployed on the Ethereum blockchain.
Reading the data from the blockchain does not incur any cost but the computational process required to make any changes to the chain requires a user to submit a transaction. Users on the Ethereum blockchain submit a transaction request which is then undertaken by miners to mine and process the transaction on the proof of work (for the time being) Ethereum blockchain. The miners need to be incentivized to undertake a transaction and this is where Ethereum gas fees comes in.
The way to measure miner activity on Ethereum blockchain is via hash rate. Hash rate indicates the general level of processing power of the Ethereum network [2]
The Conundrum of Rising Gas Fees
Gas refers to the amount of computational power required and ether is the currency that is used to pay for that gas. A transaction sent to the Ethereum network costs some discrete amount of gas depending on how many EVM instructions need to be executed [4]
The sender can decide the maximum amount of gas (gas limit) they want to pay for their transaction to be processed. The miners on the other hand have the freedom to choose whichever transaction they want to process. Hence, the sender is essentially encouraged to pay a higher amount of gas fees to make sure that the miners do process their transaction. If the sender selects a gas limit that is too low for the transaction, then the miners will essentially stop executing the transaction the second the gas runs out and the transaction hence, is not completed. If the sender selects a gas limit that is way beyond what is actually required for the transaction, then the miner would essentially break down the initial transaction into multiple transactions and return as little gas back to the sender as possible, essentially maximizing his (i.e. the miner’s) profits. Hence, it is in the interest of the sender to only select a gas limit that is slightly above the suggested gas required for the transaction.
This is where the problem of scalability starts to come into the fray. The more congested the network, the higher is the gas required for a transaction to be processed and hence, making the network essentially impossible to use under certain these situations.
As shown in figure 2, the rise of DeFi in mid 2020s saw the average ETH gas price to rise above 600 gwei (unit for gas price).
Potential Solutions to the Gas Problem
Ethereum network is classified as a Layer 1 protocol. Pretty much all the layer 1 protocols suffer with the problem of scalability. This is where proposed Layer 2 protocols come in. Essentially, these protocols build on top of the Ethereum network with the aim of reducing gas fees while still maintaining the essential decentralization properties of Ethereum. Can read more about it here: https://ethereum.org/en/developers/docs/layer-2-scaling/#:~:text=Zero%20knowledge%20rollups%2C%20also%20known,is%20posted%20on%20layer%201
In terms of the solutions via changes to the Ethereum network, EIP 1559 (an Ethereum improvement proposal that should be implemented in July this year, read more here: https://medium.com/@TrustlessState/eip-1559-the-final-puzzle-piece-to-ethereums-monetary-policy-58802ab28a27) and the overall implementation of Ethereum 2.0 (essentially 1.5) are the ones that will have the most affect on the gas fees.
Recently, flashbots have had some significant effect on the reduction in gas fees. The Ethereum mempool is the place where all the pending transactions are placed awaiting to be processed. Certain arbitrage strategy bots identify profitable trades within the mempool, copy the trade and essentially put a higher gas limit to make sure their transaction ends up being processed faster than the original trade, hence profiting from it. This arbitrage bot strategy is known as Miner Extracted Value (MEV). To counter this, Flashbots, a research and development organization set up Flashbot Alpha which in a nutshell, bypasses the Ethereum mempool and avoids the leakage of trades via tipping the miners to undertake their transactions – hence also saving the gas fees for failed transactions. The flashbot hashrate has seen an uptick over the past month, partially due to the upcoming EIP-1559 and explains the recent fall in gas fees.
Case for Polkadot
Blockchain protocols usually tend to focus on single use cases only and its essentially hard to enable cross chain communication without making radical changes to the network. As these blockchains become more specific in terms of their individual use cases, it becomes more and more essential to enable cross-chain communication and exchange of information. This adds to the general problem of scalability for blockchain technology and hence, is a key problem that Polkadot aims to fix.
Polkadot is a next generation blockchain protocol that unites an entire network of purpose blockchains, hence, allowing them to operate seamlessly together at scale. This allows any type of data to be send between any type of blockchain – i.e. unlocking range of real world use cases [7]
Polka doesn’t believe that there ever will be one blockchain to rule them all.
Polkadot’s Approach towards Scalability Dilemma
The easiest way to breakdown Polkadot’s proposed solution to scalability via interoperability is via the following diagram provided in their lightpaper:
As mentioned in figure 5, “Polkadot unites a network of heterogeneous blockchain shards called parachains. These chains connect to and are secured by the Polkadot Relay Chain. They can also connect with external networks via bridges.”
Its essential we break-down the above paragraph into some detail to fully understand what it means.
Heterogeneous chain systems are side-chains that essentially allow trustless interaction between the main chain (say Bitcoin) and additional “side-chains”. The proposed interaction under such a system are essentially limited to allow side-chains to be custodians of each other’s assets – pretty much a two-way peg. Polkadot is a scalable heterogeneous multi-chain meaning Polkadot inherently has no application functionality at all its basically a base (“relay-chain”) over which multiple validatable, data-structures would be hosted side-by-side hence Polkadot is a sharded blockchain. These data-structures are known as “parallelised” chains or parachains. There is no specific need for them to be blockchain in nature.
This is where the scalability solution provided by Polkadot is quite apparent. A problem deployed on Polkadot may be scaled out over a large number of parachains – hence in theory mitigating the problem of network scalability, albeit to some extent [8].
Nested relay chains – which will increase the number of shards that can be added to the network, will further contribute to the scalability of the network [7]
Parachains are like various network devices, and the slot of the Polkadot Relay Chain is like a router’s network port. When the device is connected to the router’s network port, it can interact with other routers efficiently. At the same time, this router can also provide network security protection for the connected devices [9]
These para-chains can in essence have their own tokens and optimize their functionality for specific use cases while using the relay-chain as the base for all of this development. At this stage, parallels to Ethereum pop up but the difference is quite clear, Ethereum only allows those dapps to develop on its blockchain which follow the ERC-20 guidelines while Polkadot essentially provides strong guarantees over security, isolation and communication to Parachains while leaving rest of the properties for the individual blockchains to decide on their own – hence offering them more flexibility in that regard.
Nominated Proof-of-Stake (NPoS)
Polkadot uses Nominated Proof-of-Stake (NPoS), as its mechanism for selecting the validators. This is understood better once we understand the participants of the Polkadot network.The maintainance of the Polkadot network involves four participants:
A validator is the highest charge and helps seal new blocks on the Polkadot network. Essentially a validator stakes DOT (Polkadot’s native currency) to secure the relay chain. They must run a relay-chain client implementation over which at each block they have to be ready to accept the role of ratifying a new block on a nominated parachain, where they have to receive, validate and republish a randomly received candidate block.
A validator is expected to nominate a “collator”, a third-party to help devise new parachain blocks. Hence, these guys help produce proofs for validators after collecting shard transactions from users.
Once all the new parachain blocks have been validated and ratified, the validators will then ratify the relay-chain. This basically involves changing the state of the transaction queues (essentially moving the data from a parachain’s output queue to another parachain’s input queue), processing the transactions of the ratified relay-chain transaction set and ratifying the final block, including the final parachain changes [7]
Any slacking validators are punished – initially for unintentional failures via withholding the validator’s reward then for repeated failures – reduction of their security bond (i.e. the initial DOT they staked is reduced via burning). If they conspire against the protocol, the validors lose all of their security bond (partially burnt and rest of it is given the informant).
Nominators essentially is an entity which contributes to the security bond of a validator. Their main role is to place risk capital (i.e. is a stake holding party) and hence, signal trust in a validator.
Fishermen are pretty much the bounty hunters of the system that are incentivized by a one-off reward. Their main job is to look out for any of the bonded party that is acting illegally.
Its actually relatively easy to become a validator on Polkadot. Just setting up a validator node essentially declares your intention to be a validator but this does not mean that any new validator will get opportunities to do the validator duties (i.e. be part of the so-called active set). This is determined via an election algorithm known as Phragmen’s method which aims to elect validators based on their own self-stake and the stake that is voted to them from nominators. The aim is to maximize the total amount of stake, the stake behind the minimally staked validator and minimize the variance of the stake in the set. All of this is done off-chain such that to prevent lock block times at the end of each era when new validators need to be appointed [11]
Validators are rewarded based on the inflation of the relay chain, transaction fees, and tips (taking a percentage of the former two). Polkadot aims to have 1000 validators in total.
In terms of the interchain communication on the Polkadot sharded blockchain, its pretty simple: transactions executing in a parachain are (according to the logic of that chain) able to effect the dispatch of a transaction into a second parachain or potentially the relay-chain. To ensure minimal implementation complexity, these interchain transactions are effectively indistinguishable from standard externally signed transactions. Interchain transactions do not have any fees associated with them – which is unlike what we have on BTC and ETH [8].
This explains the existence and inter-communication of different parachains on the relay-chain of Polkadot but how does this link to external blockchains such as the bitcoin or Ethereum blockchain? – this is where “Bridges” come into the equation. Bridges are special blockchains that allow Polkadot shards to connect to and communicate with external networks like ETH and BTC.
DOT Token
In terms of managing chain upgrades – Polkadot depends on a typical governance structure. This is where the DOT token comes in. The DOT token has three main roles: governance, staking and bonding. These are further explained in the below figure. Council members are elected to represent passive stakeholders in two key roles: (a) propose referenda and (b) Veto dangerous referenda. Technical committee includes teams that are actively building on Polkadot.
Transaction Fee Mechanism
To determine the transaction fee for each transaction over Polkadot, a weight-based model is used (as opposed to a gas-metering model) which includes:
(a) Length fee: is a product of per-byte fee and the size of the transaction in bytes
(b) A weight fee: fixed number designed to manage the time it takes to validate a block
(c) A tip (optional): to give the transaction a higher priority
A portion of the fee will go to the block producer and remainder will go to treasury (20% and 80% respectively). The funds in the treasury can be spent via making a spending proposal approved by the council. Do note that shard transactions i.e. transactions that occur within Polkadot’s shards do not incur Relay Chain transaction fees (do not even need to hold DOT!) [12]
Kusama
Kusama is an early, unaudited and unrefined release of Polkadot created to essentially test the network’s technical and economic incentives in a real-world environment. Place for parachain developers to test ideas before deploying to polkadot (check out Rococo). Kusama is owned and governed by a community of supporters who hold KSM tokens. No central kill switch - will live on as an independent community network.
Roadmap So Far..
1. PoA Launch: May 26, 2020 saw the launch of the genesis block of Polkadot network as a Proof of Authority (PoA) network (i.e. validators staking their reputation and not coins per se)
2. Switch to Nominated Proof-of-Stake on June 18, 2020
3. Governance: enabled Council, a technical committee and public referenda
4. Removal of Sudo: Sodu module removed on July 20, 2020. Hence, full transition of governance to the token holders.
5. Balance Transfers: Removal of restriction on balance transfers on August 18, 2020.
6. Redenomination: August 21, 2020 saw redenomination of DOT i.e. one DOT (old) equals 100 new DOT.
7. Core Functionality: start of the next stage which includes parachain slot auctions, parathreads and cross-chain message passing.
8. Polkadot 2.0: next version of Polkadot network TBA.
Polkadot Parachain Slot Auction Mechanism
The number of parachains that can be carried by a relay-chain is limited and hence, a mechanism has to exist to ensure equitable distribution of parachain slots: hence the Polkadot Parachain Slot Auction Mechanism. The following is the summary of the main rules for the auction:
(a) Slots are only for lease and not for sale (each slot divided into 4 lease periods and each lease period is 6 months).
(b) Candle Auction + Random Parameters: i.e. highest bidder is considered the winner.
(c) Crowdloans: Anyone can essentially create a crowdload campaign for a parachain slot to attact outsiders (DOT holders) to lock up their DOT for the project’s bid.
For more details on the auction mechanism, refer to this really good article: https://medium.com/crustnetwork/crust-network-explaining-the-polkadot-parachain-slot-auction-mechanism-533381d42607
Current State of the network
Currently there are 421 projects on Polkadot out of which 138 are substrate based (a framework for creating blockchains).
Conclusion
In essence, Polkadot aims to solve three key problems being faced by the layer 1 solutions:
(a) Interoperability: i.e. enabling communication between different blockchains.
(b) Scalability: Removing congestion from the network and hence speeding up the transactions while reducing fees.
(c) Shared Security: Providing pooled security within the network.
The proposed solution to the above problems along with the current implementation/development on the Polkadot network provides good fundamental backing to its claims of essentially being central link to multiple blockchains, which if attained, would contribute massively to the real-life implementation of the blockchain technology.
References
[1] J. Shorish, "Blockchain State Machine Representation," JEL, 2018.
[2] M. Beedham, "thenextweb," 5 August 2019. [Online]. Available: https://thenextweb.com/news/ugh-this-is-what-bitcoins-hash-rate-means-and-why-it-matters. [Accessed 15 April 2021].
[3] Etherscan, "Etherscan," [Online]. Available: https://etherscan.io/chart/hashrate.
[4] A. Rosic, "blockgeeks," [Online]. Available: https://blockgeeks.com/guides/ethereum-gas/. [Accessed 15 April 2021].
[5] "ycharts," [Online]. Available: https://ycharts.com/indicators/ethereum_average_gas_price.
[6] "github," [Online]. Available: https://github.com/flashbots/pm#mev-roast-recordings.
[7] Web3 Foundation, "Polkadot," April 2020. [Online]. Available: https://polkadot.network/Polkadot-lightpaper.pdf. [Accessed 16 April 2021].
[8] G. Wood, "Polkadot: Vision For a Heterogeneous Multi-Chain Framework - Draft 1," Polkadot.
[9] Crust Network, "Medium," 18 March 2021. [Online]. Available: https://medium.com/crustnetwork/crust-network-explaining-the-polkadot-parachain-slot-auction-mechanism-533381d42607. [Accessed 16 April 2021].
[10] Polkadot, "Polkadot," [Online]. Available: https://wiki.polkadot.network/docs/en/learn-parachains#:~:text=Polkadot%20supports%20a%20limited%20number,estimated%20to%20be%20about%20100.. [Accessed 16 April 2021].
[11] Polkadot, "Polkadot," [Online]. Available: https://wiki.polkadot.network/docs/en/learn-phragmen. [Accessed 16 April 2021].
[12] Polkadot, "Polkadot," [Online]. Available: https://wiki.polkadot.network/docs/en/learn-transaction-fees. [Accessed 16 April 2021].
[13] Polkaproject, "Polkaproject Index," [Online]. Available: https://www.polkaproject.com/#/. [Accessed 16 April 2021].