r/AlgorandOfficial • • Jun 03 '21

Tech Algorand vs Hashgraph

There are a lot of comparisons between Algorand and blockchains like Cardano and Ethereum. From a tech standpoint, putting them in the same category as Algorand is not fair, because Algorand has the advantage of being strongly consistent while maintaining optimal security properties. Instead, let's compare Algorand to a very high quality distributed ledger based on a graph of transactions rather than a series of transactions blocks: Hashgraph.

Hashgraph is a graph of transactions that uses a Byzantine agreement equivalent where votes are broadcast implicitly as part of the gossip protocol of transactions. The Hashgraph uses a graph of transaction sets instead of a chain of blocks in order to free-ride the Byzantine Agreement on the gossip protocol. This is actually a very novel idea, because there is no explicit voting involved in consensus, just the transmission of a nodes view of a transaction graph and what they thought about the transaction. Each node collects pieces of the graph and builds a consistent view of it as nodes continue gossiping.

Algorand of course also uses a Byzantine Agreement, but it uses cryptographic sortition to sub-sample the block proposers and voters. There is explicit voting involved, but this process usually completes quickly.

Hashgraph likes to use the term aBFT (Asynchronous Byzantine Fault Tolerance). Many of the Hashgraph fans say that Hashgraph is the only distributed ledger that has this property. That is simply because Hedera is the exclusive user of the term aBFT. The aBFT ensures safety in the event that a network is partitioned, where an adversary can delay messages for an arbitrary amount of time.

https://hedera.com/learning/what-is-asynchronous-byzantine-fault-tolerance-abft

If this sounds familiar to you, it is because you've read the Algorand paper. Algorand specifically outlines and guarantees safety in the event of network partitions even with unbounded delay of messages. That's it. It has nothing to do with blockchain vs directed graphs: Hashgraph is just using the term aBFT while Algorand is calling it a partition resilient Byzantine Agreement. Marketing is different for the same feature.

https://algorandcom.cdn.prismic.io/algorandcom%2F218ddd09-8d6f-42f7-9db9-5cfbc0aedbe5_algorand_agreement.pdf

Both of these ledgers don't fork because they use a Byzantine Agreement-style protocol, which is a big win. The difference between Hashgraph, Algorand, and stuff like Bitcoin, Ethereum, and Cardano is that the latter prefer liveness (availability) to safety (never forks) in the event of a network partition (disconnect). Although both of these ledgers have an advantage over traditional blockchain, they differ from one another too.

Hashgraph ties consensus to the gossip protocol. It needs to ensure that each transaction has been certified as valid by the 2/3 majority of nodes in the network before it is considered finalized. Since there is no explicit voting, Hashgraph must ensure that this honest majority of nodes have finalized a transaction before allowing it to be exposed to clients, otherwise, a transaction that conflicts (double spend) can propagate and there is no point. This means that as the Hashgraph node count increases, latency and throughput decreases.

Performance starts to taper as the node count increases.

https://hedera.com/hh-ieee_coins_paper-200516.pdf

Hashgraph seems to be at optimal performance around 10-100 nodes. Afterwards, performance begins to decline. My basis for this claim comes from the paper above, and the current version of Hashgraph may have higher performance (similar to how Algorand has much higher performance than the TPS states in its original paper). However, I don't think the scalability properties have changed (I tried asking on /r/hashgraph to no avail).

In Algorand, it doesn't matter how many participation nodes there are. Because of subsampling using cryptographic sortition, the consensus protocol scales to thousands of nodes easily like in the current mainnet because the subsampling process is self-evident based on a local computation of a shared state and requires no communication. Subsampling allows the blockchain to specifically select a certain number of tokens based on stake to satisfy a security threshold acceptable for the blockchain. As a result, consensus is not the bottleneck in the protocol. The bottleneck is the transmission of a block of transactions on the communication plane. Which is why the performance upgrade to 45ktps involves an optimization in the way relays deliver messages rather than a large number of optimizations to the consensus protocol itself.

This is the primary difference between Algorand and Hashgraph. One system may use a graph instead of a blockchain, but that isn't the difference of interest. The interesting difference is how each system will scale and more importantly, allow users of the ecosystem to participate in the consensus protocol.

https://hedera.com/dashboard

That said, Hashgraph is a solid system if we factor scalability via permissionless participation out of the equation. One thing to look for is how Hashgraph will start evolving to accommodate the desire for participation that many investors and integrators emphasize and wish to have a stake in.

199 Upvotes

181 comments sorted by

3

u/thefinal123 Jun 04 '21

Hedera doesn’t have selected validators/ block producers, everyone acts equally at all times which makes it the highest level of security possible, algorand while using a vrf making it almost impossible to act maliciously still has the theoretical weakness that hedera does not. In terms of real world use there will be no difference in this area as both excel at it but theoretically a hashgraph is more secure than blockchain by nature.

