Polkadot ($DOT)
Polkadot ($DOT)

Polkadot ($DOT)

 
ARTICLES
VIDEOS
TWITTER THREADS
LINKS

WHAT IS IT

Polkadot is a network protocol that allows arbitrary data—not just tokens—to be transferred across blockchains. In its simplest form, Polkadot is a protocol that connects blockchains, allowing value and data to be sent across and to interact with one another, with shared security and interoperability. They aim to fix this previously problem of incompatible networks (Bitcoin and Ethereum, for example). Polkadot plans to be the first Layer-0 solution, the chain to connect all other blockchains. They see themselves as a “Building block of the new web hoping to enable human beings, businesses, enterprises, and government to use private and secure applications that don’t rely on trusting a third party.” Polkadot hopes to enable a completely decentralized web where users are in control.
 
Polkadot is built to connect chains, public and permissionless networks, oracles, and dApps Polkadot facilitates an internet where independent blockchains can exchange information and transactions in a trustless way via the Polkadot relay chain. Created by Gavin Wood, former Co-Founder and CTO of Ethereum, and creator of solidity the programming language used by ETH.

HOW DOES IT WORK?

The Polkadot blockchain is composed of a few major parts. First, we have the Relay Chain, which is the core layer. This is “responsible for the network’s shared security, consensus, and cross-chain interoperability.” Then we have the Parachains, these are custom, project-specific blockchains that are integrated within the Polkadot (DOT). Lastly, Polkadot uses bridges to connect the Polkadot Ecosystem with External Networks.
The way Gavin Woods sees this and is easy to explain this relationship is like an Office. The employees in an office each have their own specific Jobs that they need to do by themselves, but every so often they come together and Sync up/coordinate their work with meetings or phone calls, etc.
Employees = Parachains Meeting/Syncing up = Relay Chain

RELAY CHAIN

The Relay Chain is the main Polkadot blockchain, this network is where transactions are finalized. It is composed of only a small number of transaction types. These transaction types include ways to interact with governance, Parachain auctions, and staking of the (DOT) coin for validators. Smart contracts are not supported on Relay Chain.
The simplistic design is deliberate, as the main function is to coordinate the system as a whole, including Parachains. All validators of Polkadot are staked on the Relay Chain in DOT and validate for the Relay Chain. Other specific work is delegated to the parachains, which have different implementations and features.
 
The Relay Chain uses a variation on proof-of-stake (PoS) consensus called nominated-proof-of-stake (NPoS).
This system allows anyone who stakes DOT by locking their $DOT tokens in a special contract to perform one or more of the following roles:
  • Validators – Validate data in parachain blocks. They also participate in consensus and vote on proposed changes to the network.
  • Nominators – Secure the Relay Chain by selecting trustworthy validators. Nominators delegate their staked DOT tokens to validators and thus allocate their votes to them.
  • Collators – Nodes run that store a full history for each parachain and aggregate parachain transaction data into blocks for addition to the Relay Chain.
  • Fishermen – Monitor the Polkadot network and report bad behavior to validators.
 

PARACHAINS

A parachain is basically a parallel blockchain. Since the relay chain has a simple design, and smart contracts and other processes will take not take place on it, that responsibility falls onto the Parachains. Parachains are custom blockchains that use the relay chain’s computing resources to confirm that transactions are accurate, and they share the same security as the Relay Chain.
 
Among Parachains there are two types (Parachains & Parathreads). Parachains have a dedicated slot for their chain and are like a process that runs constantly. Parathreads on the other hand share slots amongst a group, that require less computing power. There is no limit to what Parachains can be used for. Some parachains may be specific to a particular application. or tailor to specific features like (smart contracts, privacy, or scalability).
Creating a parachain can be seen as creating a Layer-1 blockchain, which runs in parallel within the Polkadot ecosystem. Slots are limited, only (100) slots are available and are obtained by auction. By (winning the auction) you are leasing the slot on the Relay Chain for up to 96 weeks at a time, with the option to renew.
 
notion image
 

BRIDGES

Allow parachains and parathreads to connect and communicate with external networks like Ethereum and Bitcoin. A blockchain bridge is a connection that allows the transfer of tokens and/or arbitrary data from one blockchain network to another. Both chains can have different protocols, rules, communities, and governance models, but a bridge provides a compatible way to interoperate securely on both sides.

SUBSTRATE

