What is Polkadot? An Architectural masterpiece
There are very few words in the English language accurate enough, and strong enough, to describe the scope of what Polkadot is trying to accomplish.
Polkadot aims to solve blockchain’s “Tower of Babel” problem: hundreds of blockchains coexist, and very often compete with each other. Very rarely do they talk to each other – very rarely do they understand each other.
Decentralized Finance (DeFi) offers a spectacular illustration of what happens when blockchains speak to and understand each other; when they interact with one another. Two defining characteristics of DeFi, Interoperability (the capacity of protocols and platforms to readily communicate with one another) and Composability (the possibility for users to combine protocols and create new products or applications in a permissionless manner) give a sense of what is possible when, under the right technical conditions, this happens.
Imagine if Interoperability and composability were universal. If every chain was in a position, technically speaking, to speak to all other chains and interact with them – in ways we have yet to imagine.
Perhaps Polkadot is the platform that will make this possible.
An Architectural masterpiece
Polkadot can be best understood as a Network of Networks, as a blockchain on top of which user-created, autonomous blockchains can be built and launched, and which can connect to blockchains via bridges. Any type of arbitrary data – not just tokens – can be transferred across those blockchains.
Any type of arbitrary data – not just tokens – can be transferred across those blockchains.
There is obviously a lot to unpack in the previous sentence. Let us take the time to revisit the previous sentence, moment by moment.
Polkadot is primarily a Network of Networks, to which all other networks plug into. The base layer of this Network of Networks is called the Relay Chain. The Relay Chain is where all transactions are finalized. To achieve greater speed, the Relay Chain separates the addition of new transactions and the act of validating those same transactions. This model allows Polkadot to process over one thousand transactions per second.
In order to separate the addition of new transactions and the act of validating those same transactions, the Relay Chain leverages the (wait for it) GRANDPA (GHOST-based recursive Ancestor Deriving Prefix Agreement) Consensus Mechanism. Separating those two processes allows the Relay Chain to validate transactions almost instantly.
Parachains & Parathreads
The aforementioned autonomous, user-created blockchains built on top of the Relay Chain are called Parachains. These Parachains use the Relay Chain’s computing power to ensure that their transactions are valid. All user-created chains are built using a software framework called Substrate – which is the same technology used to create the Polkadot’s Relay Chain. Parachains can be specialized, they can have their own tokens, and they can be customized for any use.
Certain Parachains, which do not require constant connectivity to the relay chain, use a “Pay-As-you-Go” model. For the sake of clarity, these parachains are called: Parathreads.
And finally, while the documentation does not refer to them as such, we should call the blockchain networks which connect to Polkadot via Bridges: “external chains”.
Short summary so far
Let us recall what we have learned so far.
Polkadot is first and foremost a Network of Networks, on top of which Parachains (or Parathreads, which are Parachains with limited connectivity) can be built and launched, and which has the ability to connect to External Chains via bridges.
The Relay Chain, Parachains and Parathreads all share Security and State. This is important: concretely, this means that if one parachain has a message reverted, it is reverted across all blockchains. The change is broadcast across all chains so that the entire apparatus of chains stand within the same “informational present”.
Polkadot enables radical Interoperability and composability – regardless of the features (permissioned, non-permissioned, public, private) of the parachains/parathreads and external chains that it is composed of. Interoperability allows blockchains to interact via the Relay Chain, or directly with one another, by transferring arbitrary messages, not just tokens.
Can any Blockchain Connect to Polkadot?
Any chain can connect to Polkadot – if it matches two criteria:
- The chain must have the ability to form compact and fast light-client proofs over the finality and validity of its blocks and state change information.
- There must be a means by which a large set of independent authorities can authorise a transaction.
Bitcoin and Bitcoin-like blockchains do not have these characteristics. Does this mean that the Bitcoin network is barred from connecting to Polkadot? Not so fast!
It would still be possible, however a significant amount of coordination would be required to achieve this. To address the first criteria, Polkadot validators can run a bitcoin full-node. To address the second criteria, a soft-fork allowing extra-protocol controls over funds would be needed.
The Ethereum Network, on the other hand, conforms to these characteristics, especially after the Metropolis protocol upgrade. Private Proof of Authority chains also conform to these characteristics.
Nominated Proof of Stake (NPoS)
Polkadot’s consensus mechanism is called Nominated proof of Stake (NPoS). NPoS, which runs on the Relay Chain, keeps the entire network in agreement about the “State” or “Informational present” of the system.
Nominated Proof of Stake allows anyone who stakes DOT, Polkadot’s native currency, to perform one or more of the following roles:
- Validators: they validate data in Parachain blocks. They participate in consensus and vote on proposed changes to the network. The Relay Chain obviously has its own set of validators. What is surprising is that Parachain/parathreads have the option of having their own set of validators to verify their transactions. They can also use Polkadot’s pooled security to verify their transactions via the Relay Chain. In this regard, Polkadot offers tremendous flexibility to Parachains.
- Nominators: they secure the relay Chain by nominating trustworthy validators. Nominators delegate their staked DOT tokens to validators and allocate their votes to them.
- Collators: they store a full history for each parachain and aggregate parachain transaction data into blocks for addition to the relay Chain. They also send proofs of transactions to the Validators.
- Fishermen: they monitor the Polkadot Network and report bad behavior to validators. Only collators and full node parachains can perform the fisherman role.
The Polkadot Stack
Polkadot’s Relay Chain, which we alluded to above, is built using Substrate, a blockchain building framework made available by Parity Technologies.
Polkadot’s networking uses libp2p, a flexible, cross-platform network framework for peer to peer applications. Positioned to be the standard for future decentralized applications, libp2p handles the peer discovery and communication in the Polkadot ecosystem.
The Polkadot runtime environment is coded in Rust, C++ and Goland, making Polkadot appealing and accessible to a wide range of developers.
Interactions on parachains are processed in parallel, making them highly scalable.
What is truly fascinating here and opens the door to a vast amount of innovation, is the fact that innovations on one chain can be leveraged on other chains. Innovations on a particular chain can be shared across all chains.
Substrate: a Blockchain building framework
Substrate, which we mentioned above, is a plug and play, customizable framework for building blockchains. The Polkadot Relay Chain is built using this technology. What is interesting here, is that blockchains built using Substrate are immediately compatible with Polkadot. Even before Polkadot’s main net was launched, projects started building blockchains using Substrate, knowing they would be able to directly plug in their chain to the Relay Chain once the Main Net was launched!
Substrate gives developers the ability to upgrade their blockchain without a hard fork. A blockchain built using Substrate possesses a Runtime (the environment and data structures that keep track of everything that’s going on within Polkadot) that is a WASM binary stored on-chain. This Runtime can be updated using a chain’s governance mechanism. Developers can update their applications at their own pace without worrying about causing a hard fork.
Once a chain is built and deployed, and connected to the Relay Chain, it is possible to pass arbitrary values to other chains. All chains built using this framework are byzantine fault-tolerant by default and benefit from the security of the Main Chain.
Developers love Substrate since any language that can be compiled into Web Assembly (WASM), such as Rust, C/C++, C#, Go, etc) can be used.