Use Case Example: Building a Multi-Layered dApp with XCM

To illustrate the transformative potential of Cross-Consensus Messaging (XCM) within the Glue ecosystem, consider the example of a complex multiplayer online game. This game leverages multiple L2s to optimise different aspects of its functionality, similar to how it is not efficient or good practice to deploy a piece of software on AWS using a single instance type (m4.4xl for example). Just as AWS users select instance types optimised for specific workloads to achieve scalability and efficiency, Glue's use-case optimised L2s provide tailored environments for different facets of a dApp.

Gaming: A Multi-Layered Approach

Imagine a game that involves gameplay, asset issuance, and financial transactions. Each component of this game is hosted on a different L2, utilising Glue's XCM to ensure seamless interaction, better user experience and superior performance.

  1. Game Logic on the Gaming L2

    Performance: The game logic is hosted on the Gaming L2, which is optimised for throughput and low fees. This L2 is designed to handle high-frequency interactions of the gameplay, ensuring a smooth and responsive gaming experience without breaking the bank.

    Use Case Optimisation: By isolating the game logic on a specialised L2, the game can take full advantage of performance optimisations tailored for gaming applications. This reduces the load on other L2s and allows the game to scale efficiently.

  2. Asset Issuance on the Asset Transfer L2

    Cost-Effectiveness and Decentralisation: The game's assets, such as in-game currency, are issued on the Asset Transfer L2. This L2 is optimised for minting, burning, and transferring assets, offering a cost-effective and highly decentralised environment.

    Security: By using a specialised L2 for asset transfers, the game ensures that asset issuance and transfers are secure, efficient, and inexpensive. This L2 is designed to handle high volumes of transactions without incurring significant costs, making it ideal for managing digital assets.

  3. Trading on the Finance L2

    Financial Operations: The trading of in-game assets occurs on the Finance L2, which is optimised for DeFi applications. This L2 is fully EVM compatible and provides a high level of censorship resistance and transaction efficiency, ensuring secure and reliable trading.

    Economic Integration: By leveraging the Finance L2, the game can integrate advanced financial functionalities, such as market orders, auctions, and liquidity pools, enhancing the economic complexity and engagement within the game.

Seamless Integration with XCM

XCM facilitates the seamless interaction between these specialised L2s, ensuring that the game operates as a cohesive and efficient system.

As players engage in gameplay on the Gaming L2, they can earn or acquire in-game assets. These assets are issued and managed on the Asset Transfer L2, with XCM enabling instant and secure communication between the two L2s. For example, when a player wins a battle and earns a rare token, the Gaming L2 sends a message via XCM to the Asset Transfer L2 to mint the new token and assign it to the player's account.

Players can trade their in-game assets on the Finance L2. XCM allows the Asset Transfer L2 to communicate with the Finance L2, facilitating the seamless transfer of assets for trading purposes. When a player lists an item for sale, the Asset Transfer L2 sends a message via XCM to the Finance L2, where the item is listed on a decentralised marketplace. Once the transaction is complete, the Finance L2 notifies the Asset Transfer L2 to update the ownership records.

Strategic Advantages of a Multi-Layered Approach

The multi-layered approach exemplified by this game showcases the strategic advantages of using Glue's use-case optimised L2s.

Scalability and Performance: By distributing different functions across specialised L2s, the game can scale efficiently without overburdening a single layer. Each L2 handles a specific aspect of the game, ensuring optimal performance and responsiveness.

Cost Efficiency: Using specialised L2s for different tasks reduces overall costs. The Asset Transfer L2, for example, handles high-volume transactions at a lower cost by not offering EVM compatibility, while the Finance L2 provides robust financial services with high levels of decentralisation.

Improved User Experience: The seamless integration facilitated by XCM ensures a smooth and engaging user experience. Players can interact with different aspects of the game without encountering delays or complexities, enhancing overall satisfaction and engagement.

Flexibility and Innovation: This approach allows for continuous innovation and flexibility. New features and functionalities can be introduced on specific L2s without disrupting the entire ecosystem, enabling the game to evolve and adapt to changing user needs and technological advancements.

Last updated