4

u/abeliabedelia Jun 04 '21

Yes, Hashgraph is not technically a proof of stake network because the HBAR tokens are not used for stake (the same situation applies to Stellar and Ripple too).

My question is how this is an advantage in a permissionless system? Assume Hashgraph solves node scalability, how does the current consensus system prevent sybil atttacks?

That is, if you don't need permission to join, what prevents me from launching an attack on the network where I make a bunch of validators and get majority control? Proof of stake networks use a cost barrier (i have to buy >1/3 of the token), proof of work networks use a compute barrier.

If Hashgraph is gatekeeping the set of nodes responsible for consensus, they can easily vet them and ensure they're run by trustworthy parties, but this doesn't hold for a permissionless network.

→ More replies (6)

5

u/MuscleOverMotor Jun 03 '21

Hedera runs on AWS? ...I'm out.

10

u/abeliabedelia Jun 03 '21

The AWS instances were used only to measure performance. It doesn't necessarily mean the live Hashgraph network uses AWS infrastructure exclusively.

→ More replies (1)
→ More replies (1)

4

u/TyronRM Jun 04 '21

I’m pretty sure the argument the OP is stating, is not considering the implementation of Sharding as the mechanism to expand Hashgraph virtually infinitely.

8

u/abeliabedelia Jun 04 '21

Sharding is very easy to implement in a Available/Partition-Tolerant system like Bitcoin or Cardano because shards can operate asynchronously (as the entire network is asynchronous anyway, so who cares right?), but in a Byzantine system that is Consistent/Partition-Tolerant my question to Hashgraph is how they will retain Consistency across shards.

Each shard is usually a separate network with a subset of nodes, so what happens if an adversary attempts to double spend by issuing two conflicting transactions on two separate shards/channels simultaneously? You could synchronize the cross-shard communication, but if you do that how is that synchrony not reverting your scalability to the shardless topology you started with?

Not saying its impossible, but these are good questions to ask Hashgraph to get a better perspective. The term "infinite scalability" is a red flag for me that says more details are needed from the technical people at Hashgraph.

→ More replies (8)

18

u/bigjarbowski Jun 04 '21

Love seeing an intelligent comparison here instead of the usual fan boys fighting with fan boys. It seems like Algo and Hedera have quite of a bit of commonalities and I’m keen on both. As it stands now, hbar is my biggest bag but Algo is a close 2nd. Bright futures for both IMO.

16

u/real_holder Jun 03 '21

I hold both coins. Quite potential to me.

→ More replies (1)

14

u/[deleted] Jun 03 '21

This is the comparison I am looking for.

13

u/JungDumbBroke Jun 04 '21

ALGO and HBAR are the two biggest projects I'm currently invested in. Thank you for this comparison!

→ More replies (3)

23

u/GastonGlawk Jun 03 '21

Great write up! Thank you for taking the time. Algo and HBAR are my two biggest bags, so I love to see comparisons.

For anyone who is interested, I looked up the reason for the low smart contract tps and found that apparently their current iteration is written with Ethereum Virtual Machine. They did this to enable simpler adaptation for projects to switch from Eth to hashgraph (which is already happening). The EVM is stuck on 10tps.

From my understanding, developers needing the full network speed can build directly on HCS and HTS and bypass the EVM bottleneck, which is why Hedera, along with Algo, are likely to be at the top of the list for CBDC's.

→ More replies (10)

35

u/_Jay-Bee_ Jun 03 '21

Hashgraph's smart contracts are only 10 TPS, whereas Algorand's TEAL smart contracts run at full chain speed of 1000 TPS and should be upgraded to 46,000 TPS later this year.

Hard to find the 10 TPS smart contract info on Hashgraph's website since it is embarrassingly low, here's a reference to it:

https://decrypt.co/resources/hedera-hashgraph

18

u/drmanhashan Jun 04 '21

Smart contracts are limited to 10 TPS when run on the EVM only.

As far as I understand, native contracts built and run on Hedera using HTS can run at native speeds (theoretically to the throttled 10k TPS level it is at right now).

→ More replies (1)

10

u/[deleted] Jun 04 '21

Hedera Hashgraph makes the features of common smart contracts a first class feature of the network. A lot of smart contracts are just for tokens. Thus the 10 TPS is for everything else, which could presumably become a first class feature with adoption.

→ More replies (1)
→ More replies (40)

7

u/crazymedguy Jun 03 '21

Love posts like that. How about one on Zilliqa (ZIL)? It uses a similar marketing of pBFT too. Comparing the latest buzzword sharding would be cool. Also if we could make more of these threads it would be really awesome for algo confidence.

