Lição 2

Boba Network Architecture

This module introduces and demonstrates the architecture of BOBA, focusing on Optimistic Rollups, which is a core scaling mechanism of the BOBA Network, enabling efficient mitigation of congestion issues on Ethereum and other Layer-1 blockchains.

The role of Optimistic Rollups in the Boba Network

Optimistic Rollups is a scaling mechanism used by Boba Network to alleviate congestion on Ethereum and other Layer-1 blockchains. In traditional Layer-1 transaction processing, each transaction needs to be processed individually, while Optimistic Rollups aggregates multiple transactions for off-chain processing and submits the results to the Layer-1 blockchain in batches. This approach significantly reduces the load on the mainnet and improves network processing efficiency.

The core principle of Optimistic Rollups is to assume that all transactions are valid unless there is evidence to prove otherwise. This is in contrast to other verification methods, such as Zero-Knowledge Rollups (ZK-Rollups), which verify each transaction in advance. Although this mechanism may seem counterintuitive, Optimistic Rollups introduce a challenge period during which participants can question any potential fraudulent transactions through a process called fraud-proofing. Typically, this challenge period lasts for seven days, reducing the resources required for continuous verification while ensuring the trust and security of the system.

Boba Network uses this model to handle off-chain computing and improve transaction throughput, enabling the network to provide a highly scalable environment for decentralized applications (dApps). Compared to Layer-1, Boba's transaction costs can be reduced by up to 100 times, and transaction processing is faster.

Optimistic Rollups also have compatibility with existing Ethereum smart contracts, and developers only need to make minimal changes to migrate their applications from Ethereum to Boba's Layer-2.

Boba Network's off-chain computation and transaction batching

One of the key features of Layer-2 solutions (such as Boba Network) is its off-chain computation capability. By moving some of the computation work off-chain, it can effectively reduce the burden on the Ethereum mainnet. This feature is one of the main reasons why Boba and other networks utilizing these technologies can significantly reduce gas fees and improve transaction speed.

After transactions are processed off-chain in batches, Boba submits the results to the Ethereum mainnet in batches. This not only reduces the need for each transaction to be processed directly on Layer-1, but also greatly improves the efficiency of the overall network. Thanks to these mechanisms, Boba is able to provide a more efficient and cost-effective solution for decentralized applications (dApps).

The technical principle of Boba Network

  • Off-chain processing: On the Boba Network, most transactions are processed off-chain. Signature verification, state variable updates, and transaction logic processing are not done on the main blockchain, but off-chain. These computation results are aggregated and the final result is submitted to Ethereum, achieving network scalability while maintaining lower costs.
  • Batch processing mechanism: Boba uses batch processing to improve the efficiency of transaction submission. Unlike submitting transactions to Ethereum one by one, Boba aggregates multiple transactions for off-chain processing, and then submits the batch processing results to Ethereum all at once. This method reduces gas fees and increases the number of transactions that can be processed per second.
  • Generation and Verification of State Roots: When the batch processing results are submitted to Ethereum, a post-state root, which is an encrypted hash value representing the new system state after processing the batch of transactions, is generated. Validators on Ethereum can verify this state root to confirm that all transactions in the batch have been processed correctly. If validators discover any issues, they can initiate challenges through the fraud-proof mechanism to ensure the accuracy of transactions and the security of the system.

HybridCompute™

HybridCompute is an innovative technology of the Boba Network, which extends the concept of off-chain computation, enabling smart contracts to interact with off-chain data and APIs. This feature supports more complex applications, such as running machine learning algorithms off-chain while triggered by on-chain events. For example, a DeFi application can obtain real-time stock prices or other financial data through external APIs, perform complex calculations off-chain, and then return the results on-chain.

In HybridCompute mode, dApps deployed on Boba are able to initiate requests, have the required data processed by off-chain servers, and return results in an Ethereum-compatible format. These results are then passed back to the smart contract, enabling advanced computation while avoiding burdening the blockchain.

