Understanding Layer 2 Networks

Learn what Layer 2 networks are, how rollups and other scaling solutions work, why they matter for DeFi lending, and how Borrow by Sats Terminal uses L2s to offer cheaper Bitcoin-backed borrowing.

13 min read

The Blockchain Scaling Challenge

Ethereum, the most widely used blockchain for DeFi applications, can process roughly 15-30 transactions per second. Compare that to Visa's capacity of over 65,000 transactions per second, and the bottleneck becomes clear.

When demand for Ethereum block space exceeds supply, gas fees spike. During peak periods like the 2021 DeFi summer or popular NFT mints, simple transactions could cost $50-200 or more. For DeFi lending, where a single borrowing action might involve multiple transactions (approval, deposit, borrow), the total gas cost could easily reach hundreds of dollars.

This pricing made DeFi lending impractical for smaller loan amounts. If you wanted to borrow $500 against your Bitcoin, paying $150 in gas fees meant losing 30% of your loan value to transaction costs before even accounting for interest.

Layer 2 networks emerged as the solution to this scaling problem, and they have fundamentally changed the economics of DeFi lending.

What Is a Layer 2 Network?

A Layer 2 (L2) network is a separate blockchain that sits on top of a Layer 1 (L1) blockchain like Ethereum. It handles transaction processing on its own chain but posts transaction data or proofs back to the Layer 1 for security.

Think of it like this: Layer 1 is a heavily secured courthouse where every transaction gets a full trial. Layer 2 is a magistrate's office that handles routine cases efficiently, only sending summaries to the courthouse for final recording.

The key insight is that most blockchain operations do not need the full security and decentralization of the main chain for every step. By moving execution to a cheaper layer and only using the expensive main chain for security verification and data availability, L2s can dramatically reduce costs while maintaining strong security guarantees.

The Layer 1 and Layer 2 Relationship

Layer 1 blockchains like Ethereum provide:

  • Consensus - Agreement on the state of the blockchain among validators
  • Security - Economic guarantees (through staking) that make it extremely expensive to attack the network
  • Data availability - A permanent, tamper-resistant record of all transactions
  • Settlement - Final, irreversible confirmation of transactions

Layer 2 networks inherit these properties from their parent L1 while adding:

  • Higher throughput - Ability to process many more transactions per second
  • Lower costs - Dramatically reduced per-transaction fees
  • Faster confirmation - Near-instant transaction processing on the L2 itself
  • Flexibility - Ability to customize execution environments for specific use cases

How Layer 2 Networks Work

There are several approaches to building Layer 2 networks, but the most successful and widely adopted are rollups.

What Are Rollups?

Rollups work by executing transactions on the L2 chain, then "rolling up" batches of transactions and posting compressed data back to the L1. This compressed data, combined with some form of validity verification, ensures that the L1 can always reconstruct the full state of the L2 if needed.

The name "rollup" comes from this bundling process: many L2 transactions are rolled up into a single L1 transaction, splitting the L1 gas cost across all of them. If a rollup posts a batch containing 1,000 transactions to Ethereum, each individual transaction effectively pays only 1/1000th of the L1 posting cost.

There are two main types of rollups, and they differ in how they verify transaction validity.

Optimistic Rollups

Optimistic rollups take an "innocent until proven guilty" approach. They assume all transactions posted to the L1 are valid and provide a challenge period (typically 7 days) during which anyone can submit a fraud proof if they detect an invalid transaction.

How they work:

  1. Transactions are submitted to the L2 sequencer, which orders and executes them
  2. The sequencer posts compressed transaction data to Ethereum
  3. A 7-day challenge window opens during which validators can dispute any transaction by providing a fraud proof
  4. If a fraud proof is submitted and verified, the invalid transaction is reverted and the dishonest sequencer is penalized
  5. After the challenge window closes without a dispute, the transactions are considered finalized

Major optimistic rollups include:

  • Arbitrum - The largest L2 by total value locked, running an EVM-compatible execution environment. It hosts major DeFi protocols including Aave, GMX, and Uniswap
  • Optimism (OP Mainnet) - The second-largest optimistic rollup, using the OP Stack which has been adopted by Coinbase (Base), Binance, and others to create their own L2 chains
  • Base - Built on the OP Stack by Coinbase, Base has become one of the fastest-growing L2s, bringing a large user base from the Coinbase ecosystem

Trade-offs of optimistic rollups:

  • Mature technology with battle-tested implementations
  • Full EVM compatibility makes it easy for developers to deploy existing Ethereum applications
  • 7-day withdrawal period to L1 (though fast bridges can provide earlier access to funds)
  • Reliance on honest validators to submit fraud proofs when needed

ZK-Rollups (Zero-Knowledge Rollups)

