The Bitcoin mainnet can only process transaction information, but the information that Layer 2 Rollup technology transmits back to the Bitcoin mainnet is not the complete transaction history, but a summary of information that has been compressed or proven, which can be directly or indirectly associated with the transaction data. The following are the main ways that the two types of Rollup interact with the Bitcoin mainnet:

ZK-Rollup (Zero-Knowledge Rollup):

ZK-Rollup uses zero-knowledge proof technology to compress the state transitions of hundreds or even thousands of transactions into a concise proof that can be verified by smart contracts on the Bitcoin network. Smart contracts only need to verify the validity of this proof without knowing the specific content of all underlying transactions. Therefore, even if the Bitcoin mainnet does not directly process these transactions, it can confirm that the transaction set occurring on the Rollup layer is legal.

Optimistic Rollup:

For the Optimistic Rollup solution in the Bitcoin ecosystem, a possible approach is to publish data such as the state root, Merkle root, or commitment of a transaction batch to the Bitcoin mainnet. These data are a generalized proof of the transaction history on Layer 2, not the details of a specific transaction. When someone disputes the state of Layer 2, the system relies on a challenge period and fraud proof mechanism to resolve the dispute, rather than re-executing transactions directly on the Bitcoin mainnet. This means that the Bitcoin mainnet only needs to process challenge statements and potential fraud proofs, rather than all Layer 2 transaction data.

In both cases, the Bitcoin mainnet does not process Layer 2 transaction data directly, but rather processes simplified information such as proofs, commitments, or Merkle roots associated with it, which ensures the security and consistency of Layer 2 without adding burden to the mainnet. At the same time, Layer 2 itself is responsible for handling most of the computing and storage requirements, greatly improving the scalability of the system.