KtorZ Profile picture
2 Sep, 26 tweets, 5 min read
Ethereum Arbitrum vs #Cardano #Hydra, a thread about Layer 2 solutions.

👇👇👇
With the recent release of Arbitrum on Ethereum, and the upcoming Alonzo hard-fork on Cardano, there has been many discussions and comparisons about layer 2 solutions. As some knows, I've been working on Hydra with a few others for some months now and I want to shed some lights.
Firstly, what's Arbitrum and what problem does it solve for Ethereum?
Arbitrum is a mechanism that allows to move smart-contract execution out of the layer 1, in such a way that participants can put their trust in some chosen validators (a.k.a managers).
On a network like Ethereum which is based on PoW, this is utterly important as executing contracts is costly and resource-intensive. That means less resources to mine blocks. Validators thus lack incentive to validate expensive transactions at the expense of block production.
By moving expensive calculations out of the main chain and by keeping only cheap state transitions on the layer one, Arbitrum can alleviate the network by a large factor: it gets back to validating only basic transactions.
Plus, it does so by also providing incentives for Arbitrum managers to behave honestly such that, it is sufficient to have at least one honest (and available!) manager for a contract to make legitimate progress.
Note that, Arbitrum does not really relieve the network from day-to-day traffic per se since any transition of the contracts still need to be posted on-chain, and the establishment of an Arbitrum Virtual Machine (A-VM) also requires transactions.
Yet it drastically reduces the complexity of the L1 network without compromising too much on the security. That's neat!

Now, how does that compare to Cardano, and more specifically, to Hydra (head protocol)🦕?
Hydra is an iteration upon a well-known concept of state-channels, which typically take the form of dedicated communication protocol between 2 participants, advancing according to some rules. With Hydra, the channel can be multi-parties, isomorphic and comes with strong security.
I won't go much over the multi-party aspect as I believe it to be straightforward: from 2, to many. Ok.

The 'isomorphic' one is interesting; it means that the transactions running in a head can be mapped to L1 transactions and vice-versa. That is different from Arbitrum.
Arbitrum requires Solidity contracts to be re-compiled to Arbitrum Virtual Machine's bytecode. And such VM is "only" capable of executing contracts. A Hydra head on the contrary can process full-blown Cardano transactions, with native assets, metadata, scripts and whatnot.
It means that Hydra heads can leverage existing battle-tested ledger rules of the L1, which gives strong guarantees about correctness. Plus, it heavily facilitate interoperability and maintenance of the L2 as the L1 changes. A head is like a mini blockchain, with faster consensus
With a dedicated VM & compiler built from scratch, Arbitrum tackles a risky challenge for a financial system. I am sure the team has thoroughly tested their components, yet that is something scary to me, given the history of previous smart-contract failures in the space.
As a matter of fact, Arbitrum really only moves contracts executions in the L2 (but not traffic), whereas Hydra moves actual traffic off the L1. Contract execution on Arbitrum won't be faster than on L1, and transitions are still subject to the L1's settlement times.
In a Hydra head, transaction are settled MUCH faster than on the underlying L1. Think of it as a poker table that you join with a bunch of chips. Many things happen at the table during the game, but only the final state gets recorded at the end of the game, not all the actions.
Note that state-channels are generally bad for platforms with a global state a like Ethereum because, in case of dispute, the entire channel state needs to be brought on-chain for verification. That's not the case in Hydra & Cardano! Why though?
Firstly, thanks to the EUTXO model, there's no global mutable state that contracts modify. Actually on Cardano, there are only static validators which operates on (extended) UTXO. This means that Cardano scripts can be validated in isolation.
Secondly, a Hydra head only make progress if all participants have explicitly agreed on the progress: you cannot loose money you haven't agreed to loose.

Dispute in Hydra can thereby be resolved fully automatically and there's no need to bloat the L1 with large state dumps.
In Arbitrum, dispute resolution is more involved. Because the state of the VM can be advanced by any of the VM managers, a dispute requires mediation of the layer 1, and several steps to determine who's honest.

On the plus side, a VM can make progress with only one honest node.
I said earlier that Arbitrum's main goal is to alleviate the L1 from expensive contracts executions. This comes to circumvent a problem known as "The verifier's dilemma": verifying contracts is resource-intensive and validators may not have a strong incentive to verify contracts
Thus, this may lead to attacks where attackers submit arbitrarily complex contract transactions to keep other validators needlessly busy and get a head-start on mining blocks in the meantime!

How does Cardano deal with that?

(a) Proof-of-Stake (no mining!)
(b) Collaterals
Alonzo extends transactions to include a new component called "collateral inputs" (or simply, collaterals). These are special inputs that pools can collect in case where they are given a transaction with scripts that fail to validate to compensate for the resources involved.
While this may sound a bit scary, remember that Cardano scripts can be fully validate statically, before even being submitted to the network. Hence in practice, sensible wallets will not publish transactions with failing scripts and attackers will be financially punished.
To conclude, both solutions are pretty different because they also tackle different problems.

Hydra is good fit for off-network fast-paced, cheap transactions whereas Arbitrum really is a way to move contract execution out of the layer 1.
While state-channels are heavily criticized in the PoW space, their trade-offs in the PoS lands are quite different and with Hydra, researchers did find a sweet spot between simplicity, efficiency and strong security guarantees. And, it fits nicely to the UTXO model! Hail Hydra!
Keep in mind also that Hydra heads are only a first step in the scalability roadmap. It won't stop there and we are already envisioning some nice extensions, so much that at some point, we'll need to chose in which direction we want to steer it :)

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with KtorZ

KtorZ Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!

Follow Us on Twitter!

:(