This ability is unique to the Boba Network, providing it with computational flexibility that is not commonly seen in other Layer-2 solutions, greatly expanding the development potential of decentralized applications.

The role of Sequencers and Fraud Proof Mechanism in security

The Sequencer in Boba Network is responsible for sorting transactions, ensuring transactions are processed in the correct order, and providing fast transaction confirmation. The Sequencer essentially operates as a centralized service, but is still governed by the rules and protocols of the Layer-2 system. Although a centralized mechanism is currently being used, this is temporary as the system's design has considered future governance models, and the Sequencer will eventually be managed by a decentralized mechanism.

This architecture takes into account both the current performance requirements and the future decentralized goals. Even during the existence of the centralized Sequencer, Boba Network ensures the security of transactions through fraud proofs. If any transaction is found to be illegal or erroneous, validators can initiate fraud proofs to challenge the processing results of the Sequencer, thus maintaining the security and trust of the system.

How Sequencer works:

  1. Receiving and Batch Processing Transactions:
    Sequencer receives off-chain transactions from users and groups those transactions into batches. Sequencer is responsible for ensuring that these transactions are correctly sequenced according to the time they were received.

  2. Submit to Ethereum and ensure finality:
    Once the sorting is completed, the Sequencer will submit the transaction batch to the Ethereum Layer-1 to ensure the finality of the transaction. Finality means that the transaction is considered immutable unless revoked by a hard fork.

  3. Fraud-Proof Period
    After the transaction batch is submitted, there is usually a seven-day proof-of-fraud period, during which anyone can question the validity of the transaction.

  4. If a malicious or invalid transaction is detected, the disputing party can submit a fraud proof.

  5. Fraud proof verifies whether the result of a disputed transaction on the Ethereum mainnet is consistent with the result submitted by the Sequencer.
  6. If the result does not match, the invalid transaction will be rolled back and the system will recover to the previous valid state.
  7. Rollback & State Recovery:
    If the fraud is proven, the system will roll back the invalid transaction and restore it to the previous valid state.

Boba Network's exit mechanism: Standard Exit and Quick Exit Bridge

In Layer-2 solutions, a major challenge is to achieve an efficient fund withdrawal mechanism that allows users to transfer funds from Layer-2 back to Layer-1. Boba Network handles this process through two main methods: standard exit and fast-exit bridge.

Standard Exit

In the standard withdrawal process, when users want to withdraw assets from Boba back to Ethereum, they need to initiate a withdrawal request. However, due to the seven-day fraud proof period, users must wait for the entire cycle to complete before the assets can be transferred back to Layer-1. This delay period ensures that there is enough time to detect and resolve any fraudulent activities in the transaction batch.

Note:This exit method is the default for most Optimistic Rollup systems. Although it can ensure the security of transactions, it may be inconvenient for users who need to access funds immediately.

Fast-Exit Bridge

To solve the delay issue in standard exits, Boba introduces the fast-exit bridge, which allows users to bypass the seven-day waiting period and instantly access funds through liquidity providers.

Principle of operation:

  • Liquidity providers will advance users' assets so that they can withdraw them from Layer-2 immediately.
  • In return, liquidity providers charge a small fee and are repaid after the fraud proof period ends and the withdrawal is finalized by Layer-1.
  • During this period, liquidity providers assume certain risks, which may result in issues with their advanced funds if fraudulent transactions are detected.
    This method significantly improves user experience, providing users with almost instant access to funds while ensuring the security and efficiency of the system.

ZK-Rollups and Sidechains
While Optimistic Rollups are the core technology in the Boba Network architecture, it is also important to compare them to other Layer-2 solutions such as Zero-Knowledge Rollups and sidechains.

ZK-Rollups
There is a fundamental difference in the way ZK-Rollups and Optimistic Rollups verify transactions. ZK-Rollups do not assume that all transactions are valid, but instead verify the validity of each transaction by generating zero-knowledge proofs before submitting them to Layer-1 for validation. This approach eliminates the need for fraud-proof cycles and allows transactions to be confirmed more quickly. However, ZK-Rollups require higher computational costs because generating these cryptographic proofs requires a lot of processing power.

