RBBV – Rede Brasileira de Blogueiros de Viagem

Saiba mais sobre a nossa rede e navegue por centenas de destinos de viagem nos nossos blogs

Arquivos Mensais:fevereiro 2024

What Are Ethereum Layer 2 Blockchains and How Do They Work?

por Diego Engel


what is layer 2

More sophisticated error detection and correction algorithms are designed to reduce the risk that multiple transmission errors in the data would cancel each other out and go undetected. An algorithm that can even detect if the correct bytes are received but out of order is the cyclic redundancy check or CRC. In addition to framing, the data link layer may also detect and recover from transmission errors. For a receiver to detect transmission errors, the sender must add redundant information as an error detection code to the frame sent. When the receiver obtains a frame it verifies whether the received error detection code matches a recomputed error detection code. Many decentralized applications run on Layer 2 protocols for scalability reasons.

What is a Layer 2 Blockchain?

In the context of validators, a full-functioning zk-rollup effectively makes it impossible for faulty or malicious transactions to be settled on the base chain, as every batch must have a corresponding validity proof. This is what it means to inherit the decentralization and security guarantees of the underlying blockchain. The payment channel handles the majority of the computation and execution off-chain, but in the case that consensus is needed to settle the channel, the robust consensus layer of an underlying blockchain makes the ultimate decision.

Layer 1 vs. Layer 2: The Difference Between Blockchain Scaling Solutions

  1. It will be a slow process for major crypto blockchain networks to improve their scalability.
  2. As previously mentioned, layer 2s inherent the security guarantees and decentralization of their underlying blockchain.
  3. They are also much cheaper because users only need to pay a fee to the L1 when locking their funds in a smart contract to open the channel, and when submitting the final balances to the L1 in order to close the channel.
  4. In short, it allows for faster and cheaper transactions than its parent blockchain.
  5. ImmutableX is a zk-rollup scaling solution focused on non-fungible tokens (NFTs) and Web3 games.

Both offer different approaches for the Ethereum mainnet (consensus layer) to confirm the true state of operations on the execution layers (i.e., account balances and total values in each L2) without the need to validate every single transaction. With the multisig approach, each user holds a portion of the private keys to a wallet that stores their locked funds and mediates transactions within the payment channel. This ensures that both parties must provide a digital signature to authorize funds to be spent from that wallet. They are also much cheaper because users only need to pay a fee to the L1 when locking their funds in a smart contract to open the channel, and when submitting the final balances to the L1 in order to close the channel. Each layer 1 blockchain on a layer 0 can potentially operate its own set of L2 networks in order to scale its underlying infrastructure. A layer 0 is a type of protocol that enables developers to launch multiple layer 1 blockchains that are connected to the L0 mainchain, but operate independently.

Blockchain Gaming

But having an extended, decentralized set of validators and a trusted reputation lends itself to creating targeted Layer 2 solutions. Instead of requiring computing power to mine the next block in a crypto blockchain, PoS uses a lottery system to award block recording to stakers, and increases the processing power of the blockchain in return. Three desirable properties of a blockchain are that it is decentralized, secure, and scalable. The blockchain trilemma(opens in a new tab) states that a simple blockchain architecture can only achieve two out of three. An error detection code can be defined as a function that computes the r (amount of redundant bits) corresponding to each string of N total number of bits. The simplest error detection code is the parity bit, which allows a receiver to detect transmission errors that have affected a single bit among the transmitted N + r bits.

Off-Chain Execution

The upsides to L2s offering this more restricted, “application specific” functionality are technical simplicity and potentially better performance (which means lower fees). At any point, the proper owner of funds on L2 can use the bridge to “withdraw” their funds back to L1. An L2 user shouldn’t have to trust any designated parties to ensure that they have this withdrawal guarantee; in other words, fund security comes from the base layer blockchain itself. When we talk about the blockchain’s “Layer 1,” with the core properties of decentralization and disintermediation, we are referring to blockchain networks like Bitcoin BTC and Ethereum ETH. These systems use distributed ledgers (blockchains) to enable digital asset ownership and transfers without relying on any third parties. Since no trusted third parties are required, anybody can run the L1 software with a personal node, using a personal laptop or Raspberry Pi device.

