Polygon : An Introduction & Overview

Deepti Nagarkar
deeblueangel
Published in
4 min readMay 6, 2022

This article is a introduction to Polygon, which is an upcoming and popular Ethereum Sidechain.

What is Polygon ?

Polygon is a de-centralized Ethereum scaling platform that enables developers to build scalable user-friendly dApps with low transaction fees without ever sacrificing on security. It is a Layer-2 blockchain application platform that provides hybrid Proof-of-Stake(PoS) and Plasma-enabled sidechains with full EVM and validation. It is an Ethereum-sidechain.

What are Sidechains ?

A sidechain is a separate blockchain which runs in parallel to Ethereum Mainnet and operates independently with own consensus mechanism. It is connected to Mainnet via two-way bridge to ensure syncing. Polygon uses Proof of Stake Consensus Mechanism

Polygon : Components & Architecture

Polygon has a three Layer Architecture –

Smart Contracts on Ethereum Layer

  • Staking management for PoS Layer
  • Delegation to Validator Nodes
  • Plasma Contracts with Checkpoints of sidechain state

Heimdall (PoS) Layer

  • PoS Validator node that validates since last checkpoint
  • Tendermint Consensus Engine
  • Block Producer Selection & Publish Merkle Tree for Aggregated Blocks

Bor (Block Producer Layer)

  • Entity responsible for aggregating transactions into blocks.
  • Basic Geth Implementation with selection based on number of tokens (stake)

Deployment

Polygon Nodes can be run using Ansible or direct binaries. There are essentially two types of Participating Nodes -

  • Validator Node — Verifies Txns. Stakes tokens and run validation nodes, earn staking nodes and subject to penalties for prohibited activites like double signing,downtime
  • Delegator Node — Token holders that stake with validators and earn rewards in exchange. Responsible for choosing validators.

Polygon-Ethereum Communication

Polygon is an Ethereum-sidechain and supports arbitrary state changes. These changes are routinely synced to the Ethereum Network. The mechanism for this syncing is as below —

State Transfer — State Sync is the native mechanism to read Ethereum data

Receiving —

  • StateSender Contract on Ethereum emits an event which is monitored by Polygon Contracts and this triggers StateSync Event
  • Validators on Heimdall layer pass the StateSynced Event to Bor Layer

Sending —

  • Receiver contract inherits IStateReceiver, and custom logic is implemented in onStateReceive function.
  • Polygon validators submit a hash of all transactions on Polygon chain to Ethereum chain. This Checkpoint can be used to verify any transaction that happened on Polygon.

The above two mechanisms ensure a 2-way state transfer between Polygon and Ethereum.

Polygon-Ethereum Bridge

Polygon provides trustless two-way transaction channel to Ethereum. A bridge is basically a set of contracts that help in moving assets from the root chain to the child chain. There are primarily two bridges to move assets between Ethereum and Polygon -

•Proof of Stake (PoS) BridgeMapping of Root and Child Tokesn with PoS security and faster exit with one checkpoint interval

•Plasma Bridge- Exit mechanism provides added security with 7-day withdrawal period

Both mechanisms support ERC20 and ERC721 and are part of the Scaling Solution which is instant, low-cost and flexible. There is 1:1 correspondence of tokens transferred between Polygon and Ethereum. Number of circulating tokens remains same

  • tokens that leave ethereum network are locked and the same number of tokens are minted on Polygon as a pegged token (1:1).
  • To move the tokens back to the ethereum network, tokens are burned on Polygon network and unlocked on ethereum network during the process.

Fx-Portal

StateSync requires mapping of the root and child contracts

FxPortal — ERC standardized tokens can be deployed without any mapping involved, with deployed base FxPortal contracts.

FxChild and FxRoot are main contracts for which FxBaseRootTunnel and FxBaseChildTunnel are to be inherited

Supports transfer of ERC20 and ERC721 Tokens

FxStateSync Contracts —

FxBaseRootTunnel (on Ethereum)

- function _processMessageFromChild(bytes memory data)

- function _sendMessageToChild(bytes memory message)

FxBaseChildTunnel (on Polygon)

- function _processMessageFromRoot(bytes memory data)

- function _sendMessageToRoot(bytes memory message)

Why Polygon ?

The features of Polygon like ETH Compatibility, Security, Scalability and a developer friendly active community make it a popular goto sidechain for dApps.

It is a Scaling Solution and aims to solve the problems of cost and speed that are inherent in the Ethereum Mainnet.

  • Proof of Stake Solution
  • Layer 2 Scaling solution over Ethereum Blockchain.
  • EVM-enabled Public Offchain/Sidechain
  • Achieves scale by utilizing sidechains for off-chain computation.
  • High Throughput (10000 TPS ) on single chain
  • Horizontally Scalable

Polygon Solutions for Scaling

Polygon has an entire suite of solutions and tools for scaling enterprise ready dApps —

Live : the below solutions are already available for enterprise use

  • Polygon PoS — EVM-compatible sidechain, secured by a permission-less set of PoS validators
  • Polygon Hermez — Open-source zero-knowledge(zk)- rollup token transfer platform
  • Polygon Edge –Modular Framework for building private/public ETH compatible blockchain n/ws

Development : the below solutions are still under development and will be launched for enterprise use

  • Polygon Nightfall — Optimistic Block rollups with ZK

\Polygone Miden — relies on zero-knowledge technology (zk-STARKs) to “roll-up” thousands of layer 2 transactions into a single Ethereum transaction based on Miden VM

\Polygon Zero — layer 2 scaling solution for Ethereum based on Plonky2 Prover System

--

--