Layer 2 Game Chain Core Tech


Layer 2 Game Chain Core Tech

Overview

Application Specific Layer 2 as Rollup is to use a rollup (OPRollup) as the game application chain and BNB Smart Chain (BSC) or Ethereum as the settlement layer. OPRollup is a layer 2 scaling solution that allows for fast and cheap transactions that periodically settle on Layer1 chains.

Semita OPRollupopen in new window based Combo chain is an optimized gaming solution based on OPStackopen in new window tailored for game developers. First, the rollup game chain is EVM compatible. And this all-in-one platform collaborates with ecosystem partners to provide a seamless and comprehensive development experience for those creating games.

By executing a large number of transactions off-chain and then bundling them into a single on-chain transaction, OPRollup significantly improves transaction throughput and lowers costs. This enables faster and more affordable in-game transactions, resulting in a more seamless gaming experience for players.

Moreover, OPRollup supports smart contracts, allowing for the creation of complex in-game mechanics, interactions, and economies. This empowers game developers to build rich gaming experiences with a high level of customization and automation.

Modular Design

Combo OPRollups are built on the solid foundation of modular OPStackopen in new window. It serves as the cornerstone of NodeReal's Semita Optimistic-as-a-Service solution, which is based on the super powerful OP Stack Designed with modularity at its core; this approach enables distinct components within the blockchain system to be developed and refined independently. This fosters a more agile and efficient development process, ensuring seamless integration and adaptability across various blockchain components.

Modular Design allows rollup solutions to adapt and grow with the most recent technological advancements. For instance, if a superior execution engine emerges, it can replace the existing execution layer without affecting other components of the rollup. Another example is the ability to swap fault-proof methods with zk-based technology, transforming an OPRollup into a ZKRollup seamlessly.

image-20230426133245196

Leveraging OP Stack modular design, our solution optimises the Web3 gaming infra stacks through several key enhancements.

  • Delivering significantly higher TPS (targeted at 10k) compared to Layer 1 solutions, ensuring a responsive gaming experience.
  • Its modular design greatly reduces gas fees, while offering scalable, fast, and reliable API and RPC endpoints.
  • Account Abstraction support simplifies user login, account recovery, and ERC20 token gas fee management.
  • Integration with the Cocos Engine IDE provides a comprehensive toolkit for game developers, including NFT and social login features.
  • We minimise gas fees by defining a Data Availability (DA) interface and storing Layer 2 transaction data on a separate DA layer, such as Greenfield, Arweave, or other chains. This approach significantly reduces gas expenses.
  • Enhance reliability by implementing High-Availability (HA) solutions through multiple instances of components, including sequencers and batchers. This provides the gaming platform with a more robust blockchain foundation.
  • Building on the BSC Layer 1 chain enables game developers to leverage the vast BSC user community, boosting the web3 gaming ecosystem.

Lowest Gas Fees

Rollup gas fees generally comprise two elements: 1. L2 block gas fee, and 2. L1 submission gas fee (DA layer fee, as Rollups necessitate submitting all L2 transactions to L1). For gaming, having low gas fees is crucial compared to other use cases. By migrating OPStack to the BSC Ecosystem, we have significantly reduced gas prices (approximately one-tenth of ETH). Additionally, we have implemented numerous optimization techniques, which have successfully lowered the average gas fee to less than $0.0005.

Below is a typical comparison of gas fees among different chains (based on native transfer tx)

ChainGas Fee LevelTypical Gas Fees* ($)
ETHHigh1-2open in new window
BSCLow0.03open in new window
Rollup on ETHLow0.02-0.25open in new window
Semita OPRollup on BSCVery Low0.0005

Increased Stability of OP Rollup

We changed the logic of Optimistic Batcheropen in new window to submit the compressed transactions to BSC to increase the OPRollup more stable. Below is how we did.

We modified Optimistic Batcher's logic to submit compressed transactions to BSC, enhancing OPRollup stability. The key steps we took include:

  1. Addressing BSC-ETH differences: BSC transactions don't support EIP1559 and have a faster block time (3s) than ETH. When Layer 1 faced issues or became overloaded, compressed batch transactions could fail.
  2. Fixing submission retries: The Optimistic Rollup batcher's retry mechanism converted transactions to the EIP1559 type, causing further failures due to incompatibility.
  3. Resolving data frame issues: When compressed transactions were reverted to the queue, the data framework version wasn't removed from the payload, leading to data frame parsing failures.

By adjusting the logic, we improved the batcher's compatibility with BSC and increased Rollup stability on both BSC and ETH. This change has been contributed back to the OPStack community.