How to Use Layer-2 Rollups to Avoid Gas Fees
Ethereum

How to Use Layer-2 Rollups to Avoid Gas Fees

7m
2 years ago

Are layer 2 solutions already out there? Our guide tells you which L2s can help you save on gas when trading.

How to Use Layer-2 Rollups to Avoid Gas Fees

Tabla de contenidos

Ultra-high gas fees and slow transaction times have tested the loyalty and patience of Ethereum users ever since it became the leading smart contract platform. Despite everything, Ethereum was still processing roughly 1.19 million transactions per day as of January 2022, amid a massive dip in the market.
However, the concerns of existing users cannot be ignored if Ethereum wants to remain on top, especially with the proliferation of faster chains like Solana, BSC, Fantom and many more.
The best immediate solution for Ethereum’s scaling problem is undoubtedly layer 2 rollup technology, which has been in development and pursued by separate entities since at least 2017.
If such a solution exists, everyone should already be using it, right? The truth is that there are some tradeoffs to Ethereum on-chain that currently prevent layer 2s from going mainstream. However, if low fees and fast transactions are really important to you, you need to accept the fact that there will be extra steps you need to take.

Rollups are not plug-and-play solutions. They are slightly more technical and have more friction due to the requirement of bridging from L1 to L2 and vice versa. Thankfully, rollup projects have made several breakthroughs in the last year that have significantly improved their user experience, efficiency and other features.

Join us in showcasing the cryptocurrency revolution, one newsletter at a time. Subscribe now to get daily news and market updates right to your inbox, along with our millions of other subscribers (that’s right, millions love us!) — what are you waiting for?

What Are Layer-2 Rollups?

Layer 2 rollups are scaling solutions predominantly utilized in the Ethereum ecosystem which outsource the execution of transactions outside the main blockchain, but retain some data per transaction on-chain. This allows transactions to leverage the same security model as the Ethereum main network while being processed in a separate layer, preventing network congestion and enabling faster confirmation times.

There are two types of rollups, each with its own design and security properties.

Optimistic Rollups

Optimistic rollups do not conduct transaction computation by default; hence, they can scale Ethereum better by a factor of 10-100x. Moreover, they can process complex smart contracts. This stands in contrast to zero-knowledge (ZK) rollups, which are mostly capable of running simple transactions. However, withdrawal times for optimistic rollups are significantly longer than ZK due to fraud challenges.

Zero-Knowledge Rollups

ZK-rollups transfer batches of transactions from layer 1 to 2 and create a validity proof for every batch. This drastically reduces the data size of transactions, which in turn lowers gas costs and shortens confirmation times. Unlike optimistic rollups, ZK-rollups do not require fraud challenges since the validity proofs are already verified, allowing fast withdrawal.
A ZK-rollup usually comprises two Merkle trees, a vital mathematical structure that helps blockchains avoid the faking of data on its onchain records, which are stored on a smart contract. One Merkle tree stores the accounts, while the other safekeeps all balances. All other data that the ZK-rollup uses is stored off chain.

Top Layer-2 Rollups

Polygon

Polygon is a layer 2 platform that describes itself as “Ethereum’s internet of blockchains,” offering not only a scaling solution but also a framework for interoperability with other layer 2 protocols.
Unlike most rollups, Polygon has its own native token called MATIC, which is used instead of ETH to pay for gas. This gives Polygon an advantage over other layer 2 solutions on Ethereum, since users don’t necessarily need to bear the costs of transferring Ethereum tokens into the Polygon mainnet initially. They can simply buy MATIC and use it to buy other tokens on decentralized exchanges (DEXs) that support Polygon.

Using Polygon DApps will allow you to trade, deposit liquidity or take out loans at a fraction of the cost of the Ethereum mainnet.

Here’s how to get started with Polygon:

  1. Download MetaMask and add the Polygon mainnet. Click on the MetaMask icon on your browser, then click Ethereum mainnet → Add Network.
  2. Paste the following phrases into their respective fields:Network Name: Polygon MainnetNew RPC URL: https://rpc-mainnet.maticvigil.com/Chain ID: 137Currency Symbol (optional): MATICBlock Explorer URL (optional): https://explorer.matic.network/
  3. You can either transfer your Ethereum-based ERC-20 tokens to Polygon via a bridge; or, if you want to save on costs, you can simply buy MATIC from a centralized exchange like Binance and transfer it to your wallet. Note that you need a non-zero amount of MATIC in order to conduct transactions on the Polygon network.
  4. Now that you have MATIC in your wallet, you can use any DApp that supports Polygon and enjoy the low fees and fast confirmations.

Notable rollup protocols currently only on Polygon are ZKSync, ZKSwap and the L2 DEX ZigZag.

Arbitrum

Arbitrum is an Ethereum scaling solution based on optimistic rollups that enables messages to pass between smart contracts from the main network to the Arbitrum second-layer chain, where the bulk of the work is done. The results of the transaction are ultimately recorded on the main network. This drastically enhances the speed and efficiency of Ethereum transactions.

How to use Arbitrum rollups:

In order to swap tokens using Arbitrum, you need a Web3 wallet like MetaMask for connecting to their web applications. Let’s take a look at how to get it up and running:
  1. First, download MetaMask and add the Arbitrum mainnet. Simply click on the MetaMask icon on your browser, then click Ethereum mainnet → Add Network.
  2. Paste the following phrases into their respective fields:Network Name: Arbitrum mainnet

