Skip to main content

How to Deploy Your Own Optimism L2 Rollup with OP Stack

Updated on
Sep 25, 2024

11 min read

Overview​

In this guide, we’ll walk you through the process of deploying your own Optimism Layer 2 (L2) rollup using QuickNode’s Rollup-as-a-Service (RaaS) product. We will be utilizing the OP Stack, a modular framework to simplify the creation of scalable Layer 2 (L2) and Layer 3 (L3) blockchains on Ethereum. Currently, you will be able to deploy your rollup on the Ethereum Sepolia testnet, with mainnet support coming soon.

By the end of this guide, you’ll be equipped with the knowledge and tools needed to launch and manage a scalable, secure, and reliable OP Stack rollup, tailored to your specific needs.

What You Will Do​

  • Understand the the Blockchain scalability challenge and the role of Layer 2 solutions
  • Learn about rollups, with a focus on Optimistic rollups and ZK rollups
  • Explore chain frameworks like the OP Stack, ZK Stack, and Arbitrum Orbit
  • Deploy your own Optimism L2 rollup using QuickNode’s Rollup-as-a-Service

What You Will Need​

Looking for guidance on building your first blockchain?

For a more detailed exploration of blockchain development, check out our Launch Your Own Blockchain guide. This guide covers everything from the basics to advanced strategies, helping you make informed decisions before starting your rollup project. If you need additional help, talk with one of our experts to find out how to make your next project a success.

Why are Layer 2 and Rollups Needed?​

Ready for deployment?

If you're eager to start building your own rollup and prefer to skip the background information, click here to go directly to the deploying section.

The Blockchain Scalability Challenge​

One of the main challenges in blockchain technology is achieving a balance between decentralization, security, and scalability, often referred to as the Scalability Trilemma.

Traditional Layer 1 blockchains, like Ethereum, are highly decentralized and secure but struggle with scalability, leading to issues like high transaction fees and slow processing times. These limitations can hinder the growth and adoption of blockchain applications, especially as the demand for decentralized services continues to rise.

What are Layer 2 Solutions?​

Layer 2 solutions are protocols that are built on top of existing Layer 1 blockchains to enhance scalability and efficiency without compromising on security. By processing transactions offchain and then settling them on the main chain (i.e., Ethereum), Layer 2 solutions can significantly reduce congestion and lower transaction costs. This makes them a crucial component in the effort to make blockchain technology more scalable and user-friendly.

What are Rollups?​

Rollups are a powerful Layer 2 solution that enhances the scalability of blockchain networks by aggregating multiple transactions into a single batch processed offchain. This approach significantly reduces fees and increases transaction throughput, all while maintaining the security and decentralization of the underlying Layer 1 blockchain.

Although the logic of batching the transactions of the two main rollup types, Optimistic and ZK rollups, is similar, the approach to validating these transactions is different. Optimistic Rollups assume transactions are valid by default, relying on fraud proofs during a challenge period, while ZK Rollups use cryptographic proofs (i.e., ZK-SNARKs) for instant verification.

Custom Rollups​

While general-purpose Layer 2 networks like Arbitrum, Optimism, and ZKsync serve a wide range of use cases, there’s a growing trend for enterprises, companies, and specialized projects to create their own custom rollups. Custom rollups allow these organizations to tailor the Layer 2 solution to their specific needs, whether it’s optimizing for privacy, compliance, scalability, or integrating unique business logic.

Custom rollups offer the flexibility to address unique challenges and opportunities that may not be fully met by general-purpose Layer 2 solutions, making them an attractive option for organizations looking to innovate and scale in the blockchain space.

Chain Frameworks for Building Rollups​

When creating rollups, especially on Layer 2, choosing the right framework is crucial for the success of your project. Here’s a brief overview of three leading frameworks—OP Stack, ZK Stack, and Arbitrum Orbit—that you might consider when developing your rollup.

OP Stack (Optimism Collective)​

OP Stack, maintained by the Optimism Collective, is the backbone of the Optimism network and is designed to facilitate the launch of new Layer 2 (L2) and Layer 3 (L3) blockchains. Its modular architecture allows developers to customize different blockchain layers, such as the consensus or execution layers, making it highly adaptable to specific use cases. The framework is known for its seamless integration and development tools, which streamline the deployment of new chains and applications. OP Stack is also interoperable, aiming to create a "Superchain" where multiple OP Stack chains can interact effortlessly.