Although ZK-Rollups have advantages in privacy and transaction confirmation speed, they are usually more complex and less flexible than Optimistic Rollups, especially challenging for developers who want to migrate their Ethereum dApp to Layer-2.

sidechains
Sidechains are networks that operate independently of Layer-1 networks like Ethereum. Unlike Rollups, sidechains use their own consensus mechanisms and validators, which means they do not inherit Ethereum's security. While sidechains can offer high throughput and low transaction costs, there are also significant security trade-offs. If a sidechain's validator set is attacked, the entire sidechain will be at risk; whereas Rollups like Boba rely on Ethereum's finality and fraud proofs to ensure security.

Boba Network has implemented a well-designed Layer-2 scaling solution through Optimistic Rollups. It reduces Ethereum's computational burden by assuming transaction validity, while maintaining decentralization and security.

Highlights

  • Transaction processing: Optimistic Rollups process multiple transactions off-chain, and then bundle them for submission to Layer-1, thereby reducing the load on Ethereum.
  • Validity assumption: The system assumes that transactions are valid unless proven otherwise, which is different from the way ZK-Rollups require pre-validation of each transaction.
  • Fraud proof mechanism: A seven-day fraud proof period allows participants to raise questions about suspicious transactions, ensuring security while reducing verification burdens.
  • HybridCompute Feature: Boba's HybridCompute enables dApps to perform complex computations using off-chain data and APIs without burdening the blockchain.
  • Exit Mechanism for Assets: BOBA provides standard and fast exit options, making it easy for users to withdraw assets from Layer-2 to Layer-1, improving liquidity and optimizing user experience.
Exclusão de responsabilidade
* O investimento em criptomoedas envolve riscos significativos. Prossiga com cuidado. O curso não pretende ser um conselho de investimento.
* O curso é criado pelo autor que se juntou ao Gate Learn. Qualquer opinião partilhada pelo autor não representa o Gate Learn.
Catálogo
Lição 2

Boba Network Architecture

This module introduces and demonstrates the architecture of BOBA, focusing on Optimistic Rollups, which is a core scaling mechanism of the BOBA Network, enabling efficient mitigation of congestion issues on Ethereum and other Layer-1 blockchains.

The role of Optimistic Rollups in the Boba Network

Optimistic Rollups is a scaling mechanism used by Boba Network to alleviate congestion on Ethereum and other Layer-1 blockchains. In traditional Layer-1 transaction processing, each transaction needs to be processed individually, while Optimistic Rollups aggregates multiple transactions for off-chain processing and submits the results to the Layer-1 blockchain in batches. This approach significantly reduces the load on the mainnet and improves network processing efficiency.

The core principle of Optimistic Rollups is to assume that all transactions are valid unless there is evidence to prove otherwise. This is in contrast to other verification methods, such as Zero-Knowledge Rollups (ZK-Rollups), which verify each transaction in advance. Although this mechanism may seem counterintuitive, Optimistic Rollups introduce a challenge period during which participants can question any potential fraudulent transactions through a process called fraud-proofing. Typically, this challenge period lasts for seven days, reducing the resources required for continuous verification while ensuring the trust and security of the system.

Boba Network uses this model to handle off-chain computing and improve transaction throughput, enabling the network to provide a highly scalable environment for decentralized applications (dApps). Compared to Layer-1, Boba's transaction costs can be reduced by up to 100 times, and transaction processing is faster.

Optimistic Rollups also have compatibility with existing Ethereum smart contracts, and developers only need to make minimal changes to migrate their applications from Ethereum to Boba's Layer-2.

Boba Network's off-chain computation and transaction batching

One of the key features of Layer-2 solutions (such as Boba Network) is its off-chain computation capability. By moving some of the computation work off-chain, it can effectively reduce the burden on the Ethereum mainnet. This feature is one of the main reasons why Boba and other networks utilizing these technologies can significantly reduce gas fees and improve transaction speed.

