BTC
ETH
HTX
SOL
BNB
View Market
简中
繁中
English
日本語
한국어
ภาษาไทย
Tiếng Việt

Read the data availability of Layer2 in one article

链捕手
特邀专栏作者
This article is about 5091 words, reading the full article takes about 8 minutes
What exactly does Layer 2 data availability mean?
AI Summary
Expand
What exactly does Layer 2 data availability mean?

first level title

Original title: "Data Availability in Layer-2 Blockchains》

Compilation of the original text: Lynch, Chain Catcher

Blockchain Data Availability

The latest Ethereum sharding roadmap prioritizes data sharding over execution sharding, resulting in a significant increase in Ethereum data throughput. Additionally, Modular Blockchain delves into Rollup, volitions and validity, and data availability solutions. These are the latest discussions and trends in blockchain data availability.

Anyone involved in the blockchain and cryptocurrency space is probably wondering what blockchain data availability means in this context.

first level title

Getting started with blockchain nodes

The data structure of the blockchain contains a blockchain, and each block in the blockchain consists of two parts: a block header and a list of transaction data.

  • The block header is the metadata of the block, which contains some basic information of the block, such as the Merkle root of the transaction.

  • The blocks in the transactions section contain the actual transactions.

Data Availability Issues

Data Availability Issues

The issue of data availability is the blockchain trilemma: security, scalability, and decentralization.

first level title

Attacks on Data Availability

A blockchain data availability attack occurs when a rogue node broadcasts block headers but retains partial blocks containing erroneous transactions.While honest full nodes that can download and store the entire blockchain know that some data is not available, they lack a formal mechanism to prove this to light nodes with limited resources and no access to the entire blockchain data. Therefore, both sidechain and sharded blockchain strategies are vulnerable to data availability attacks. A rogue node on the sidechain network (or shard) submits the hash of the block to the trusted blockchain without transmitting the block data to other nodes in this attack.

Data availability attacks are a well-known problem in the blockchain field, originally proposed in the context of blockchain light clients. Vitalik later popularized it. All light nodes do is store block headers and verify pow requirements. They rely on full nodes to validate blocks and provide proof of fraud in incorrect blocks.

In the case of light nodes, data availability attacks are not fatal. Typically, miners also operate on full nodes. If a block is not available, they ignore it and mine simultaneously (i.e. on its parent block). No honest miner will build on a block as long as the block is inaccessible. It will eventually break off the longest chain. At this time, light nodes will automatically ignore such blocks. This attack is even more important when it comes to secondary blockchains and shards.

Data Availability Issues

Data Availability Issues

The problem of data availability in blockchains poses the following question: How can a node determine that when a new block is created, all the data contained in it is actually broadcast to the network? How do peer nodes in a blockchain network determine that all data related to a newly proposed block is indeed available?

first level title

Addressing Data Availability Attacks

In a modular blockchain, a separate way of ensuring data availability in a modular blockchain is critical due to the decoupling of verification and data availability. Rollups provide transaction proofs and compute new states off-chain, but still require certain transaction data to be published on-chain to prevent data availability issues. ZK-rollups mainly publish three key data bits to the main chain:

  • A cryptographic commitment to the new state (root hash)

  • Cryptographic proofs (such as ZK-SNARKs) establish that the new state is the result of applying valid transactions to the initial state.

  • Provide a small piece of data for each transaction in the batch in the form of calldata

first level title

Blockchain's Data Availability Layer

The data layer of the blockchain is used both for the data structure of the blockchain and for physical storage.Blockchain ledgers are designed using lists of interconnected blocks, or Merkle trees, encrypted using asymmetric encryption methods. The data layer consists of the following parts:

Block: A block is a data structure used to group transactions into groups and distribute them among network nodes. Mining is the process of generating blocks. Each block has a block header, which is metadata that can verify the legitimacy of the block.

Merkel Tree and transactions:In a blockchain, transactions are maintained as part of a Merkel Tree. Merkel Tree aggregates all transactions in a block by generating a digital fingerprint of the complete set of transactions, allowing users to determine whether a transaction is included. Each leaf node has the transaction's data, while each non-leaf node contains a hash of its previous hash. Merkel Tree is binary and requires an odd number of leaf nodes. If there is an odd number of transactions, the final hash is copied once to generate an even number of leaf nodes.

Network layer:Blockchain uses a distributed network that allows anyone to download and interact with all the information on the blockchain. Peer-to-peer (P2P) networks distribute/broadcast transactions across nodes. Blockchain platforms primarily utilize three types of networks: centralized, decentralized, and distributed.

physical layer:This layer includes servers, edge nodes, and Internet of Things (IoT) devices that operate as nodes on the blockchain network. These are usually connected via a peer-to-peer network. A node can be any active electronic device, such as a computer, phone, or printer, as long as it is connected to the network and has an IP address.

virtual layer:A virtualization layer that sits on top of the hardware to allocate hardware and resources to virtual machines.

Consensus layer:This layer is responsible for enforcing network rules that specify how nodes within the network should react in order to establish consensus on broadcast transactions.

Incentive layer:This layer participates in the activities of nodes in the distributed network to strive to achieve consensus and obtain incentives. Whether this layer is used is determined by the consensus mechanism used by the blockchain protocol.

Contract layer:Consists of services and optional components that enable blockchain platforms to integrate with other technologies, such as data feeds, smart contracts, oracles, DAOs, and state channels.