Key Features:

  • Optimistic rollup architecture
  • EVM equivalence for seamless Ethereum compatibility
  • Modular design allowing customization of various components
  • Fault proof system for transaction verification
  • Superchain concept for interconnected L2 chains
  • Custom native gas token supported
Superchain

The Superchain is OP Stack's vision for a network of standardized L2 chains (OP Chains) that share security, communication protocols, and core technology. This approach aims to create a unified layer of interoperable chains, allowing developers to build applications that can seamlessly operate across multiple chains within the ecosystem.

To learn more about OP Stack, check out our Builders Guide's OP Stack page.

Arbitrum Orbit (Arbitrum Foundation)​

Arbitrum Orbit builds on the advanced Nitro technology stack and allows developers to launch customizable Layer 2 and Layer 3 chains. It supports both rollup (optimistic rollups, used by Arbitrum One) and AnyTrust (data availability committee, used by Arbitrum Nitro) configurations, offering a high level of customization for governance, gas tokens, and data options.

To learn more about Arbitrum Orbit, check out our Builders Guide's Arbitrum Orbit page.

ZK Stack (ZKsync by Matter Labs)​

ZK Stack is a modular framework designed for building zk-Rollups powered Ethereum Layer 2 blockchains. It offers advanced customization options to fit unique use cases. ZK Stack is particularly strong in privacy and security, leveraging Zero-Knowledge Proofs (ZKPs) to ensure that transactions are verified without exposing underlying data. This makes it ideal for applications that require high security and privacy.

To learn more about ZK Stack, check out our Builders Guide's ZK Stack page.

In this guide, we’ll focus on Optimistic Rollups using the OP Stack, leveraging QuickNode’s Rollup-as-a-Service (RaaS) for an easy and efficient deployment process.

What is Rollups-as-a-Service (RaaS)?​

Rollups are an essential part of scaling blockchain technology, especially as demand for decentralized applications (dApps) continues to grow. However, deploying and managing rollups can be complex, requiring significant resources and expertise. This is where Rollup-as-a-Service (RaaS) comes in, simplifying the process and making it accessible to a wider audience. It allows developers and companies to build their own Layer 2 rollup chains without needing deep technical knowledge or large infrastructure.

By providing a comprehensive stack of tools, templates, and infrastructure, RaaS platforms enable users to create rollups —whether general-purpose or application-specific— without the need for extensive technical expertise or heavy infrastructure investments.

Why Choose Rollups with QuickNode?​

Deploying and managing rollups can be complex, especially when reliability, security, and scalability are paramount. QuickNode’s Rollup-as-a-Service addresses these challenges by providing a streamlined solution that emphasizes long-term success.

Benefits of Using QuickNode for Rollups:


  • Enterprise-Grade Infrastructure: QuickNode’s infrastructure is designed to support enterprise-grade rollups, ensuring high performance and security from the start.
  • Dedicated Clusters: With dedicated clusters, your rollup benefits from optimal performance and reliability, free from the risks of shared environments.
  • Comprehensive Tooling: QuickNode offers all the tools (i.e., block explorer, validator tools, API indexer, scalable RPC, testnet faucet) you need to manage your rollup, making it easier to maintain and optimize your rollup.
  • Security and Reliability: With 99.99% uptime SLAs and, SOC1 Type 1 and SOC2 Type 2 certifications, you can trust that your rollup will remain operational and secure, protecting your revenue and customer trust.
  • Scalability: As your rollup grows, QuickNode’s infrastructure scales seamlessly, maintaining high performance even under increased demand.

Now that you understand the benefits of rollups and Rollup-as-a-Service of QuickNode, let's dive into the step-by-step process of deploying your own Optimism L2 rollup.

Rollup Configuration​

Before deploying your Optimism L2 rollup, it's crucial to understand the settings you'll need to configure. This knowledge will help you make informed decisions during the deployment process.

Framework​

In this guide, we will demonstrate how to deploy your rollup using the OP Stack, the core framework behind Optimism’s L2 rollup solutions.

Check out our Builders Guide's OP Stack page to learn more about OP Stack.