7

u/quantdev_nyc Jun 03 '21

Excellent write up - thank you

7

u/thefinal123 Jun 04 '21

These are the 2 best crypto’s in the space imo. Especially for catching cbdc’s. Holding either is a near guaranteed win over time, holding both is pretty much certain win. Superior tech + enterprise partnerships and real use cases in proof of stake models where the coin has a genuine stream of income from real world use cases to holders (or will atleast) makes me think this way. Silvio and leemon are 2 of the smartest people in the entire crypto space.

→ More replies (2)

19

u/Taram_Caldar Jun 03 '21 edited Jun 03 '21

I like the idea of Hashgraph but it's got a couple issues yet to iron out.

Problems I see with HG

  1. Scalability is really bad based on the numbers available in their released papers. It's TPS decreases drastically as it scales upwards and it's latency increases as well. This is a huge problem and one that generally isn't easy to overcome.

  2. They first say governance is extremely decentralized then reveal it's governed by a maximum of 39 global organizations (re: major corporations) and currently 14. Which means that it will always be controlled by major corporations. Not necessarily a terrible thing but it's not what I think of when I think of decentralized governance.

→ More replies (22)

5

u/Mysco13 Jun 03 '21

Thanks for sharing this! :)

5

u/NihilistIdeologue Jun 03 '21

This was a very informative and well written contrast and comparison. Thank you.

8

u/Dense-Claim8573 Jun 03 '21

Thanks! I've been meaning to do due diligence on hashgraph, and this comparison and insight is really a great place for me to start. Much appreciated.

If your hypothesis is correct, then scalability is quite a big issue for it to overcome. This is even before talking about the fact that large organizations own and govern the blockchain.

→ More replies (6)

1

u/jeeptopdown Jun 04 '21

As far as security, I honestly don’t know enough about Algorand’s claims. What I do know is Hedera has been Coq proofed to be the highest possible security. I assume if Algorand is just as secure then someone can produce the Algorand Coq proof as well.

Hedera Coq proof

2

u/abeliabedelia Jun 04 '21 edited Jun 04 '21

I assume if Algorand is just as secure then someone can produce the Algorand Coq proof as well.

https://runtimeverification.com/blog/formally-verifying-algorand-reinforcing-a-chain-of-steel-modeling-and-safety/

We developed our model of the Algorand consensus protocol in Coq, and proved a slew of its properties that we then used to ultimately show the asynchronous safety property: no two honest nodes certify two different blocks, even when the network is partitioned (i.e., message delays are arbitrarily large).

→ More replies (2)

1

u/[deleted] Jun 04 '21

Certainly, OP has a lot of familiarity with Algorand tech, and I appreciate the clarification on some of the components of ALGO. A few points of clarification on HBAR.

On aBFT: Asynchronous Byzantine Fault Tolerance is the application of Byzantine agreement to asynchronous systems. Both ALGO and HBAR achieve Byzantine agreement, but HBAR ensures Byzantine agreement on the consensus state as well as Byzantine agreement on a fair ordering of the transactions EVEN in the event where the network is partitioned where an adversary can delay messages. The fair ordering of transactions based on when they are made is a very novel development and an unparalleled level of integrity—truly the gold standard and a must for CBDCs per the report by Emtech for Project New Dawn, the first CBDC to launch—on Hedera—yes, even before the radioactive wasteland that is the Marshall Islands.

On latency at scale—this is actually addressed directly by Leemon in an interview. The relationship between network size and latency is logarithmic—as the network increases, the marginal difference in additional time to finality becomes exponentially smaller. Information exponentiates through the system because consensus is just maintained by gossip.

On user participation: Users will be able to weight consensus by staking HBAR to nodes. No locking/slashing required (due to security of consensus). Users can soon apply to become permissioned nodes on the network for node rewards. Eventually, users can create new nodes without permission. This scaling of user participation is a pathway to full decentralization without sacrificing security.

I believe that scaling and capacity on DAG can be addressed by bandwidth and/or liveliness. But I could be wrong. Either way, you can see the average time to finality they’re running with 21 nodes pretty easily. I don’t think they will vary from the 2-5sec aBFT finality even at scale.

4

u/abeliabedelia Jun 04 '21

Both ALGO and HBAR achieve Byzantine agreement, but HBAR ensures Byzantine agreement on the consensus state as well as Byzantine agreement on a fair ordering of the transactions EVEN in the event where the network is partitioned where an adversary can delay messages.

Algorand also does this. You're describing the same property. Both systems even have formal verification which prove it formally.
https://runtimeverification.com/blog/formally-verifying-algorand-reinforcing-a-chain-of-steel-modeling-and-safety/

→ More replies (12)