These networks feature many of the most popular dapps on the Ethereum blockchain, including Uniswap, Opensea, the Sandbox and more. Optimistic and zk-Rollups are 2 variations of the rollup technique that each take a different approach to securely and accurately submitting state data from the L2 to the L1 without the need for the L1 to validate every single L2 transaction. Meaning, in the event of an exploit, users will always be able to recover their funds based on the most recent state of the L2 network that was validated on the Ethereum mainnet. Zero-Knowledge Rollups or zk-Rollups enable thousands of layer 2 transactions to be bundled into one transaction, and then be transmitted and validated by the Ethereum network without the Ethereum nodes knowing the details of each transaction. While sidechains are not required to submit state data to the mainchain, many still choose to do so in order to leverage the larger, more decentralized chain’s security. They enable participants to conduct more complex operations than sending simple payments back and forth.

what is layer 2

Optimistic rollups submit transaction data to the Ethereum network and leverage a dispute resolution system for detecting fraudulent transactions to ensure that all submitted transactions are valid. A payment channel is a two way channel that runs between 2 participants and exists entirely off-chain. Two users can form a payment channel by each locking a certain amount of tokens in a smart contract on-chain. On a blockchain, every transaction is a separate gift and is delivered in a separate box. This makes shipping expensive as you have to pay a shipping fee every time you want to send a gift.

Then, when you close the channel, the supermarket’s system would process all of your transactions together. There are a multitude of layer 2 blockchain solutions https://cryptolisting.org/ and each of them have their advantages and disadvantages. Along with fast transactions, ImmutableX aims to offer gas-free, carbon-neutral NFT minting.

In this way, the L1 acts as the ultimate judge, enforcing the L2’s rules when necessary. When transacting on these side-streets, traders and other cryptocurrency users benefit from cheap and timely transactions. As previously mentioned, layer 2s inherent the security guarantees and decentralization of their underlying blockchain. This is elaborated on below, but the core idea is that layer 2s must provide a form of proof to their underlying blockchain that their proposed state changes are valid.

To close out the channel, a user can submit the latest state update (i.e the final balance of both users accounts) to the L1, which validates this entry as a single transaction on the blockchain. Alice and Bob create a payment channel by locking up collective funds in a smart contract and agreeing (through cryptographic signatures) how much how to mine bitcoins using your own computer each has access to. For example, if both locked up $50 of funds for a total of $100, they would most likely agree that each gets to use $50 each in the payment channel. Sharding is similar to database partitioning, allowing a blockchain database to be broken up into smaller parts so that transactions can be processed simultaneously.

The TCP/IP model is not a top-down comprehensive design reference for networks. It was formulated for the purpose of illustrating the logical groups and scopes of functions needed in the design of the suite of internetworking protocols of TCP/IP, as needed for the operation of the Internet. In general, direct or strict comparisons of the OSI and TCP/IP models should be avoided, because the layering in TCP/IP is not a principal design criterion and in general, considered to be “harmful” (RFC 3439). In particular, TCP/IP does not dictate a strict hierarchical sequence of encapsulation requirements, as is attributed to OSI protocols.

A more technically accurate explanation is that rollups batch raw transaction data as calldata. However, the core logic is still the same—one batched transaction on the main chain stores data regarding multiple rollup transactions. Once the payment channel is set up, Alice and Bob are free to transact off-chain via signed messages without submitting transactions to the underlying blockchain. Alice can pay Bob, and vice versa, at zero cost and lightning-fast latencies.

The limits of Layer 2 solutions are still being established, but the broad picture is clear. Layer 2 blockchains offer a practical way to manage smaller crypto value transactions, without compromising a parent chain’s underlying security. Simply, they use creative approaches to handling transaction data, which saves the user time and money. But Layer 2 blockchains are just one example of the web3 innovation taking place. With Ethereum’s 8th birthday coming up on July 30th, Web3 has certainly come a long way.