Substrate is a fully modular software development kit (SDK) for Blockchains. It allows you to build a blockchain from previously built components. You can easily find examples of DeFi, Smart Contracts, IoT or Gaming projects, and use them or you can start from scratch. It also allows you to create specialized blockchains for any use case. You do not have to build smart contracts, but you can if you want.
 
Unlike building on Eth, once you create smart contracts, there is no way to edit them or go back on them. You can’t change them. With substrate, you can modify them whenever you want with the on-chain upgrade mechanism.
 
Substrate makes it easier and quicker for developers to test new blockchain ideas for sharding, encryption, and governance. Substrate is written in Rust, which is quite similar to JavaScript. Making the onramp for developers easy because even if you only know Java, you can quickly transition and understand Rust.
 
All Substrate-based chains are seamlessly compatible with Polkadot, granting access to a rich, interoperable ecosystem of parachains, applications, and resources. Offers greater freedom, flexibility, and optimization than building on top of a general-purpose smart-contract blockchain.
 

FORKLESS UPGRADES

WebAssembly (WASM) is used in Polkadot and Substrate as the compilation target for the runtime. The runtime contains the business logic of the chain. It defines what transactions are valid and invalid and determines how the chain's state changes in response to transactions. WASM was designed to provide highly optimized computation on the web.
 
By using Wasm in Substrate the chains are given the ability to upgrade their runtime logic without hard forking. Hard forking is a standard method of upgrading a blockchain that is slow, inefficient, and error-prone. Polkadot combined with Substrate & Wasm will not have this issue as they can upgrade existing technology.
 

NODES UPDATING AUTOMATICALLY

Substrate has a unique property that allows the network to automatically upgrade. The “Runtime” is stored within the blockchain state, which means nodes can update themselves. Compared to the “legacy approach”, which coordinates all node operators to deploy new code. Leading to hard forks, divided networks, and even split communities.
Since coordinating node operators isn't necessary, upgrades can be more frequent with fewer issues. Forkless runtime upgrades enable developers to innovate and move forward faster.

LIGHT CLIENT

Another unique attribute of Substrate is its “light-client-first” design which can run directly in-browser and interact with a chain in a fully trustless way. Traditional approaches for syncing nodes require users to run dedicated hardware and wait a long time for their node to sync, or as a workaround, use a centralized service provider. Substrate light-clients sync lightning-fast and drastically increase the decentralization of blockchain networks. Developers can relax, knowing their end-users aren’t reliant on a separate node infrastructure susceptible to downtime or hacking.
 

XCMP - CROSS-CHAIN MESSAGE PASSING

XCMP is Polkadot’s cross-chain message-passing protocol. It allows one parachain to send messages to another parachain and provides guarantees about the delivery of these messages, as long as they have established messaging channels with each other.
 
The XCMP protocol uses a simple queuing mechanism based on Merkle trees to ensure the accuracy of cross-chain information. The relay chain validator needs to move the transaction on the output queue of a parachain to the input queue of the destination parachain.
 
notion image
 

HYBRID CONSENSUS: GRANDPA + BABE

“Classical consensus algorithms provide two main properties: safety and liveness. Safety is the property that ensures honest participants don’t agree on two conflicting things (blocks, in this case). Liveness is the property that ensures something is eventually agreed upon by honest participants.
In the context of blockchains, safety is the same thing as finality. That is, once a block is finalized, the canonical chain will always contain that block in the future. In blockchains, liveness means that the chain keeps growing and, furthermore, those valid transactions will eventually be included and finalized.”
 
Polkadot uses a hybrid consensus model that separates block production from finality on those blocks. GRANDPA is used as a Finality gadget, which is separated from block production BABE. This results in two main benefits:
 
1. The ability to always produce new blocks, and
2. Having a universal agreement on the chain voted with no chance for reversion.
It also avoids the negatives of each mechanism.
 
1. The chance of unknowingly following the wrong fork in probabilistic finality, and
2. The chance for "stalling" - not being able to produce new blocks - in provable finality).
 
By combining these two mechanisms, (Grandpa & Babe) Polkadot allows for blocks to be rapidly produced, and the slower finality mechanism to run in a separate process to finalize blocks without risking slower transaction processing or stalling.
 
💡
Polkadot invented GRANDPA (GHOST-based Recursive Ancestor Deriving Prefix Agreement), a finality gadget that provides the following.
💡
BABE (Blind Assignment for Blockchain Extension) is the block production mechanism that runs between the validator nodes and determines the authors of new blocks.
notion image
 
