Overview of Cardano’s Hydra and Scalability: Simply Explained
An ideal blockchain excels in three key areas: security, decentralization, and scalability. The struggle to excel in all three areas at the same time is known as the "blockchain trilemma." Nowadays, many well-known blockchains (like Ethereum) are unable to scale properly, which means network fees are high and transaction confirmation time is long. To answer its own scaling problems, the Cardano network aims to implement Hydra.
Hydra: A family of protocols that overlay the layer 1 Cardano blockchain to process transactions off the main chain. Hydra uses the main ledger as the secure settlement layer, boosts throughput, minimizes the delay in starting to process transactions, incurs low to no costs, and greatly reduces storage requirements.
Before we get into Hydra, let’s take a look at some other popular methods for scaling blockchains:
Layer-2: A Layer-1 (L1) is the underlying blockchain and serves as the foundation for a Layer-2 (L2). There can only be one L1, but there can be multiple L2s (for example, Ethereum is the L1 while Optimism, Arbitrum, and Loopring are all L2s for Ethereum). L2s exist on top of L1s and help reduce scaling limitations and transaction costs by splitting the transaction confirmation process in two: L2 for executing transactions and code while L1 handles security, data, and the public ledger. L2s come in several different flavors, like Optimistic Rollups (which assume bundles of transactions are valid on default and if any discrepancies are found a fraud proof is initiated to fully verify the transaction), ZK Rollups (which operate similarly to Optimistic Rollups, but have validity proofs for every bundle of transactions which are sent to the L1 instead of processing each individual transaction), and VALIDIUM (which are essentially ZK Rollups but transaction data is stored off chain and only submit validity proofs and state commitments to the L1).
https://polygon.technology/solutions/polygon-zkevm
Sidechains: Instead of relying on the security provided by the parent chain (like an L1 provides for an L2), a sidechain creates its own independent ecosystem that is connected to the parent chain through a two-way bridge. This means that the parent chain can “decongest” when some transactions are moved to the sidechain.
https://polygon.technology/solutions/polygon-pos
Sharding: In contrast to the first two solutions, sharding distributes the load of managing the large amount of data required by rollups across the entire network. This will drastically reduce the cost of storing data on L1.
https://vitalik.ca/general/2021/04/07/sharding.html
Hydra
Hydra is similar to an L2 since Hydra takes transactions off the main chain while using the main chain for final settlements. The off-chain location where participants take their transactions is known as a Hydra head, and transactions in the head will Currently, one Hydra head will include a relatively small number of participants.
The amount of funds that are designated to a Hydra head during the initial construction of a head are exactly equal to the funds that return to the main chain after closing the head. No funds can be created or destroyed off-chain. Before closing the head, the final state of the head is recorded, including how much funds each participant has after all transactions in the head. The funds that were locked on the main chain during initial construction are then returned to participants in accordance with the distribution outlined in the final head state snapshot. In other words, multiple transactions may occur in the head, but the main chain may skip from the initial snapshot to the final snapshot of the distribution of the funds, reducing the number of transactions on-chain.
The main chain need not worry about the individual transactions in the off-chain head
As for the consensus algorithm in the Hydra heads themselves, a simple solution is used: every participant has to agree on all transactions. As a result, a participant cannot lose his or her funds without providing consent. This consensus algorithm, while simple, prevents heads from having too many participants or participants who are offline for extended periods of time. So initial implementations of Hydra heads will largely be limited to entities with high performance that are online for extended periods (like stake pools).
If you enjoyed reading this, consider following/tipping. It helps a lot!
Need help with crypto gas fees? Go here: https://www.reddit.com/r/CryptoGasFees/
Do you guys think that we can improve the scalability of existing cryptocurrencies without compromising security/decentralization?