Polygon: An Overview of the Leading Layer 2 Scaling Solution on Ethereum

Hari Pandey
Coinmonks
7 min readApr 19, 2023

--

Polygon, formerly known as Matic Network, is a Layer 2 scaling solution built on top of the Ethereum network. It has gained significant attention in the blockchain space due to its ability to provide fast and low-cost transactions that can handle a wide range of use cases. In this article, we will take a closer look at Polygon.

Photo by Shubham Dhage on Unsplash

History:

Polygon was founded in 2017 by Jaynti Kanani, Sandeep Nailwal, and Anurag Arjun. Its goal was to provide a solution to the scalability issues of the Ethereum network. In 2019, the team launched the Matic Network, which became one of the first Layer 2 scaling solutions on Ethereum. In February 2021, the Matic Network rebranded to Polygon, reflecting its broader vision of becoming a multi-chain platform.

Features:

Polygon offers several Layer 2 scaling solutions, including Plasma, POS (Proof of Stake), and Rollups. These solutions are designed to alleviate the network congestion and high fees associated with on-chain transactions by moving some of the processing off-chain. They also provide faster and more cost-effective transactions by reducing the burden on the main blockchain network.

In addition to its Layer 2 scaling solutions, Polygon also offers several other features, including:

  • Interoperability: Polygon enables developers to easily transfer assets between Ethereum and other blockchains, allowing for increased liquidity and interoperability.
  • Developer-friendly: Polygon offers a variety of development tools and resources, making it easy for developers to build decentralized applications (dApps) on top of its infrastructure.
  • Community-driven: Polygon has a strong and growing community of developers, users, and supporters who are actively contributing to the platform’s growth and development.

Benefits:

  • Faster and cheaper transactions: Polygon’s Layer 2 scaling solutions can handle a large number of transactions at a much lower cost and faster speed than the Ethereum network.
  • Improved user experience: By reducing network congestion and transaction fees, Polygon makes it more accessible for users to interact with dApps and other blockchain-based services.
  • Scalability: Polygon’s Layer 2 scaling solutions provide the scalability needed to support large-scale decentralized applications and enterprise use cases.
  • Security: Polygon’s Layer 2 solutions are built with security in mind, and are designed to maintain the same level of security as the Ethereum network.

Above we discussed that polygon is offering several Layer 2 scaling solutions, including Plasma, POS (Proof of Stake), and Rollups.

Let’s discuss one by one how polygon is offering these…

1. Plasma

Polygon’s Plasma solution is a Layer 2 scaling technique that enables faster and more cost-effective transactions by creating sidechains that run parallel to the Ethereum mainnet. These sidechains can process transactions more efficiently and then submit them to the Ethereum mainnet for verification and finalization.

To explain how Plasma works, let’s take the example of a decentralized exchange (DEX) running on the Ethereum network. On the Ethereum network, every transaction is recorded on the main blockchain, which can cause congestion and slow down the network. With Plasma, the DEX can create a sidechain that processes transactions off-chain and then submits them to the Ethereum mainnet for finalization.

Here’s a step-by-step example of how the Plasma solution works for the DEX:

  1. The DEX creates a sidechain using the Plasma contract on the Ethereum network.
  2. The DEX deposits a certain amount of funds into the Plasma contract on the main Ethereum network. These funds are used to cover any disputes or fraudulent activity on the sidechain.
  3. Users deposit their funds into the DEX’s sidechain contract, which is linked to the Plasma contract on the Ethereum mainnet.
  4. Users can then make transactions on the DEX’s sidechain, such as buying and selling tokens.
  5. The DEX periodically submits a Proof of Authority (PoA) block to the Ethereum mainnet, which contains a summary of all the transactions that occurred on the sidechain.
  6. The Plasma contract on the Ethereum mainnet then verifies and validates the transactions in the PoA block.
  7. If there are no disputes or fraudulent activity, the Plasma contract finalizes the transactions on the main Ethereum network.
  8. Users can then withdraw their funds from the DEX’s sidechain contract back to their Ethereum wallet.

2. POS (Proof of Stake)

Polygon’s PoS solution is called Polygon PoS or POS Chain, which is a sidechain running on a modified version of the Ethereum codebase. Unlike the Ethereum mainnet, which uses Proof of Work (PoW) to validate transactions and mine new blocks, the Polygon PoS chain uses PoS.