ZK-rollups take the opposite approach: instead of assuming validity and allowing challenges, they use zero-knowledge cryptographic proofs to mathematically prove that every batch of transactions is valid before posting to the L1.

How they work:

  1. Transactions are executed on the L2
  2. A cryptographic "validity proof" is generated that mathematically demonstrates every transaction in the batch was executed correctly
  3. This proof, along with compressed transaction data, is posted to Ethereum
  4. An on-chain verifier contract checks the proof, confirming the batch's validity immediately

Major zk-rollups include:

  • zkSync Era - A general-purpose zk-rollup supporting Solidity smart contracts
  • StarkNet - Uses STARK proofs (rather than SNARKs) and has its own smart contract language (Cairo)
  • Polygon zkEVM - Aims for full Ethereum Virtual Machine compatibility using zero-knowledge proofs
  • Linea - Developed by Consensys (the company behind MetaMask) with a focus on EVM compatibility

Trade-offs of zk-rollups:

  • Faster finality because validity is proven mathematically rather than through challenge periods
  • No withdrawal delays to L1 once the proof is verified
  • More complex technology that is still maturing
  • Generating proofs is computationally expensive, though costs are amortized across all transactions in a batch
  • Some zk-rollups have limited EVM compatibility, though this is rapidly improving

The Impact on DeFi Lending

Layer 2 networks have transformed DeFi lending by making it economically viable for a much broader range of users and loan sizes.

Cost Reduction

The most immediate benefit is dramatically lower transaction costs. Consider the typical steps in a DeFi borrowing transaction:

  1. Approve the lending protocol to access your collateral token
  2. Deposit collateral into the lending protocol
  3. Borrow stablecoins against your collateral
  4. Monitor and manage your position (potentially multiple transactions)
  5. Repay your loan when ready
  6. Withdraw your collateral

On Ethereum L1, each of these steps could cost $10-50+ in gas fees, potentially totaling $100-300 for a complete borrowing cycle. On a Layer 2 like Arbitrum, the same transactions might cost $0.10-1.00 each, totaling under $5 for the complete cycle.

This cost reduction makes DeFi lending practical for smaller loans. A $1,000 Bitcoin-backed loan that would have been uneconomical on L1 (due to $200 in gas costs) becomes perfectly viable on an L2 (with $3-5 in total gas costs).

Speed Improvement

Layer 2 transactions typically confirm in 1-4 seconds, compared to 12-15 seconds on Ethereum L1 (and potentially longer during congestion). This faster confirmation creates a smoother user experience when depositing collateral, adjusting positions, or repaying loans.

Protocol Availability

Major lending protocols have deployed across multiple L2 networks. Aave operates on Arbitrum, Optimism, Base, and others. Compound has deployed its V3 on multiple L2s. Morpho and other protocols are following suit.

This multi-chain deployment creates competition for users, often resulting in better rates and incentives on L2 deployments. Some protocols offer temporarily boosted yields or reduced fees to attract liquidity to their L2 markets.

Maintaining Security

A common concern about L2s is whether they compromise security. The answer is nuanced but generally reassuring:

  • Settlement security comes from Ethereum L1. Your assets and positions are ultimately secured by Ethereum's consensus mechanism
  • Smart contract security depends on the specific protocol deployment. Major protocols like Aave undergo separate audits for each L2 deployment
  • Bridge security is a consideration when moving assets between L1 and L2. Official rollup bridges inherit the rollup's security model, though third-party bridges may introduce additional risk
  • Sequencer risk exists because most L2s currently rely on a centralized sequencer to order transactions, though all major rollups have plans for sequencer decentralization

How Borrow by Sats Terminal Leverages Layer 2

Borrow by Sats Terminal was built with L2 networks as a first-class consideration. As a lending aggregator, Borrow searches across protocols on multiple networks to find the best rates and lowest total costs for your Bitcoin-backed loan.

Cross-Network Aggregation

When you use Borrow to find the best borrowing terms, the platform does not just compare rates on a single network. It evaluates options across Ethereum L1 and multiple Layer 2 networks, factoring in both the interest rate and the gas costs associated with each option.

For a $5,000 loan, a slightly higher interest rate on an L2 might actually cost less total than a lower rate on L1, once gas fees are factored in. Borrow's aggregation engine handles this calculation automatically.

Lower Barrier to Entry

By supporting L2 networks, Borrow makes Bitcoin-backed borrowing accessible to users with smaller collateral amounts. You do not need a large Bitcoin position to justify the transaction costs. Even modest loans become economically sensible when gas costs are measured in cents rather than dollars.

Self-Custodial Across Networks

Regardless of which network processes your loan, Borrow maintains its fully non-custodial approach. Your self-custodial Privy wallet works across networks, and your assets remain under your control throughout the borrowing process. The network simply determines where the lending protocol's smart contracts execute.

