{"id":2301,"date":"2022-10-22T19:03:46","date_gmt":"2022-10-22T19:03:46","guid":{"rendered":"https:\/\/metaschool.so\/articles\/?p=2301"},"modified":"2023-04-15T03:43:31","modified_gmt":"2023-04-15T03:43:31","slug":"layer-2-crypto","status":"publish","type":"post","link":"https:\/\/metaschool.so\/articles\/layer-2-crypto\/","title":{"rendered":"What is Layer 2?"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_56_1 ez-toc-wrap-left counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title \" >Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/metaschool.so\/articles\/layer-2-crypto\/#Importance_of_L2_blockchains\" title=\"Importance of L2 blockchains\">Importance of L2 blockchains<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/metaschool.so\/articles\/layer-2-crypto\/#Features_of_Layer_2_chains\" title=\"Features of Layer 2 chains\">Features of Layer 2 chains<\/a><ul class='ez-toc-list-level-3'><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/metaschool.so\/articles\/layer-2-crypto\/#1_Rapid_transactions\" title=\"1. Rapid transactions\">1. Rapid transactions<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/metaschool.so\/articles\/layer-2-crypto\/#2_Reduced_transaction_fee\" title=\"2. Reduced transaction fee\">2. Reduced transaction fee<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/metaschool.so\/articles\/layer-2-crypto\/#3_Smart_contracts\" title=\"3. Smart contracts&nbsp;\">3. Smart contracts&nbsp;<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/metaschool.so\/articles\/layer-2-crypto\/#4_Interoperability\" title=\"4. Interoperability&nbsp;\">4. Interoperability&nbsp;<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/metaschool.so\/articles\/layer-2-crypto\/#Different_types_of_L2_networks\" title=\"Different types of L2 networks\">Different types of L2 networks<\/a><ul class='ez-toc-list-level-3'><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/metaschool.so\/articles\/layer-2-crypto\/#1_Channels\" title=\"1. Channels\">1. Channels<\/a><ul class='ez-toc-list-level-4'><li class='ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/metaschool.so\/articles\/layer-2-crypto\/#a_State_channels\" title=\"a. State channels\">a. State channels<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/metaschool.so\/articles\/layer-2-crypto\/#b_Payment_channels\" title=\"b. Payment channels\">b. Payment channels<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/metaschool.so\/articles\/layer-2-crypto\/#Differences_between_state_and_payment_channels\" title=\"Differences between state and payment channels&nbsp;\">Differences between state and payment channels&nbsp;<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/metaschool.so\/articles\/layer-2-crypto\/#2_Rollups\" title=\"2. Rollups\">2. Rollups<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/metaschool.so\/articles\/layer-2-crypto\/#3_Plasma\" title=\"3. Plasma&nbsp;\">3. Plasma&nbsp;<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"https:\/\/metaschool.so\/articles\/layer-2-crypto\/#4_Sidechains\" title=\"4. Sidechains&nbsp;\">4. Sidechains&nbsp;<\/a><ul class='ez-toc-list-level-4'><li class='ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-15\" href=\"https:\/\/metaschool.so\/articles\/layer-2-crypto\/#Final_words\" title=\"Final words\">Final words<\/a><\/li><\/ul><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n\n<p>Ever heard of two different types of liquid that flow side-by-side but never meet? <a href=\"https:\/\/metaschool.so\/articles\/layer-1-blockchain\/\" target=\"_blank\" rel=\"noreferrer noopener\">Layer 1 <\/a>(L1) and Layer 2 (L2) kinda work like the metaphor.&nbsp;<\/p>\n\n\n\n<p>L2 is a secondary framework that is based and built on the top of an L1 blockchain that increases the efficiency and decreases the workload (read: transactions) of the main blockchains.&nbsp;<\/p>\n\n\n\n<p>Alternatively known as L2, they are independent blockchains that work in conjunction with the leading blockchains or main networks such as <a href=\"https:\/\/metaschool.so\/blockchains\/ethereum?ref=Article&amp;utm_source=Blog_Organic\" target=\"_blank\" rel=\"noreferrer noopener\">Ethereum<\/a>, <a href=\"https:\/\/metaschool.so\/blockchains\/bitcoin?ref=Article&amp;utm_source=Blog_Organic\" target=\"_blank\" rel=\"noreferrer noopener\">Bitcoin<\/a>, etc.&nbsp;<\/p>\n\n\n\n<p><a href=\"https:\/\/metaschool.so\/blockchains\/polygon\" target=\"_blank\" rel=\"noreferrer noopener\">Polygon<\/a> and <a href=\"https:\/\/www.immutable.com\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">Immutable X<\/a> are examples of the layer.<\/p>\n\n\n\n<div class=\"wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex\">\n<div class=\"wp-block-button aligncenter is-style-primary\"><a class=\"wp-block-button__link wp-element-button\" href=\"https:\/\/metaschool.so\/articles\/layer-1-blockchain\/\" target=\"_blank\" rel=\"noreferrer noopener\">Check this out: A detailed guide to layer 1 chains<\/a><\/div>\n<\/div>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"importance-of-l2-blockchains\"><span class=\"ez-toc-section\" id=\"Importance_of_L2_blockchains\"><\/span>Importance of L2 blockchains<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>You would have read and heard users often refer to main L1 blockchains as on-chain. Similarly, L2 chains work on an off-chain mechanism. Their importance can be gauged by the value they add to L1 chains.&nbsp;<\/p>\n\n\n\n<p>They are an extension of main <a href=\"https:\/\/metaschool.so\/blockchains?ref=Article&amp;utm_source=Blog_Organic\" target=\"_blank\" rel=\"noreferrer noopener\">blockchain networks<\/a> and they assist them in increasing their overall scalability and more importantly, the average TPS (transactions per second) rate. As of today, the main or L1 blockchains can only verify and process a limited number of transactions a second. With time and overall growth in their user base, this has turned out to be a great challenge.&nbsp;<\/p>\n\n\n\n<p>Thus, L2 blockchains work as a reliable technology solution that takes the surplus and unprocessed transactions and processes them off-chain with more efficiency and less time.&nbsp;<\/p>\n\n\n\n<p>L2 does not only help the main blockchain in increasing its TPS but also works independently while being connected to the main network. This has a huge impact on the main network\u2019s performance and consequently, the entire experience of a user operating on the main blockchain.<\/p>\n\n\n\n<p>Layer 2 increases the performance for L1 to make a better user experience and improve overall performance. On the other hand, Layer 1 has some different solutions like changing the consensus mechanism from <a href=\"https:\/\/metaschool.so\/articles\/proof-of-work-meaning\/\" target=\"_blank\" rel=\"noreferrer noopener\">Proof of Work<\/a> to <a href=\"https:\/\/metaschool.so\/articles\/proof-of-stake-pos-meaning\/\" target=\"_blank\" rel=\"noreferrer noopener\">Proof of Stake<\/a> (which has already been done as part of the <a href=\"https:\/\/metaschool.so\/articles\/the-merge-ethereum\/\" target=\"_blank\" rel=\"noreferrer noopener\">Ethereum Merge<\/a>) and <a href=\"https:\/\/metaschool.so\/articles\/sharding-meaning\/\" target=\"_blank\" rel=\"noreferrer noopener\">sharding<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"features-of-layer-2-chains\"><span class=\"ez-toc-section\" id=\"Features_of_Layer_2_chains\"><\/span>Features of Layer 2 chains<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Apart from increasing the scalability of the main blockchain, there are multiple other features of L2 technology. Some of the major ones are as follows:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"1-rapid-transactions\"><span class=\"ez-toc-section\" id=\"1_Rapid_transactions\"><\/span>1. Rapid transactions<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>As was discussed previously, without L2 technology, main blockchains may take a lot of time in processing and may face many challenges as well, ruining user experience and the overall credibility of the network. With L2, this problem is properly addressed.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"2-reduced-transaction-fee\"><span class=\"ez-toc-section\" id=\"2_Reduced_transaction_fee\"><\/span>2. Reduced transaction fee<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Transaction fees are a non-negligible parameter in blockchain transactions. With the main network, the transaction fee tends to be more. However, Layer 2 solutions can reduce the fees and give similar output.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"3-smart-contracts\"><span class=\"ez-toc-section\" id=\"3_Smart_contracts\"><\/span>3. Smart contracts&nbsp;<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>You may know that Ethereum, as a main blockchain, is quite famous for <a href=\"https:\/\/metaschool.so\/articles\/building-a-dapp-guide\/\">dApps<\/a> and <a href=\"https:\/\/metaschool.so\/articles\/what-is-a-smart-contract\/\">smart contracts<\/a>. L2 technology enhances this capability of Ethereum and other main blockchains by catering to much more complex cases of smart contracts.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"4-interoperability\"><span class=\"ez-toc-section\" id=\"4_Interoperability\"><\/span>4. Interoperability&nbsp;<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>While some types of L2 may not be interoperable, some of them can support different block parameters and different consensus mechanisms as well. This interoperability makes the technology more desirable and investment-worthy.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"different-types-of-l2-networks\"><span class=\"ez-toc-section\" id=\"Different_types_of_L2_networks\"><\/span>Different types of L2 networks<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>The concept of blockchains was introduced in 2018 with the development of Lightning Network in bitcoin. Since then we have seen the technology evolve and grow bigger. There are several different types of L2 networks today. If we were to divide them, we would get four distinct categories.&nbsp;<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"1-channels\"><span class=\"ez-toc-section\" id=\"1_Channels\"><\/span>1. Channels<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>The most basic principle of channels is that they enable <a href=\"https:\/\/metaschool.so\/articles\/peer-to-peer-p2p\/\" target=\"_blank\" rel=\"noreferrer noopener\">peer-to-peer (P2P)<\/a> channeling between two parties off-chain. Channels are further divided into two &#8211; state channels and payment channels.&nbsp;<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"a-state-channels\"><span class=\"ez-toc-section\" id=\"a_State_channels\"><\/span>a. State channels<span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<p>A type of off-chain solution that allows for a number of transactions to be conducted between two parties with no such requirement of it being registered on the main blockchain while the transactions are taking place. This eliminates the waiting time as we are no longer dependent on third parties like a miner.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"b-payment-channels\"><span class=\"ez-toc-section\" id=\"b_Payment_channels\"><\/span>b. Payment channels<span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<p>As the name suggests, it is a type of off-chain solution that only caters to off-chain payments between two parties.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"differences-between-state-and-payment-channels\"><span class=\"ez-toc-section\" id=\"Differences_between_state_and_payment_channels\"><\/span>Differences between state and payment channels&nbsp;<span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><strong>State channels<\/strong><\/td><td><strong>Payment channels<\/strong><\/td><\/tr><tr><td>Support more than just payment and transactions such as smart contracts&nbsp;<\/td><td>May not necessarily cater to complex execution as smart contracts&nbsp;<\/td><\/tr><tr><td>Do not require every transaction to be recorded on the main blockchain before the final transaction is processed<\/td><td>Tracking of payment, amounts, and balances is an important part and parcel of the channels&nbsp;<\/td><\/tr><tr><td>Involves the creation of a temporary off-chain state<\/td><td>Involves the creation of a temporary off-chain state<\/td><\/tr><tr><td>Faster and cheaper transactions<\/td><td>Faster and chapter payments<\/td><\/tr><tr><td>Complex compared to payment channels and may require attention to detail in order to be maintained<\/td><td>Simpler compared to state channels and can be easily maintained<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"2-rollups\"><span class=\"ez-toc-section\" id=\"2_Rollups\"><\/span>2. Rollups<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Rollups are in the form of smart contracts created on the Ethereum blockchain and they serve as the bridge between L2 and mainchain.&nbsp;<\/p>\n\n\n\n<p>How rollups work is that the transactions that are initiated on the mainchain are eventually executed in the layer 2 blockchain.&nbsp;<\/p>\n\n\n\n<p>Once a bunch of transactions has been processed and verified, they are shifted to the main chain in a block and thus they become a part of the main blockchain.&nbsp;<\/p>\n\n\n\n<p>A common type of rollups &#8211; <a href=\"https:\/\/metaschool.so\/articles\/zk-rollups-zero-knowledge-rollups\/\" target=\"_blank\" rel=\"noreferrer noopener\">zero knowledge rollups<\/a> &#8211; combine layer 2 off-chain transactions and send them to the main chain. This method provides security to the main network with a less resource-intensive rollup.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"3-plasma\"><span class=\"ez-toc-section\" id=\"3_Plasma\"><\/span>3. Plasma&nbsp;<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>A <a href=\"https:\/\/metaschool.so\/articles\/plasma-chain-ethereum-blockchain\/\" target=\"_blank\" rel=\"noreferrer noopener\">plasma chain<\/a> is a subsidiary of the Ethereum network and is connected to Ethereum Mainnet. It was introduced by the co-founder of Ethereum, <a href=\"https:\/\/metaschool.so\/articles\/vitalik-buterin-ethereum-profile\/\" target=\"_blank\" rel=\"noreferrer noopener\">Vitalik Buterin<\/a> along with Joseph Poon to scale the Ethereum network.&nbsp;<\/p>\n\n\n\n<p>Plasma chains are interoperable and are created using smart contracts and <a href=\"https:\/\/metaschool.so\/articles\/merkle-tree-blockchain\/\" target=\"_blank\" rel=\"noreferrer noopener\">Merkle trees<\/a>. It is majorly used to increase the TPS rate of the main blockchains that it is associated with. What makes it stand apart is that it can conveniently be used by any L1 blockchain using any consensus mechanism.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"4-sidechains\"><span class=\"ez-toc-section\" id=\"4_Sidechains\"><\/span>4. Sidechains&nbsp;<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>A sidechain is again a subsidiary of Ethereum and it works as a layer 2 solution for the main blockchain. Sidechains, albeit connected to the main network, can have a consensus mechanism and block parameters which can be very much different from the main blockchain.<\/p>\n\n\n\n<p>Sidechains are generally seen attached to the main blockchain via a two-way peg and <a href=\"https:\/\/metaschool.so\/blockchains\/polygon?ref=Article&amp;utm_source=Blog_Organic\" target=\"_blank\" rel=\"noreferrer noopener\">Polygon<\/a> is a great example of a network based on sidechains.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"final-words\"><span class=\"ez-toc-section\" id=\"Final_words\"><\/span>Final words<span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<p>There is no doubt that L2 blockchains have given a lot of room to L1 blockchains to bring about new features and upgrade the on-chain mechanism while not having to worry about the transaction load.&nbsp;<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>Let\u2019s not only do payments on Layer 2 but build smart contracts on it because that\u2019s actual scalability. &nbsp;<\/p><p><span style=\"color: var(--nv-text-color); font-family: var(--bodyfontfamily); font-size: var(--bodyfontsize); font-weight: var(--bodyfontweight); letter-spacing: var(--bodyletterspacing); text-transform: var(--bodytexttransform); background-color: var(--nv-site-bg);\"><\/span><\/p><cite><a href=\"https:\/\/metaschool.so\/articles\/sandeep-nailwal-polygon-profile\/\" target=\"_blank\" rel=\"noreferrer noopener\">Sandeep Nailwal<\/a>, Founder of Polygon on his plans about the scalability<br><\/cite><\/blockquote>\n\n\n\n<p>Experts believe that the interoperability of L2 networks may prove to be very beneficial to the overall user experience and that the said networks have the capability to be expanded to different arenas within the blockchain. This means that layer 2 <a href=\"https:\/\/metaschool.so\/articles\/defi-meaning\/\" target=\"_blank\" rel=\"noreferrer noopener\">DeFi<\/a>, trading, and <a href=\"https:\/\/metaschool.so\/articles\/dex-decentralized-exchange\/\" target=\"_blank\" rel=\"noreferrer noopener\">DEX<\/a> can substitute centralized finance in power, capacity, and efficiency.&nbsp;&nbsp;<\/p>\n\n\n\n<p>Layer 2 blockchain technology can open the door to multitudes of avenues for developers to tap into and revolutionize. However, they would need to be careful when it comes to layer 2 security and flexibility, two great features that make blockchain technology stand apart.<\/p>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":5453,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"neve_meta_sidebar":"","neve_meta_container":"","neve_meta_enable_content_width":"","neve_meta_content_width":0,"neve_meta_title_alignment":"","neve_meta_author_avatar":"","neve_post_elements_order":"","neve_meta_disable_header":"","neve_meta_disable_footer":"","neve_meta_disable_title":"","footnotes":""},"categories":[73],"tags":[51,74,68],"class_list":["post-2301","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-web3-crypto-glossary","tag-blockchain","tag-web3-glossary","tag-web3-words"],"_links":{"self":[{"href":"https:\/\/metaschool.so\/articles\/wp-json\/wp\/v2\/posts\/2301","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/metaschool.so\/articles\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/metaschool.so\/articles\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/metaschool.so\/articles\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/metaschool.so\/articles\/wp-json\/wp\/v2\/comments?post=2301"}],"version-history":[{"count":20,"href":"https:\/\/metaschool.so\/articles\/wp-json\/wp\/v2\/posts\/2301\/revisions"}],"predecessor-version":[{"id":5526,"href":"https:\/\/metaschool.so\/articles\/wp-json\/wp\/v2\/posts\/2301\/revisions\/5526"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/metaschool.so\/articles\/wp-json\/wp\/v2\/media\/5453"}],"wp:attachment":[{"href":"https:\/\/metaschool.so\/articles\/wp-json\/wp\/v2\/media?parent=2301"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/metaschool.so\/articles\/wp-json\/wp\/v2\/categories?post=2301"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/metaschool.so\/articles\/wp-json\/wp\/v2\/tags?post=2301"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}