RPC: https://arb1.arbitrum.io/rpc

Chain ID: 42161

Currency Symbol: ETH

Block Explorer URL: https://arbiscan.io
  1. Transfer your ERC-20 tokens to the Arbitrum network via the bridge. Note that any Ethereum token is compatible with Arbitrum. However, you need to have a decent amount of ETH to pay for gas.
  2. Once you have transferred your chosen tokens from Ethereum to Arbitrum, you can now enjoy trading them at drastically lower fees at any Arbitrum-based DEX, such as Anyswap or 1inch. Note that you need to choose the Arbitrum network in any exchange that you use.

Optimism

Optimism is, as its name implies, one of the leading optimistic rollup technologies, featuring a network layer designed to scale smart contracts while having the security of the Ethereum chain. Moreover, it is also supported by Uniswap V3, the latest iteration of the leading DEX on Ethereum.

Note that you need MetaMask in order to use the Optimism network.

How to use Optimism:

  1. Head over to https://gateway.optimism.io/ and choose MetaMask. Your wallet will then prompt you to connect.
  2. Use the provided gateway to transfer Ethereum-based tokens that you wish to trade on the Optimism mainnet. Note that you must have ETH to pay for gas.
  3. To start trading your tokens, head over to https://app.uniswap.org and choose Optimism instead of Ethereum. You can now swap any tokens like you normally would, but confirmation is nearly instantaneous and fees are ultra low.

Loopring

Loopring is an Ethereum layer 2 DEX based on ZK-rollup technology that replicates the intuitive interface of order books, but in an automated market maker (AMM) setting. This enables users to enjoy high-performance and low-cost trading. Loopring also doubles as a payment application that allows you to send ETH and other ERC-20 tokens to any Ethereum address in the Loopring network

Using Loopring:

  1. Go to https://app.loopring.io/ and click “Download Loopring Wallet,” which will redirect you to the DEX page.
  2. Connect your MetaMask. Make sure it’s on the Ethereum mainnet.
  3. Transfer your chosen tokens to Loopring’s second-layer network. You will pay a one-time gas fee in ETH. Once you transfer your chosen assets, they can be used gas-free for as long as you’d like.
  4. Since Loopring has its own native DEX, you can swap ETH and Ethereum-based tokens in its layer seamlessly by heading to the “Trade” tab.

StarkEx

StarkEx is a ZK-rollup scaling protocol developed by StarkWare in 2020. It aims to provide non-custodial DEXs with the ability to offer token swaps at low costs and high liquidity. The protocol supports not only ERC-20 but also ERC-721 tokens, allowing the likes of NFT marketplaces such as Immutable X to run on layer 2.
There are a few DApps that either run on StarkEx or natively support it. The process is similar to other L2s in this guide where you transfer ETH to another layer. For instance, if you want to swap tokens in a DEX, you can use DeversiFi. Other supported DApps include dYdX, Sorare, and Immutable X.

Should You Use Layer-2 Rollups?

Unless you rarely trade cryptocurrencies or only trade extremely large amounts that make $200 gas fees negligible, the answer should be a resounding yes, since rollups can dramatically reduce transaction costs. We recommend using L2 for most of your Ethereum activities, not only in swapping tokens, but also in performing decentralized finance (DeFi) activities or non-fungible token (NFT) minting.
That said, support for rollups is still developing. At the start of 2022, you still likely won’t be able to survive purely on L2s alone. So at least for now, it’s best to remain open to multiple approaches,
In 2021, ETH creator Vitalik Buterin warned that though roll-up technology is still new, block production will probably remain centralized for the foreseeable future and that it may take years to get users on board and refine its technology properly. While this may be the case, necessity is the mother of all invention, and there is no doubt that Ethereum needs rollups as soon as possible to alleviate pressure on its congested network.
With market conditions currently much cooler and less profitable than usual, and other layer 1 platforms like Solana and Binance Smart Chain offering exponentially cheaper and faster transacting than Ethereum’s mainnet, the argument to turn save on gas fees is more compelling than ever. It is very likely that users will have to adopt L2 rollups in order to ensure Ethereum’s future, even after it’s much-anticipated ETH 2.0 (consensus layer) merge this year.
This article contains links to third-party websites or other content for information purposes only (“Third-Party Sites”). The Third-Party Sites are not under the control of CoinMarketCap, and CoinMarketCap is not responsible for the content of any Third-Party Site, including without limitation any link contained in a Third-Party Site, or any changes or updates to a Third-Party Site. CoinMarketCap is providing these links to you only as a convenience, and the inclusion of any link does not imply endorsement, approval or recommendation by CoinMarketCap of the site or any association with its operators. This article is intended to be used and must be used for informational purposes only. It is important to do your own research and analysis before making any material decisions related to any of the products or services described. This article is not intended as, and shall not be construed as, financial advice. The views and opinions expressed in this article are the author’s [company’s] own and do not necessarily reflect those of CoinMarketCap. CoinMarketCap is not responsible for the success or authenticity of any project, we aim to act as a neutral informational resource for end-users.
10 people liked this article