With the growing number of L2 networks, understanding how to navigate the ecosystem helps you make informed decisions.

Bridging Assets

To use a Layer 2 network, you first need to move your assets there. This process is called "bridging." There are several approaches:

Official rollup bridges are the most secure option. They use the rollup's native security model but can be slow (especially withdrawals from optimistic rollups, which have a 7-day challenge period).

Third-party bridges like Across, Stargate, and Hop offer faster transfers between networks. They use their own liquidity pools and security models, which introduces additional trust assumptions but provides a much faster experience (usually minutes rather than days).

CEX withdrawals allow you to withdraw funds from a centralized exchange directly to an L2 network, bypassing the need for a separate bridging transaction entirely.

Choosing a Network

When selecting which L2 to use for DeFi lending, consider:

  • Protocol availability - Is the lending protocol you want deployed on that L2?
  • Liquidity depth - Are there enough deposits to support your loan size without excessive slippage?
  • Gas costs - While all L2s are cheaper than L1, costs vary between networks
  • Ecosystem - A vibrant L2 ecosystem with multiple DeFi protocols gives you more options for managing borrowed stablecoins
  • Security maturity - How long has the L2 been operating, and what is its security track record?

Aggregators like Borrow simplify this decision by searching across networks automatically and presenting you with the best options regardless of which L2 they are on.

The Future of Layer 2 Scaling

The L2 landscape is evolving rapidly, with several trends shaping its future.

Increasing Decentralization

Most current L2s rely on centralized sequencers. Projects like Espresso, Astria, and the rollups themselves are developing shared and decentralized sequencer solutions that will further reduce trust requirements.

Cross-L2 Communication

Interoperability between L2 networks is improving. Standards like ERC-7683 and cross-chain messaging protocols are making it easier to move assets and execute transactions across multiple L2s without manual bridging.

Lower Costs Through Data Availability

Ethereum's EIP-4844 (Proto-Danksharding) introduced "blob" transactions that significantly reduced the cost for rollups to post data to L1. Future upgrades (full Danksharding) will reduce these costs even further, potentially by another order of magnitude.

Application-Specific L2s

Some projects are building L2s optimized for specific use cases. A lending-focused L2 could optimize its execution environment for the specific transaction patterns of lending protocols, further improving efficiency.

Practical Tips for Using Layer 2 Networks

If you are new to L2 networks, these tips will help you get started safely.

Start with Major L2s

Begin with well-established L2s like Arbitrum, Optimism, or Base. These have the deepest liquidity, most established DeFi ecosystems, and longest track records.

Keep Some ETH for Gas

Even on L2 networks, you need ETH to pay for gas (just much less of it). Make sure your L2 wallet has a small ETH balance for transaction fees. A few dollars worth is usually sufficient for many transactions.

Verify Contract Addresses

When interacting with DeFi protocols on L2, ensure you are using the correct contract addresses for that specific network. Protocol addresses differ between L1 and each L2. Use official protocol documentation or trusted aggregators to avoid phishing contracts.

Understand Withdrawal Times

If you are using an optimistic rollup, be aware that official bridge withdrawals to L1 take approximately 7 days. Plan accordingly, or use a fast bridge service if you need quicker access to L1 funds.

Use Aggregators

Platforms like Borrow by Sats Terminal handle the complexity of multi-network comparison for you. Instead of manually checking rates and gas costs across multiple L2s, let the aggregator find the best option automatically.

Key Takeaways

Layer 2 networks solve blockchain's scalability challenge by processing transactions on a separate chain while using the main chain (Ethereum) for security and settlement. The two main types, optimistic rollups and zk-rollups, each take a different approach to verifying transaction validity but both dramatically reduce costs and increase speed.

For DeFi lending, L2s have been transformative. They reduce gas fees by 10-100x, making Bitcoin-backed borrowing economically viable for any loan size. Major lending protocols are deployed across multiple L2 networks, creating competition that benefits borrowers through better rates and lower costs.

Borrow by Sats Terminal leverages this multi-network landscape by aggregating lending protocols across L1 and L2 networks simultaneously. This means you can find the best borrowing terms without worrying about which network offers the optimal combination of rate, liquidity, and transaction cost. Combined with its self-custodial wallet and no-KYC approach, Borrow makes L2-powered DeFi lending accessible to every Bitcoin holder.

Related Guides

Common Questions

A Layer 2 (L2) network is a secondary blockchain that runs on top of a main blockchain (Layer 1) like Ethereum. It processes transactions off the main chain but periodically settles them back to Layer 1 for security. This allows for faster, cheaper transactions while inheriting the security guarantees of the underlying Layer 1 network.