PoS is a consensus algorithm where validators are chosen to validate new blocks based on their stake in the network. The more tokens a validator has, the higher the probability of being chosen to validate a block. This is in contrast to PoW, where miners solve complex mathematical problems to validate new blocks and earn rewards.

Here’s a step-by-step example of how the Polygon PoS chain works:

  1. Validators deposit a certain amount of MATIC tokens to participate in the network and earn rewards.
  2. The validators are selected to validate new blocks based on their stake in the network. The more tokens they have staked, the higher the probability of being chosen.
  3. The validators validate new blocks and earn rewards in MATIC tokens.
  4. Transactions are processed on the Polygon PoS chain and are finalized much faster compared to the Ethereum mainnet.
  5. The finality of transactions is achieved through checkpoints, which are periodically submitted to the Ethereum mainnet. These checkpoints include a summary of all the transactions that have occurred on the Polygon PoS chain.
  6. If there are any disputes or fraudulent activity, the validators can be penalized and lose a portion of their staked tokens.

By using PoS, the Polygon PoS chain provides a more efficient and sustainable alternative to PoW. PoS is much less energy-intensive compared to PoW, and it allows for faster and more cost-effective transaction processing. This makes it a great solution for decentralized applications that require fast and efficient transaction processing.

3. Rollups

Polygon offers a solution called “Polygon SDK” which allows developers to easily build and deploy their own Layer-2 scaling solutions on top of the Polygon network. One of the scaling solutions offered by Polygon SDK is zk-rollups.

image reference : https://www.alchemy.com/overviews/polygon-zk-rollups

In zk-rollups, all transactions are bundled together into a single batch, which is then submitted to the main chain for verification. Instead of including all the details of every transaction, only the final state of the batch is recorded on the main chain. This means that the amount of data that needs to be processed by the main chain is significantly reduced, allowing for faster and more cost-effective transactions.

To illustrate how zk-rollups work, let’s consider an example where Alice wants to send 1 ETH to Bob. On the main chain, this transaction would need to be verified and recorded by all the nodes on the network, which can be slow and expensive. With zk-rollups, however, the transaction is bundled together with other transactions in a single batch. The batch is then verified by a zk-SNARK (zero-knowledge proof) before being submitted to the main chain.

The zk-SNARK is a cryptographic proof that the batch of transactions is valid without revealing any of the individual transactions. This means that the main chain only needs to record the final state of the batch (i.e. the balance changes of all the participants), rather than all the details of every transaction. This significantly reduces the amount of data that needs to be processed by the main chain, making the transaction faster and cheaper.

In addition to zk-rollups, Polygon also offers Optimistic Rollups. Optimistic Rollups work similarly to zk-rollups, but instead of using a zk-SNARK to verify the batch of transactions, they use an “optimistic” approach where transactions are assumed to be valid unless proven otherwise. If a transaction is found to be invalid, the system “rolls back” the invalid transaction and re-executes it. Optimistic Rollups can be faster than zk-rollups, but they are also more complex and can be more prone to errors.

Here’s a step-by-step example of how Polygon’s Optimistic Rollups work:

  1. Users submit their transactions to a Rollup aggregator contract on the Polygon network.
  2. The Rollup aggregator batches multiple transactions together into a single transaction and submits it to the Ethereum mainchain.
  3. The Rollup aggregator contract then creates a Rollup block that contains a summary of all the transactions in the batch.
  4. The Rollup block is submitted to the Ethereum mainchain, where it is processed by the Rollup smart contract.
  5. The Rollup smart contract validates the Rollup block and the transactions it contains. If everything is valid, the Rollup block is confirmed on the Ethereum mainchain and the transactions are finalized.
  6. If there are any invalid transactions or fraud, the Rollup smart contract can be challenged and a fraud proof can be submitted to revert the Rollup block.

By using Rollups, Polygon is able to reduce the amount of data that needs to be processed on the Ethereum mainchain, which in turn reduces the gas fees and improves transaction throughput. This makes it possible for decentralized applications to process transactions faster and more cost-effectively.

One example of a decentralized application that is using Polygon’s Optimistic Rollups is Aave, a decentralized lending platform. By using Rollups, Aave is able to reduce the gas fees for borrowing and lending activities, which makes it more accessible to a wider range of users.

for more, you can watch these videos too…

for such contents follow me : medium.com/@Hari_pandey

--

--

Hari Pandey
Coinmonks

Blockchain Enthusiast l Developer || Find me at Coinmonks & Block Magnates