Data Availability Options​

Data availability refers to how and where your rollup stores its transaction data. Ensuring data availability is critical because it guarantees that all necessary transaction data is accessible for verification and dispute resolution.

Data can be stored either onchain (Layer 1) or offchain using different data availability solutions.

Onchain vs. Offchain Data Availability

Onchain (Layer 1): Storing data on Layer 1 (like Ethereum) provides the highest level of security because the data inherits the security guarantees of the base layer. However, this method can be costly due to the fees associated with storing data directly onchain. With the introduction of blob storage (EIP-4844), onchain data availability has become more scalable and cost-effective for rollups.

Offchain: Offchain data availability solutions, like Celestia, offer a more scalable and cost-effective alternative by moving data storage outside of Layer 1. While these solutions reduce costs and increase transaction throughput, they may not always offer the same level of security as onchain storage. However, offchain solutions often employ strong verification methods to ensure data integrity and reliability.

We currently support two main onchain data availability options for OP Stack rollups:

Blobs​

  • Uses Ethereum's blob storage (EIP-4844)
  • Offers improved scalability and lower costs compared to traditional methods
  • Ideal for high-volume applications where cost efficiency is crucial

Calldata​

  • Uses Ethereum's traditional calldata for storing transaction data
  • More established method, widely supported
tip

In most cases, using blobs as a data availability solution is more cost-effective than calldata. However, instead of determining which one would be more efficient, the OP Stack's op-batcher can be configured to automatically switch between calldata and blobs depending on which is cheaper, optimizing costs dynamically. This feature works better for high throughput chains.

For detailed research on the cost of data availability solutions, you may check here.

Settlement Layer​

The settlement layer is where the final state of transactions is recorded and where disputes over transaction validity are resolved. For Optimism L2 rollups, Ethereum acts as the settlement layer, providing:


  • High Security: Ethereum's decentralized network ensures that the final state of transactions is secure and tamper-proof.
  • Trustless Bridge: Allows for secure and decentralized transfers of assets between Layer 1 (Ethereum) and Layer 2 (your rollup).
  • Dispute Resolution: Ensures that any disputes over transaction validity are handled in a trustless, secure manner, leveraging Ethereum's robust consensus mechanism.

Additional Products​

Rollups-as-a-Service (RaaS) platforms generally include several key products that enhance your rollup's functionality and user experience. These tools are critical for ensuring seamless cross-chain operations, improving transparency, and supporting development and testing.

Bridge UI:​

  • Facilitates easy asset transfers between your settlement layer (generally Ethereum - L1) and your rollup
  • Improves user experience for cross-chain interactions

Block Explorer:​

  • Provides a user-friendly interface to explore transactions, addresses, and smart contracts on your rollup
  • Increases transparency for both developers and users, while also aiding in debugging and monitoring rollup activity

Faucet Integration:​

  • Allows users to obtain small amounts of tokens
  • Essential for onboarding developers and users to your new L2 rollup

How to Deploy Your Own Optimism L2 Rollup​

Now that we have everything in place, let's jump into the deployment process.

Step 1: Start a New Rollup Deployment​

To get started, log in to your QuickNode account.


  • On the sidebar, click the Rollups section to access the Rollup-as-a-Service dashboard.
  • Click the Deploy a New Rollup button to start the process of setting up your Optimism Layer 2 rollup.

If you don't have a QuickNode account yet, create a free one here.

Step 2: Configure Rollup Details​

In this step, you’ll set up the basic details for your rollup.


  • Rollup Name: Modify the name for your rollup or leave it as is. Remember, the name cannot be changed once the rollup is deployed.
  • Admin Address: Add the public address of a multi-signature wallet or a wallet that you control. This wallet will act as the admin and be responsible for managing contract upgrades, rotating the sequencer address, and making rollup configuration changes.
  • Chain ID: The Chain ID is a unique identifier for your rollup’s chain and cannot be modified.

RaaS Dashboard - Rollup Details

Step 3: Select Framework​

Here, you will choose the framework on which to build your rollup.

Select the OP Stack as your framework for this deployment.

RaaS Dashboard - Framework Selection

Other frameworks, such as ZKsync Stack and Arbitrum Stack, will be available in the future.

Step 4: Choose Settlement Layer​