After transactions are processed off-chain in batches, Boba submits the results to the Ethereum mainnet in batches. This not only reduces the need for each transaction to be processed directly on Layer-1, but also greatly improves the efficiency of the overall network. Thanks to these mechanisms, Boba is able to provide a more efficient and cost-effective solution for decentralized applications (dApps).

The technical principle of Boba Network

  • Off-chain processing: On the Boba Network, most transactions are processed off-chain. Signature verification, state variable updates, and transaction logic processing are not done on the main blockchain, but off-chain. These computation results are aggregated and the final result is submitted to Ethereum, achieving network scalability while maintaining lower costs.
  • Batch processing mechanism: Boba uses batch processing to improve the efficiency of transaction submission. Unlike submitting transactions to Ethereum one by one, Boba aggregates multiple transactions for off-chain processing, and then submits the batch processing results to Ethereum all at once. This method reduces gas fees and increases the number of transactions that can be processed per second.
  • Generation and Verification of State Roots: When the batch processing results are submitted to Ethereum, a post-state root, which is an encrypted hash value representing the new system state after processing the batch of transactions, is generated. Validators on Ethereum can verify this state root to confirm that all transactions in the batch have been processed correctly. If validators discover any issues, they can initiate challenges through the fraud-proof mechanism to ensure the accuracy of transactions and the security of the system.

HybridCompute™

HybridCompute is an innovative technology of the Boba Network, which extends the concept of off-chain computation, enabling smart contracts to interact with off-chain data and APIs. This feature supports more complex applications, such as running machine learning algorithms off-chain while triggered by on-chain events. For example, a DeFi application can obtain real-time stock prices or other financial data through external APIs, perform complex calculations off-chain, and then return the results on-chain.

In HybridCompute mode, dApps deployed on Boba are able to initiate requests, have the required data processed by off-chain servers, and return results in an Ethereum-compatible format. These results are then passed back to the smart contract, enabling advanced computation while avoiding burdening the blockchain.

This ability is unique to the Boba Network, providing it with computational flexibility that is not commonly seen in other Layer-2 solutions, greatly expanding the development potential of decentralized applications.

The role of Sequencers and Fraud Proof Mechanism in security

The Sequencer in Boba Network is responsible for sorting transactions, ensuring transactions are processed in the correct order, and providing fast transaction confirmation. The Sequencer essentially operates as a centralized service, but is still governed by the rules and protocols of the Layer-2 system. Although a centralized mechanism is currently being used, this is temporary as the system's design has considered future governance models, and the Sequencer will eventually be managed by a decentralized mechanism.

This architecture takes into account both the current performance requirements and the future decentralized goals. Even during the existence of the centralized Sequencer, Boba Network ensures the security of transactions through fraud proofs. If any transaction is found to be illegal or erroneous, validators can initiate fraud proofs to challenge the processing results of the Sequencer, thus maintaining the security and trust of the system.

How Sequencer works:

  1. Receiving and Batch Processing Transactions:
    Sequencer receives off-chain transactions from users and groups those transactions into batches. Sequencer is responsible for ensuring that these transactions are correctly sequenced according to the time they were received.

  2. Submit to Ethereum and ensure finality:
    Once the sorting is completed, the Sequencer will submit the transaction batch to the Ethereum Layer-1 to ensure the finality of the transaction. Finality means that the transaction is considered immutable unless revoked by a hard fork.

  3. Fraud-Proof Period
    After the transaction batch is submitted, there is usually a seven-day proof-of-fraud period, during which anyone can question the validity of the transaction.

  4. If a malicious or invalid transaction is detected, the disputing party can submit a fraud proof.

  5. Fraud proof verifies whether the result of a disputed transaction on the Ethereum mainnet is consistent with the result submitted by the Sequencer.
  6. If the result does not match, the invalid transaction will be rolled back and the system will recover to the previous valid state.
  7. Rollback & State Recovery:
    If the fraud is proven, the system will roll back the invalid transaction and restore it to the previous valid state.

