Have you wanted to develop on top of Ethereum but were stopped in your tracks because of the network’s exorbitant fees? If so, you should learn more about the Optimism blockchain. This next-gen L2 (layer-2) solution for Ethereum offers excellent opportunities, enabling developers to access Ethereum but in a faster and more affordable way.
That said, no matter what chain you focus on, if you want to build dapps quickly and easily, utilizing the market’s leading tools is of utmost importance. The last thing you want is to waste your precious time and resources on building the backend infrastructure from scratch. Fortunately, you can save more than 80% of development time by using Moralis – the ultimate Web3 API provider. What’s more, Moralis now supports the Optimism L2 network among other leading L1s and L2s.
Thanks to Moralis cross-chain interoperability, you are never stuck to any particular chain, which future-proofs your work. In fact, you can build multi-chain dapps from the start. Also, you can change a single line of code and deploy dapps to other chains whenever you want. Furthermore, Moralis is also cross-platform interoperable. Accordingly, you can join the Web3 revolution using legacy programming languages and frameworks you’re proficient in and that you enjoy. As such, you can start building Optimism crypto apps by creating your free Moralis account. However, if you’d like to know more about the main topic of this article, read on and explore the L2 Optimism network.
What is the L2 Optimism Blockchain Network?
Since we only have so much time available, this article covers the essential aspects of the L2 Optimism blockchain. In short, the network is a lower-cost and quick Ethereum layer-2 blockchain. According to “optimism.io“, we can think of this L2 chain as a fast, stable, and scalable Ethereum. Moreover, it was Ethereum developers who built this scaling solution as a minimal extension to existing Ethereum software. By offering Optimism’s EVM-equivalent architecture that scales Ethereum dapps, their primary goal was to empower Ethereum dapp developers.
After all, the network’s Optimism Foundation pledged to uphold the values of Ethereum by producing infrastructure that promotes the growth and sustainability of public goods. As the optimism.io page puts it: “If it works on Ethereum, it works on Optimism at a fraction of the cost“. Furthermore, the foundation – a nonprofit – also states that until the project is fully decentralized, they intend to donate all profits from running a centralized sequencer towards scaling and sustaining public goods. So far, they’ve already distributed over one million dollars to public goods. You can find the details about how they are donating on the “about” page on the official website.
Another tagline on the Optimism blockchain’s official website reads: “The Ethereum experience at 10x speed“. The latter is supported by a promise from the Optimism L2 network as it takes everything devs love about Ethereum and turbocharges it. After all, as few lines of code as possible separate the L2 Optimism chain from Ethereum’s proven infrastructure. This makes the Optimism network not only compatible with but equivalent to EVM. Hence, all Ethereum tooling simply works on every level of the network’s stack. Moreover, transactions are cheap and nearly instant.
Design Philosophy Behind the Blockchain
In order to understand how the Optimism L2 chain works, you ought to keep in mind that it’s built according to the design philosophy that focuses on the following four pillars:
- Simplicity – According to the blockchain’s documentation, this L2 solution should be composed of the minimum number of moving parts required for a secure, scalable, and flexible L2 system. By focusing on simplicity, the L2 Optimism network prefers to use existing battle-tested Ethereum code and infrastructure where possible. For instance, the network uses Geth as its client software. Furthermore, a simple protocol means there’s less code to write, which means less surface area for potential mistakes.
- Pragmatism – This design philosophy prioritizes user and developer real-world needs over theoretical perfection. Hence, this L2 solution is developed iteratively and relies on feedback from users.
- Sustainability – Optimism’s team is aware that dapp developers need assurance that the platform they’re building on will remain competitive over long periods. Thus, the blockchain’s design focuses on long-term sustainability and not taking shortcuts to scalability. This is where a simple codebase helps build a bigger community of contributors who can help maintain the protocol long-term.
- Optimism – As the network’s name suggests, this pillar focuses on actual optimism about the future of Ethereum. A future where Web3 enables us to redesign our relationships with the institutions that coordinate our lives. According to the foundation’s beliefs, Ethereum is the core network of that future. After all, the Optimism blockchain is designed as an extension of Ethereum.
How Does the Optimism L2 Blockchain Work?
The big idea that makes the L2 chain possible is the optimistic rollup. Ultimately, the Optimism L2 chain is an “optimistic rollup”. This means that it piggybacks off of the security mechanism of another (“parent”) blockchain. Since Ethereum is Optimism’s parent chain, this L2 solution takes advantage of Ethereum’s proof-of-stake (PoS) consensus mechanism. After all, you probably remember that Ethereum transitioned from its original proof-of-work (PoW) protocol to PoS in September 2022 (The Merge).
Furthermore, all blocks of the Optimism blockchain are stored within a special smart contract on Ethereum. The latter goes by “CanonicalTransactionChain” (CTC). Moreover, all the blocks are held within an append-only list inside the CTC contract. Essentially, this append-only list forms the blockchain. Also, CTC includes code that ensures that no one can modify the existing list of blocks – presuming that no more than the last 50 Ethereum blocks are reorganized. So, as long as Ethereum is secure, Optimism is secure as well.
In addition, it’s worth pointing out that Optimism’s “sequencer” primarily manages the production of blocks. This single party provides instant transaction confirmation and state update, constructs and executes L2 blocks, and submits user transactions to the L1. Moreover, currently, Optimism Foundation runs the only block producer. Though, they plan to decentralize the sequencer over time.
Also, note that unlike Ethereum nodes, which download blocks from the Ethereum P2P network, Optimism nodes download blocks directly from the append-only list of blocks from CTC. Furthermore, the chain’s design enables users to transfer assets, including ERC-20 tokens, between the two networks. That said, the exact mechanism varies depending on the direction of the transfer. To read more details about how the network works and this protocol’s specs, visit the Optimism docs.
An Overview of Apps and Integrations
Today’s article wouldn’t be complete without an overview of apps and integrations in the Optimism ecosystem. Currently, there are over 200 apps and integrations in the ecosystem from various crypto niches, including DeFi projects, NFT projects, bridges, on-ramps, wallets, tools, and DAOs. If you want to learn more about those dapps and integrations, visit the network’s official website, scroll down, and hit the “Explore the ecosystem” button:
Optimism Crypto – What is it?
Crypto is the term widely used for all sorts of blockchain-related things. However, it is often applied as a synonym for “blockchain” or “cryptocurrency”. Hence, “Optimism crypto” refers either to the Optimism network itself or to the “OP” cryptocurrency, which is Optimism’s governance token.
Unlike native coins/tokens of L1s, Optimism crypto (OP) is not used to power the network. Instead of paying network gas fees in OP, Optimism – as an optimistic rollup – uses ETH (Ethereum’s native coin) to pay transaction fees. After all, it is the Ethereum network that accomplishes validation. As such, OP is solely used as a governance coin for the network’s Optimism Collective. The latter is a band of citizens, communities, and companies working together to reward public goods and help build a sustainable future for Ethereum. A mutually beneficial pact binds the collective – “impact = profit” – with the goal of deploying a new model for rewarding those who create or sustain public goods. Ultimately, the OP token launch marks Optimism Collective’s beginning of governance.
The Initial Governance Model
The initial model of digital democratic governance for the network’s Optimism Collective consists of two houses:
- Token House – As “token house” members, OP holders are responsible for submitting, deliberating, and voting on various types of governance proposals. These include governance fund grants, protocol upgrades, inflation adjustment, director removal, treasury appropriations, and rights protection.
- Citizens’ House – According to “community.optimism.io“, “citizenship” will be conferred by “soulbound” non-transferrable NFTs. Moreover, the set of citizens will grow over time. The exact mechanism for distributing citizenships will be determined by the foundation with input from the token house. Essentially, the citizens’ house is a large-scale experiment in non-plutocratic governance and retroactive funding of public goods.
Nonetheless, the Optimism Collective stresses that it takes an experimental and agile approach to governance, which will relentlessly iterate toward a system that stands the test of time. Hence, the initial model may evolve into something radically different. If you want to learn more about Optimism crypto economics and allocation, visit “community.optimism.io”.
Latest Optimism Network Support from Moralis
On November 15th, 2022, Moralis added support for the Optimism L2 network. This means you can now build all sorts of dapps and incorporate Web3 streams on this quick and affordable blockchain. Furthermore, if you decide to build on top of this network, you can use the Moralis Streams API. The latter enables you to stream any on-chain event straight to your project’s backend.
So, if you were to use the Streams API for a dapp that focuses on Optimism, you have two options. You can go about it using Moralis’ JS SDK or web UI. In the case of the former, you’d have to include the Optimism chain in the list of blockchains:
chains: [EvmChain.ETHEREUM, EvmChain.OPTIMISM], // List of blockchains to monitor
On the other hand, if you use Moralis’ web UI, you go to the “Select Networks” step, where you need to toggle the switch next to “Optimism Mainnet”:
Whichever method you choose, you must first create your free Moralis account. Of course, you can also use other popular Moralis Web3 APIs, such as the Auth API, Token API, and NFT API, to query on-chain data from the Optimism network. Furthermore, depending on the programming language or framework you decide to work with, you’ll just need to define the chain using “EvmChain.OPTIMISM” or “0xa“, which is Optimism’s chain ID (HEX).
Exploring the Optimism Network – A Next-Gen L2 Blockchain for Ethereum – Summary
We covered quite some ground in today’s article. We started our discussion with the basics, and you learned what the L2 Optimism blockchain network entails. Next, we did a quick overview of the design philosophy behind this Ethereum layer-2 solution. That’s where you learned about the four pillars (simplicity, pragmatism, sustainability, and optimism) that are the backbone of this blockchain. Moving on, you also found out how the Optimism L2 chain works. Then, we took a look at the Optimism ecosystem. Nonetheless, we also explained what “Optimism crypto” is. Accordingly, you also learned about the OP token and the initial Optimism Collective’s two-house (token house and citizens’ house) governance model. Last but not least, we briefly illustrated how to use Moralis to start building a dapp on Optimism.
Moving on, we recommend you complete some of our tutorials that await you in the Moralis documentation. Make sure to practice switching to supported chains, including Optimism. On the other hand, you may be interested in learning more about various blockchain development aspects. In that case, you should explore the Moralis YouTube channel and our crypto blog for devs. These two outlets tackle countless topics. For instance, some of the latest articles focus on how to get all NFTs from a collection, integrate the WalletConnect modal and QR code, get all NFTs owned by an address, Ethereum webhooks, Web3 infrastructure, and much more.
In addition, you might be eager to go full-time crypto. If so, you should become blockchain certified. The best way to do this is by enrolling in Moralis Academy. At the academy, you can start with the fundamentals or take on advanced courses, such as the Blockchain Business Masterclass course.