Cardano Hydra Head protocol has significant overhead to open and close heads, and support for incremental commits/decommits is complicated to implement with the current approach.
Leverage lessons learned in Cardano dApp design to improve the Hydra protocol: single-step init, easy commits/decommits even while the head is open, simpler on-chain validators, and cheaper operation.
This is the total amount allocated to Hydrozoa: Lightweight and scalable Hydra Heads.
None.
Yes, this project should ideally be aligned with the Hydra core dev team's development roadmap to minimize incompatible forking and duplication of effort. A healthy working relationship with that team has already been established in previous projects, and we will pursue this project in close collaboration with them.
The project will be fully open source.
This project will implement the Hydrozoa protocol — an adaptation of the Coordinated Hydra Head protocol with more lightweight and scalable Hydra Heads.
Hydrozoa introduces cheap and deterministic state update transactions as the default way to commit utxos to and decommit utxos from the Hydra Head. A similarly cheap finalization procedure can be used to stop operating the head if consensus can be maintained throughout its life. The halt and dissolve procedures are an alternative workflow available if L2 consensus breaks down — optimized analogs to the close and fanout operations in the Coordinated Hydra Heads protocol.
Introduction
The Hydra Head protocol allows a group of participants to temporarily transfer control over a subset of utxos from the Cardano mainnet (L1) ledger to a private unanimous consensus protocol (L2) run by the participants instead of the Ouroboros consensus protocol running on the whole Cardano mainnet. While the Hydra Head controls these utxos, transactions involving them are quickly broadcast among the participants and then confirmed with immediate finality as soon as all participants sign a corresponding snapshot. The utxos resulting from the L2 transactions can be brought back under L1 control by finalizing an L2 snapshot (via Close/Contest transactions) and then fanning them out on L1 from the state utxo.
The protocol was developed before Plutus was added to mainnet, effective design patterns emerged for building dApps in the eUTXO model, and the Vasil enhancements enabled a completely different approach to dApp design on Cardano. It can be improved by applying the lessons learned over the past year.
Design
The main design ideas of Hydrozoa are:
The L1 component of the Hydra Head protocol becomes simpler, cheaper, and more scalable. In exchange, the L2 component is somewhat more complicated. However, managing complexity in the L2 and off-chain components is usually easier and cheaper than in the L1 components, which incur transaction fees and often use smart contracts that must be carefully developed and audited.
The full design of the Hydrozoa protocol has already been meticulously thought-out and described in the following whitepaper:
The paper has been shared with the Hydra core dev team and was well-received by them. They have forwarded it to the IOG researchers who developed the original Hydra Head protocol for further comment. In principle and at a high level, the participants in the discussion thread agree that the features described in the Hydrozoa paper make technical sense and could be feasible:
Project scope
The whitepaper has described the mechanisms of the protocol in great detail so that a technical reader can form a concrete understanding of its operation. To this, a full specification would add concrete definitions for the following parts of the design:
Once the above is sufficiently specified, a smart contract dev team can proceed with implementation. The on-chain logic is expected to be straightforward (its simplicity was an explicit goal of the design). However, the off-chain logic is significantly more complex than in the Hydra Head protocol currently implemented in the input-output-hk/hydra repository. This is where the bulk of the Hydrozoa project's effort will be directed.
The Hydrozoa project will be developed with the Hydra repository in mind, and the deliverables of our project should strive to be applicable to that repository. To the extent possible, we will contribute PRs and ideas wherever appropriate.
As we discovered while applying the Hydra Head technology in the development of a non-trivial smart contract application, the Hydra Head still has a few major limitations that are an obstacle to its widespread adoption in commercially viable apps on Cardano mainnet.
As we mentioned in the hydra auction whitepaper (Jan 2023), the main obstacles to commercial viability and scalability of a typical hydra-based application are:
Hydrozoa addresses the second limitation directly by embracing incremental commits/decommits to/from open heads at the core of the protocol. Furthermore, the first limitations can potentially be lifted via the "major snapshot" mechanism that Hydrozoa introduces -- through the implementation of dynamic membership within a head will be left for a future project.
Lifting these restrictions will allow a diverse range of L2-enabled applications to flourish on Cardano because it will become cheap and easy to open and operate hydra heads for short periods of time or as persistent services. Furthermore, these lightweight hydra heads will make launching a network of heads more feasible, similar to Bitcoin's Lightning network.
The success of this project will be determined by whether the mechanisms contemplated in the Hydrozoa protocol design bear out in practice, providing the following improvements over the current Hydra Head implementation:
These improvements should be compared against the additional complexity and computational resources required to run the L2/off-chain part of the Hydrozoa protocol relative to the Hydra Head protocol.
We will keep these benefit/cost metrics in mind during the project timeline and develop benchmarks to monitor them as early as feasible in the project roadmap.
The entire project will be open source and richly documented. It will be pursued with regular communication with relevant stakeholders like the Hydra core dev team, the Cardano developer community, and entrepreneurs in the ecosystem.
It is anticipated that many spinoff applications of the Hydrozoa application may form from the usage examples that we will develop during the course of the project -- we already have informal concepts/designs for auctions, voting, stablecoins, and other applications that use the Hydrozoa features. We are well-connected with the Cardano entrepreneurs and developers who may be interested in pursuing these new designs.
George Flerovsky is the author of the Hydrozoa whitepaper. He has significant experience with the Hydra Head protocol and implementation via his involvement in the Hydra auction project from Sep 2022 to Jul 2023. He has carefully studied the associated research papers and specs and he has developed an intimate understanding of the Hydra implementation in input-output-hk/hydra repository. He has contributed to discussions about important recent features in the Hydra roadmap (released in version 0.11.0):
George has been prolific in the smart contract application development ecosystem on Cardano. He has helped develop the design, define the project roadmap and budget, and oversee the successful development of the following applications:
George is also the current chair of the Cardano DeFi Alliance and of the Cardano Developer Experience Working Group. He intends to keep those groups connected to the progress of the Hydrozoa project so that the project remains relevant to the entrepreneurs, users, and developers in those groups.
The rest of the development team will be provided by MLabs, under a sub-contract. MLabs is a leading consultancy in the Cardano ecosystem with a proven track record and significant experience. Its team consists of seasoned engineers, each holding expertise in their respective fields. Moreover, MLabs has consistently demonstrated its ability to deliver complicated projects with a high degree of trust and accountability. It has an extensive portfolio of satisfied client projects as well as several popular Catalyst projects.
The main goal of the project is to develop a prototype implementation of the Hydrozoa protocol that can demonstrably:
If the implementation meets these feature targets, then it will validate the Hydrozoa approach and make it very appealing for entrepreneurs and developers to adopt L2 scaling in their applications.
M1 – Specification and architecture (Nov 2023)
M2 – Basic Head state model and on-chain transitions (Dec 2023)
M3 – Off-chain data systems and ledgers (Jan 2024)
M4 – Incremental commits/decommits (Feb 2024)
M5 – Snapshots creation/verification and participant messaging protocol (Mar 2024)
M6 – Halting, contestation, and dissolution (Apr 2024)
M7 – Deterministic algorithms for certificate/tx trees (May 2024)
M8 – Full protocol and testnet deployment (Jun 2024)
M9 – Wrap-up (Jul 2024)
M1 – Specification and architecture (Nov 2023)
Deliverables:
Acceptance criteria:
M2 – Basic Head state model and on-chain transitions (Dec 2023)
Deliverables:
Acceptance criteria:
M3 – Off-chain data systems and ledgers (Jan 2024)
Deliverables:
Acceptance criteria:
M4 – Incremental commits/decommits (Feb 2024)
Deliverables:
Acceptance criteria:
M5 – Snapshots creation/verification and participant messaging protocol (Mar 2024)
Deliverables:
Acceptance criteria:
M6 – Halting, contestation, and dissolution (Apr 2024)
Deliverables:
Acceptance criteria:
M7 – Deterministic algorithms for certificate/tx trees (May 2024)
Deliverables:
Acceptance criteria:
M8 – Full protocol and testnet deployment (Jun 2024)
Deliverables:
Acceptance criteria:
M9 – Wrap-up (Jul 2024)
Deliverables:
Acceptance criteria:
The budget breaks down into the following activities:
The total hours of effort involved with the above activities is 2090 h. At the standard $95/h rate, the total USD cost of the project is $198,550.
We apply a 0.21 USD/ADA exchange rate, which is the average rate over the past few months, conservatively adjusted downward to ensure that the project will remain viable despite moderate price shocks that may occur before or during the project timeline.
The corresponding total ADA cost of the project is 945,476 ADA.
We propose a linear budget allocation schedule for the milestones, with a double allocation for the last milestone:
The costs described in the budget breakdown of this proposal have been developed based on a detailed plan of the activities required to achieve the milestones. We have high confidence in the comprehensiveness and accurate sizing of these activities, as we have engaged in very similar projects to this in the past at complexity level and subject domain.
The USD hourly rate is a typical rate that we and our fellow developers in the smart contracts and dApp sector have used in past projects to provide high-quality services, with a proven track record of delivering projects despite the complexity of viable applications in this space. This requires experts on staff for a diverse range of niche skillsets and deep knowledge of the Cardano and Hydra protocols, the EUTXO model, and the modern practices of dApp design.
The USD/ADA exchange rate reflects the average rate over the past few months, conservatively discounted down to 0.21 USD/ADA to allow the project to remain viable despite potential price shocks that may occur after proposal submission and during the project timeline.
George Flerovsky -- Delivery Manager, Tech Lead, and Lead Developer.
Talented developers from MLabs will be assigned closer to its start date, and additional team members may contribute to the project throughout its timeline. They will be chosen to best align the available staff’s diverse skill sets towards the top priorities of the milestones being pursued.