Next, decide where your rollup will settle its transactions.

Select Ethereum Sepolia (L1) as the settlement layer for this guide.

If you need help choosing your settlement layer, you may check this section.

RaaS Dashboard - Settlement Layer Selection

Other alternatives, such as Base and Berachain, will be available soon.

Step 5: Select Data Availability Solution​

The data availability step allows you to configure how your rollup stores and accesses transaction data.

Choose calldata on Ethereum Sepolia as the current data availability solution.

If you need help selecting your data availability solution, you may check this section.

RaaS Dashboard - Data Availability Selection

Other options, like blobs on Ethereum Sepolia and Celestia, will be available soon.

Step 6: Review and Deploy Your Rollup​

Before finalizing, review all configuration details to ensure everything is set up correctly.


  • Review your rollup’s name, chain ID, admin address, framework, settlement layer, and data availability settings.
  • Take note of the features QuickNode provides:
    • Your own blockchain
    • Built-in block explorer, tracer, and bridge
    • Best-in-class security monitoring and architecture
    • High-availability sequencing with QuickNode
    • Hypernode RPC scaling with your usage
    • Discord support for technical assistance
  • Review the pricing and estimated deployment time.
  • Click Start deployment to begin deploying your rollup.

RaaS Dashboard - Deployment

Step 7: Monitor Your Rollup​

Once deployed, you can view and manage your rollup from the QuickNode dashboard. You’ll have access to detailed insights and management tools.

Overview Page: This page provides a high-level view of your rollup's performance.


  • RPC Endpoint Activity: Monitor RPC requests over a selected period.
  • Performance Metrics: View statistics like total requests, requests per second, network activity, transactions, and block times.
  • Sequencer Transactions: See details of the transactions handled by your sequencer.
  • Rate Limit and Whitelisting: Manage rate limits and set IP whitelisting for security.
  • Endpoint Management: Oversee and manage your rollup’s endpoint configuration.

Contracts Page: Here, you can access the details of all contracts related to your rollup.

Faucet Page: The Faucet page lets you distribute tokens to specific addresses.

Interacting with Your Rollup​

Once your Optimism L2 rollup is deployed, you can start interacting with it just like you would with any EVM-compatible chain. Below are some basic methods to get started:

Interacting via cURL​

You can use curl commands to interact with your rollup’s RPC endpoint directly. Here's an example of how to check the latest block:

curl -X POST https://<your-rollup-rpc-endpoint> \
-X POST \
-H "Content-Type: application/json" \
--data '{"method":"eth_blockNumber","params":[],"id":1,"jsonrpc":"2.0"}'

This command will return the current block number of your rollup in hexadecimal format.

Interacting via EVM-Compatible Libraries​

Since your rollup is EVM-compatible, you can also use popular libraries like ethers.js or web3.js to interact with your rollup. These libraries allow you to perform various actions, such as sending transactions, reading contract data, and listening to events.

Here’s an example of using ethers.js to interact with your rollup:

import { ethers } from "ethers";
(async () => {
const provider = new ethers.JsonRpcProvider("https://<your-rollup-rpc-endpoint>");
const blockNum = await provider.getBlockNumber();
console.log(blockNum);
})();

For more detailed examples and in-depth guidance on interacting with Optimism rollups, you can refer to QuickNode's Optimism documentation, which covers many of the common methods and tools available for interacting with Optimism-based chains.

Conclusion​

Deploying your own Optimism Layer 2 rollup with QuickNode’s Rollup-as-a-Service (RaaS) is a powerful way to scale your blockchain application while maintaining security, performance, and reliability. By following the steps outlined in this guide, you now have the tools and knowledge to customize your rollup according to your project’s specific needs, leveraging the flexibility and modularity of the OP Stack.

Whether you're building a dApp that requires high throughput, deploying a specialized blockchain for enterprise use, or exploring the potential of Layer 2 solutions, QuickNode’s RaaS provides the infrastructure and support you need to succeed.

If you have questions, any ideas or suggestions, please contact us directly. Also, stay up to date with the latest by following us on Twitter and joining our Discord and Telegram announcement channel.

Additional Resources​


We ❤️ Feedback!

Let us know if you have any feedback or requests for new topics. We'd love to hear from you.

Share this guide