The relay chain in Polkadot

Fausto Castellano
Coinmonks
4 min readMay 4, 2024

--

In the last article, we discussed Polkadot, noting that while it is a complex blockchain, it features a simple technical architecture consisting of only two parts: the Relay Chain and Parachains.

The relay chain is basically the central Hub all parachains connect to.

National Oceanic and Atmospheric Administration. (2021, January). 2020 was Earth’s 2nd-hottest year, just behind 2016.https://www.noaa.gov/news/2020-was-earth-s-2nd-hottest-year- just-behind-2016. Accessed: 2021–08–31.

“To illustrate the function of the relay chain, imagine a central hub surrounded by spokes, each connecting to various other hubs. These spokes can take on diverse forms and serve different purposes, as long as they adhere to the same guidelines as the central hub.

The functions of the Relay Chain are:
- Providing shared security
- Enabling interoperability between all the parachains

To ensure its security, Polkadot employs a hybrid consensus mechanism. This mechanism is essential for achieving other goals as well, such as:
- Resistance to bad actors, ensuring that only a few good actors are needed to preserve the integrity of the chain.
- Speed of transaction inclusion and verification for scalability.
- Network resilience, minimizing downtime.
- Higher degree of decentralization, preventing any group of network participants from having full control over the network.

The relay chain gains its security from various components:”

  1. validators
  2. nominators
  3. collators.

Decentralized networks achieve collaboration among many individuals by utilizing consensus to design a system where roles, responsibilities, and incentives align the actions of all network participants. This is why tokens are necessary for decentralized systems; economic rewards serve as the ultimate incentive mechanism.

In a proof-of-stake system, in addition to nodes, the network requires users who will stake a certain amount to secure the network.

The security of a proof-of-work blockchain relies solely on the number of nodes securing it, whereas the security of a proof-of-stake blockchain depends on both the number of nodes and the value of their stake, where stake represents its economic value.

Validators

Validators in Polkadot (like miners in Bitcoin) run nodes that process and verify transactions, create blocks, and store the history of the blockchain. They provide the infrastructure and ensure that the network is always online. For their efforts, economic and physical, validators are rewarded in DOT tokens.

Number of Validators can change during years, the goal of Polkadot is to reach 1000 validators.

Nominators

Nominators in Polkadot are not directly involved in the technical operation of the network. Their primary role is to select validators to whom they wish to “lock” their tokens.

Due to the significant bond required to become a validator (currently set at 1.4 million DOTs), validators must earn ongoing support from nominators in order to qualify for their role. When validators receive rewards, a portion of those rewards is distributed to their nominators, with the exact amount determined by the total number of tokens staked and the commission percentage set by the validator.

Polkadot employs an advanced mechanism that allows each nominator to choose up to 16 validators. However, only a few validators will be admitted into the active set during each era (roughly a day on Polkadot). By selecting 16 validators, nominators increase their chances of maximizing rewards. This is because the relay chain on which tokens are staked utilizes a protocol designed to optimize the staking process for all nominators and validators, ensuring maximum security.

The protocol maximizes a nominator’s participation in consensus by selecting at least one of the nominator’s validators for every era. An era is a measure of time in blockchains, similar to human days, denoted by the number of blocks produced: 6 hours on Kusama and 24 hours on Polkadot. When a nominator chooses 16 validators, this mechanism guarantees that at least one of those sixteen will be included in the active set.

Collators

While validators create and confirm blocks for the relay chain, the collators create and confirm blocks for the parachains. Keep in mind that the same mechanisms (BABE and GRANDPA) are at play on parachains. You can think of collators as parachain validators, because they have to run a full node of the parachain as well as the relay chain. When Collators on a parachain agree on new parachain blocks, they forward these blocks to relay chain validators for inclusion into the relay chain. This way, verified transaction blocks submitted by collators are further verified by validators and added to the relay chain; with relay chain validators assigned to parachains at random.

For example, in the first era, which lasts x number of blocks, validators V1, V2, and V3 are assigned to parachain A. This means that the collators of parachain A will forward their transactions to V1, V2, and V3, leaving all the other validators free to verify transactions from other parachains. When these validators are done verifying, they propose their verified transactions to the rest of the validators on the relay chain for further verification before the transactions are added to the relay chain. Remember that most of this is fairly automatic. The validators don’t know beforehand on which parachain they will be working. At the end of the era, validators V1, V2, and V3 will be rotated away from parachain A, so that a new set of validators will be verifying transactions on parachain A for the duration of the second era.

This process strengthens network security by minimizing and containing the risk of collusion between collators and validators. For example, if there was an attack during an era, this attack would be countered by honest validators at the beginning of the following era.

--

--