Boba Network's exit mechanism: Standard Exit and Quick Exit Bridge

In Layer-2 solutions, a major challenge is to achieve an efficient fund withdrawal mechanism that allows users to transfer funds from Layer-2 back to Layer-1. Boba Network handles this process through two main methods: standard exit and fast-exit bridge.

Standard Exit

In the standard withdrawal process, when users want to withdraw assets from Boba back to Ethereum, they need to initiate a withdrawal request. However, due to the seven-day fraud proof period, users must wait for the entire cycle to complete before the assets can be transferred back to Layer-1. This delay period ensures that there is enough time to detect and resolve any fraudulent activities in the transaction batch.

Note:This exit method is the default for most Optimistic Rollup systems. Although it can ensure the security of transactions, it may be inconvenient for users who need to access funds immediately.

Fast-Exit Bridge

To solve the delay issue in standard exits, Boba introduces the fast-exit bridge, which allows users to bypass the seven-day waiting period and instantly access funds through liquidity providers.

Principle of operation:

  • Liquidity providers will advance users' assets so that they can withdraw them from Layer-2 immediately.
  • In return, liquidity providers charge a small fee and are repaid after the fraud proof period ends and the withdrawal is finalized by Layer-1.
  • During this period, liquidity providers assume certain risks, which may result in issues with their advanced funds if fraudulent transactions are detected.
    This method significantly improves user experience, providing users with almost instant access to funds while ensuring the security and efficiency of the system.

ZK-Rollups and Sidechains
While Optimistic Rollups are the core technology in the Boba Network architecture, it is also important to compare them to other Layer-2 solutions such as Zero-Knowledge Rollups and sidechains.

ZK-Rollups
There is a fundamental difference in the way ZK-Rollups and Optimistic Rollups verify transactions. ZK-Rollups do not assume that all transactions are valid, but instead verify the validity of each transaction by generating zero-knowledge proofs before submitting them to Layer-1 for validation. This approach eliminates the need for fraud-proof cycles and allows transactions to be confirmed more quickly. However, ZK-Rollups require higher computational costs because generating these cryptographic proofs requires a lot of processing power.

Although ZK-Rollups have advantages in privacy and transaction confirmation speed, they are usually more complex and less flexible than Optimistic Rollups, especially challenging for developers who want to migrate their Ethereum dApp to Layer-2.

sidechains
Sidechains are networks that operate independently of Layer-1 networks like Ethereum. Unlike Rollups, sidechains use their own consensus mechanisms and validators, which means they do not inherit Ethereum's security. While sidechains can offer high throughput and low transaction costs, there are also significant security trade-offs. If a sidechain's validator set is attacked, the entire sidechain will be at risk; whereas Rollups like Boba rely on Ethereum's finality and fraud proofs to ensure security.

Boba Network has implemented a well-designed Layer-2 scaling solution through Optimistic Rollups. It reduces Ethereum's computational burden by assuming transaction validity, while maintaining decentralization and security.

Highlights

  • Transaction processing: Optimistic Rollups process multiple transactions off-chain, and then bundle them for submission to Layer-1, thereby reducing the load on Ethereum.
  • Validity assumption: The system assumes that transactions are valid unless proven otherwise, which is different from the way ZK-Rollups require pre-validation of each transaction.
  • Fraud proof mechanism: A seven-day fraud proof period allows participants to raise questions about suspicious transactions, ensuring security while reducing verification burdens.
  • HybridCompute Feature: Boba's HybridCompute enables dApps to perform complex computations using off-chain data and APIs without burdening the blockchain.
  • Exit Mechanism for Assets: BOBA provides standard and fast exit options, making it easy for users to withdraw assets from Layer-2 to Layer-1, improving liquidity and optimizing user experience.
Exclusão de responsabilidade
* O investimento em criptomoedas envolve riscos significativos. Prossiga com cuidado. O curso não pretende ser um conselho de investimento.
* O curso é criado pelo autor que se juntou ao Gate Learn. Qualquer opinião partilhada pelo autor não representa o Gate Learn.