API layer:Provides APIs on top of the blockchain and provides mechanisms for third-party applications to communicate with ledgers and smart contracts.

Application layer:first level title

Traditional Data Availability Solutions

Traditional data availability solutions aim to improve scalability by changing the underlying data transmission protocol of the blockchain and basic blockchain protocols such as block data structures, consensus algorithms, and incentive mechanisms. These solutions include Layer1 scaling solutions such as Segregated Witness, DAG, Sharding and Consensus. Layer 2 solutions, however, aim to improve scalability through an off-chain approach at the application layer.

Segregated Witness:Features protocol enhancements that have been deployed to prevent transaction malleability and increase block size.

DAG:Transactions are connected in a DAG, which means that one transaction validates the next transaction. Each node consists of many transaction levels. When a transaction is registered with a node, it must first verify two other transactions. These two trades were selected using a mathematical process. Then, the node must verify that the two transactions do not conflict. In order to verify a transaction, a node must solve a cryptographic puzzle (pow) similar to that on the Bitcoin network.

Fragmentation:A blockchain can be sharded into multiple chains to increase throughput. Each shard has its own block producers and can communicate to exchange tokens. Instead of each block producer processing every transaction, sharding divides the processing power of the network into shards that only process specific transactions. Therefore, non-sharded blockchains typically have one or two fully functional full nodes and one or more light clients. It is worth noting that sharding aims to distribute network resources across different nodes.

consensus:first level title

ZKRollups solution

There are currently some Ethereum Layer2 solutions, such as optimistic rollups, ZK rollups, and Validiums. These solutions move execution off-chain while ensuring application validation and data availability on-chain. While an architecture based on off-chain execution improves throughput, it is still limited by the amount of data that the main chain can handle. While execution is off-chain, the verification or dispute resolution process must be on-chain. Transaction data is submitted as calldata on Ethereum to ensure the data is available for future reconstruction. This is extremely important.

For optimistic rollups, operators may submit invalid transactions and then suppress some blocks. In this way, other full nodes in the system will not be able to verify whether the submitted claims are correct. Due to the lack of data, they will not be able to provide any proof of fraud that the claim is indeed invalid.

In the case of zero-knowledge based roll-ups, the integrity of the ZKP ensures that accepted transactions are valid. However, even when such assurances exist, not disclosing the data supporting the transaction can have serious negative consequences. This can lead to other validators being unable to calculate the current state of the system, users being excluded from the system, and their balances being frozen.

Data on the chain

Data on the chain

Blockchains generate large amounts of data from hash rate and other related activities such as transactions.

What do we mean when we talk about on-chain data? In short: all data stored natively on the blockchain is on-chain data.

On-chain data refers to all transactions that have occurred on a particular blockchain network. Or in other words, all the data that has been written to the blockchain block. The information of the public chain has the characteristics of public access. There are three main categories in terms of data.

  • Specifications for each block (timestamp, gas fee, miner, block size, etc.)

  • Each transaction is very detailed ("sender" and "receiver" addresses, amount transferred in the transaction, etc.)

  • Call and use of smart contracts

first level title

off-chain data

For Bitcoin users, off-chain and on-chain transactions have their pros and cons. Scalability is a limitation of blockchain technology that can be addressed with off-chain solutions. The confirmation time of on-chain transactions may vary due to network congestion. Off-chain transactions are executed instantly, transaction costs are also cheaper, and some transactions do not incur any fees until they are on-chain. Off-chain transactions are also more private because the details of the transactions are separated from the main chain and not publicly disclosed.

Some blockchain tools, especially smart contracts, rely on blockchain-based triggers and real-world data to verify conditions and execute contracts. For example, a smart legal contract that transfers title to land. The funds required to purchase a property are escrowed by a smart contract that requires verification of real-world property facts, similar to an actual deed transfer. However, if the blockchain cannot retrieve data, such as a third-party confirmed deed transfer, how can the criteria of a smart contract be met to release the seller's funds. For off-chain data; this data provides smart contracts with real-world information to successfully execute contracts and buy and sell. With the continuous development of blockchain and cryptocurrencies, off-chain solutions may become a permanent solution, but only time is the only criterion to test it.

with the help ofZKCrossProtocols that support cross-chain interoperability with multi-chain ZKRollups and cross-chain layer technologies will enhance the availability of on-chain and off-chain data.ZKcross creates a ubiquitous layer to act as a cross-chain Layer2, and ZKcross keeps track and synchronization of global state changes on multiple blockchains.Summarize

Summarize

We are on the eve of a massive paradigm shift that will change the Bitcoin ecosystem forever. ZK-Rollups will scale Ethereum in the most efficient way possible. This paradigm change will be so profound that it effectively marks the death of all other L1 smart contract chains, including Ethereum as we know it today. There are several debates about scalability. Thousands of hours of research, implementations, successes and failures went into creating ZK-Rollups.

Of course, the effort is far from over. While the road ahead is bumpy, purpose has never been more apparent. Since current monolithic blockchain architectures are still surprisingly inefficient, and under the constrained trilemma, increasing throughput means decreasing security and/or decentralization. The special modular design divides the execution into different execution layers, such as ZKrollups, which increases the efficiency of the blockchain industry by 100 times to 10,000 times. Without a doubt, this is the only way to scale it to global pervasiveness and millions of TPS. Furthermore, it is expected that within a few years, more than 90% of all blockchain activity will occur on zkRollups without significant impact on security or decentralization.

ETH
Layer 2
Welcome to Join Odaily Official Community