Want to play DOOM on Hydra?

DOOM, the iconic first-person shooter (FPS) game, has made a lasting impact on gaming since its release in 1993. Originally written in C, it has since been ported to numerous other languages. The Hydra team is showcasing the capabilities of their second layer by allowing players to experience DOOM on Hydra Head. The first chance to play DOOM on Hydra will be at Cardano’s Rare Evo event, scheduled for August 15-17 in Las Vegas. While the team is keeping some details secret to surprise attendees, a few aspects are already known. This article will delve into these details and explain the uncapped scalability of Hydra.

Why DOOM on Hydra?

Firstly, it’s important to note that running DOOM on Hydra is primarily a demonstration of the second layer’s capabilities, rather than its main use case. The source code will be made available, allowing developers and other interested parties to learn from the implementation. This initiative not only serves as effective marketing but also benefits the community.

Hydra is a channel-based second layer for Cardano, similar to the Lightning Network but with some differences. Hydra Head, the first protocol in the Hydra family, lays the groundwork for more advanced deployment scenarios using isomorphic, multi-party state channels.

Unlike the Lightning Network, which can only open a channel between two users, Hydra does not have this limitation. Hydra Head can accommodate multiple users simultaneously. Recently, the team delivered an incremental decommit, enabling participants to exit Hydra Head without the need to close it. This allows the remaining participants to continue interacting within Hydra Head. The team plans to deliver an incremental commit allowing user entry to the already open Hydra Head.

The second layer is expected to facilitate fast and inexpensive transactions. Given that DOOM runs at 35 frames per second, Hydra can create a smart contract transaction for each frame and validate the game’s progress. This sets a minimum TPS requirement of 35, which Hydra can easily handle. The real challenge lies in determining how many game sessions can run concurrently on a single Hydra Head.

Playing DOOM on Hydra will serve as a stress test, potentially revealing valuable insights about network throughput.

Games Need Second Layers

Implementing something similar on Cardano isn’t feasible due to its 20-second block time. With one frame every 20 seconds, the game would be too static and essentially unplayable. Games require fast finality, a property equally important for payments.

Users can transfer UTxOs to Hydra via a smart contract on Cardano. Within Hydra, they benefit from higher throughput and fast finality. When they choose to return to the blockchain, the smart contract generates new UTxOs based on the final state of Hydra Head.

Hydra Head operates with its consensus mechanism, distinct from Cardano’s. Users within Hydra Head validate each other’s transactions, completely isolated from the Cardano consensus.

Players will experience DOOM within Hydra, where each game frame will trigger a smart contract transaction to validate game progress according to the rules. This real-time validation will allow monitoring of Hydra’s throughput.

The ability to execute smart contracts (Plutus scripts) is another advantage of Hydra compared to Lightning Network. Hydra is not only a fast transaction network but also an execution environment.

The mechanism will enhance trust among players by recording metrics such as completion times, monsters killed, and items or secrets found.

The smart contract for the DOOM game will be deployed within Hydra, not on the blockchain. Hydra Head will manage both transactions and the execution of the game smart contract.

Upon closing Hydra Heads, new UTxOs can be generated based on the game’s outcome. Players might agree that the winner receives 50% of the funds, the second player 30%, and the third 20%.

However, many details are intentionally kept under wraps.

Uncapped Scalability

There is no limit to the number of Hydra Heads that can be opened, which is why social media is buzzing about Hydra’s uncapped scalability.

Hydra Heads can be opened in quantities of 10,000 or even 10 million, all running in parallel and independently. The only bottleneck is the interaction with the smart contract on the blockchain when opening and closing a Head, as only a limited number of SC transactions can be processed per block.

Once opened, Hydra Heads operate independently. If each Hydra Head has a throughput of 100 TPS and 10,000 Heads are opened, this results in 1 million transactions being processed in parallel.

In the context of DOOM, this means that numerous groups can engage in an unlimited number of game sessions simultaneously within Hydra Heads.

It’s important to note that users in different Hydra Heads are not connected; only users within the same Hydra Head can interact. Hydra Heads users are not connected to each other like in the Cardano network. While Hydra enables high parallelization, it also divides capital and users, which may only be optimal for some use cases.

In the future, Hydra aims to allow interactions between multiple Hydra Heads, similar to routing in the Lightning Network, enabling funds to be sent across multiple channels. The team knows how to achieve this, but it needs to be a priority.