There's a general consensus in the #Blockchain industry about the long-term viability of L2 scaling solutions...
#Bitcoin embraced lightning network
#Ethereum & #Tezos embraced rollups
And #Cardano focuses on Hydra
A thread on #Hydra & how it measures up to a zk-rollup: 🧵👇
If you look at the broader #blockchain landscape
#Cardano is more similar to #Bitcoin
than to any other #blockchain out there
• Ledger models (UTxO & E-UTxO)
• L2 scaling approach (Lightning & Hydra)
• A similar approach to "Inclusive accountability"
Basically,
#Cardano aspires to be a better #Bitcoin, offering smart contract capabilities
Without compromising on the basic principles #Satoshi believed in
So let's take a look at the scaling approach of #Cardano through Hydra
What's Hydra?
Hydra comes under the category of "state channels"
A state channel is a smart contract that enforces predefined rules for off-chain transactions
State channels enable participants to transact quickly and freely off-chain, then settle finality with Mainnet
But to be specific, Hydra implements "isomorphic" state channels
Isomorphic means making use of the exact same transaction format & contract code as the underlying L1
Meaning,
the transactions running on the L2 can be mapped to L1 transactions & vice-versa
Isomorphic state channels extend the L1 network of #Cardano to L2 in an organic way
This avoids the need to create a bridge into an independent layer 2 network
And there is no need to wrap native assets and Plutus smart contracts
There is a fundamental architectural difference between
The state channels on—for example—#Ethereum & Hydra
This comes from ways in which #Cardano & #Ethereum handle state
The localized nature of the state of the E-UTxO ledger model enables isomorphic state channels
But the Account model creates the "Global state"
in this complex distributed & dynamic computing environment
You cannot easily extend the exact underlying ledger to an L2 & execute the transactions
This would require wrapping native assets & solidity smart contracts
Hydra is not a monolithic protocol
It's a family of several subprotocols
Hydra can be divided into 4 components:
• Head protocol
• The tail protocol
• Cross-head-&-tail communication protocol
• A set of supporting protocols for routing, reconfiguration, & virtualization
Most of the components mentioned above are under development after years of R&D
The Hydra Head protocol matured over time as a proof of concept and in March 2022, it was implemented on a testnet
Here's a link to the Hydra roadmap:
github.com/orgs/input-out…
So let's take a look at the concept of ''Head protocol''
A Hydra Head is an isolated network
that creates an off-chain mini-ledger between a restricted set of participants
that works similarly but faster than the on-chain ledger(L1) and evolves in parallel to the main network
On the Hydra head the participants follow a different set of rules compared to the L1
Inside a Hydra head, all the participants need to agree on all transactions flowing through it
that means transactions are only valid when all the participants explicitly approve it
So let's take a look at the way it works:
Multiple parties could come together and open a Hydra Head
And the participants could commit funds to it
Meaning,
Moving the on-chain funds to a script address that locks them under specific rules
All participants have to sign all transactions to avoid foul play
Any participant may decide to quit the head by closing it any time
Then all participants walk away with the latest state they had agreed to off-chain
You could compare Hydra heads as ‘private poker tables’
Now let's look at the differences between Hydra and zk-rollups in the 3 core aspects of these protocols:
• Security
• Usecases
• Scalability
• Market Demand
1) Security
A Hydra head is basically an extension of L1
Which allows interaction between a limited number of participants
This allows Hydra head to be secured by the L1 at a protocol level
But trust is necessary between the participants of the Hydra head
A zk-rollup scales an L1 by providing a similar or different execution environment
That can bundle 100s of transactions into a single transaction & executed outside of L1
The transaction data gets posted to L1
That allows rollups to be secured by native L1 security
Thus, zk-rollups on #Cardano can provide a much better security environment than #Ethereum/EVM
Considering the advantages provided by the E-UTxO ledger model
that avoids the complications of the "Global state"
And secure programming environment based on functional programming
2) Usecases
Hydra is very similar to the Lighting Network of #Bitcoin
It offers way more capabilities than Lightning
The main use cases are:
• Poker game
• NFT-Auction
• Pay-Per-Use API
• Inter-Wallet Payments
For detailed info, click the link👇
hydra.family/head-protocol/…
In contrast to Hydra,
zk-rollups are fully general-purpose scaling solutions
Meaning,
• Anyone can even run a copy of L1 inside a rollup
• Allowing existing dApps & native assets to migrate to rollups
• With almost no need to write any new code
This allows zk-rollups to be as useful as the underlying L1 in this case #Cardano
This allows Orbis to provide all the use-cases that are possible on #Cardano
Including the deployment of application-specific L3 rollups
That could be optimised for specific use-cases
3) Scalability
Many Hydra heads could be randomly created concurrently on an L1
to allow users to execute transactions
The limitation is in the number of participants in a single hydra head
Inter-head interactions are possible, but they are still in R&D
Like Hydra, zk-rollups allow for faster execution of transactions,
When compared to the execution speed of the underlying L1
On top of it,
the scalability & use-cases provided by the L3 & L4 rollups
can make the L1 protocol a major settlement layer for billions of users
4) Market Demand
Solutions similar to Hydra (payment & state channels) are already live on #Ethereum & #Bitcoin for years now
For eg:
#Bitcoin has the Lightning network
#Ethereum has at least 4 of them:
• Perun
• Kchannels
• Raiden Network
• Connext Network
The limitation in user participation and use-cases has resulted
in the low demand for scaling solutions similar to Hydra
What the market tells us is there is immense demand for "general purpose" scaling solutions like optimistic & zk-rollups
Credits: @l2beat
These rollups are seeing more user adoption day by day
Currently,
The market is showing more demand for optimistic rollups
But as zk-rollups mature, they would be orders of magnitude more scalable and secure than optimistic rollups
TL;DR -
• Hydra is an isomorphic state channel, which includes a family of subprotocols
• The Hydra head protocol is on testnet now
• Hydra supports faster transaction execution but has limited use-cases in comparison to zk-rollups
If you are looking to learn more about zero-knowledge proofs and zk-rollups—
Here’s a similar thread on "Functional Programming" that you might find useful:
Share this Scrolly Tale with your friends.
A Scrolly Tale is a new way to read Twitter threads with a more visually immersive experience.
Discover more beautiful Scrolly Tales like this.