Here is a simplified explanation For GRANDPA: rather than voting on a single block, it allows participants to vote on the highest block they think is valid, and the algorithm applies the vote to all ancestors of that block.
 
The algorithm determines the best block which has a >⅔ supermajority amount of votes and produces a proof-of-finality. The proof-of-finality is constructed by taking the supermajority votes and bundling them up together into a single message. Signature aggregation can be used to make this smaller. Diagram Below:
  • Node 1 is voting on D1 (the best chain he sees, but he hasn't seen those other chains)
  • Node 2 thinks F1 is the best chain
  • Node 3 things E2 is the best chain
    These are all nodes that have different views of what the best block is, but the interesting thing is they all have a common ancestor of C - this allows Grandpa to finalize it.
     
    If the block would be reverted - we could figure out who had misbehaved (would require 1/3 of misbehavior) and slash those people.
     
    notion image
     
    Because of this strategy of finding the highest common ancestor which a supermajority considers valid, GRANDPA is also adaptive: it can finalize a new block regardless of how many blocks have passed since the last block was finalized. 
     
    If network latencies are low, GRANDPA can finalize blocks almost instantly, and when recovering from a long network partition, GRANDPA can finalize millions of blocks at once without any message overhead.
    notion image
     
    BABE is a block production engine that has Primary and Secondary block production. The way BABE works is it’s a slot-based algorithm. It breaks time into epochs, with each epoch being broken into slots, each slot is six seconds long (Polkadot’s target block time).
     
    notion image
     
    In the Primary” Validators” will (draw a random number) - if it falls below a certain threshold, the validator who pulled that number will do the next block.
     
    If no validator pulls a random number that falls below the threshold it'll fall back to the Secondary block production (which is a round-robin for validators)
     
    Forks are created when blocks are produced in the same slot
    • EX: Slot 3 → (2 Primary blocks were created because two validators pulled random numbers that fell below the threshold) ie → the numbers 1/2 in this diagram. Along with the criteria for “GRANDPA” on the right to gauge finality.
     
    notion image
    An example of BABE’s fork choice rule for choosing the best chain.

    PRIMARY SLOT LEADERS

    Primary leadership is granted based on the evaluation of a verifiable random function (VRF). VRFs generate a pseudo-random number along with proof that it was properly generated. Each author evaluates its VRF for each slot in an epoch. For each slot whose output is below some agreed-upon threshold, the validator has the right to author a block in that slot. Because of the random slot assignment process, it’s possible to have slots without a primary as well as slots with multiple primaries.
     
    notion image

    SECONDARY SLOT LEADERS

    To deal with empty slots, BABE uses a round-robin fallback. Every slot has a secondary leader. If nobody claims that they are the primary at the beginning of the slot, then the secondary will author a block. This fallback will make sure that every slot has a block author and helps to guarantee a consistent block time.

    BABE &GRANDPA TOGETHER

    Up to now, we have GRANDPA finalizing chains and BABE creating new blocks. Some of BABE’s chains may have forks since a single slot can have multiple leaders.
     
    The first rule of choosing the best chain to extend is simple: BABE must build on a chain that has been finalized by GRANDPA. This is one of the requirements to use GRANDPA.
     
    A second, more subtle, requirement for using GRANDPA is that the block production algorithm must have a way of choosing the “best” chain. This property leads to BABE having probabilistic finality (thus, you could use it without GRANDPA).
     
    The best chain in BABE is simply the one with the most blocks authored by primaries. Forks are common in BABE, because the author just has to broadcast its block to everyone but does not need everyone to send a message to everyone (like in GRANDPA). So, not everyone will have the same view of the non-finalized chain (yellow blocks in the image).
     
    This system lets us produce blocks in an efficient way and lets GRANDPA finalize a set of them.
     
     

    TEAM

    Run by web3 foundation and developed by parity technologies, both of which Gavin Woods is a co-founder.
     

    TOKENOMICS

    All the $DOT or $KSM used to secure parachain slots will be locked up for 6–48 weeks until the lease expires. And then that slot will be up for grabs again, and DOT/KSM tokens will be locked up again. Both
    • Total supply: 10,000,000 DOTs
    • Inflation: is designed to be 10% in the first year, and the ideal staking ratio is set at 50%, meaning half of all tokens should be locked in staking. In other words, if 50% of all tokens are staked, then 100% of the inflation goes to the validators as a reward. If the staking rate is greater than or less than 50%, then the validators will receive less, with the remainder going to the Treasury.
    notion image
     
    Built with Potion.so