Rollups (aka Layer-2 or L2) are blockchain technologies that help scale Layer-1s (e.g., Ethereum). Rollups allows faster transactions at a cheaper cost in a trustlessly verifiable manner, by periodically publishing the batch of transactions that were executed along with how those transactions modified the state of the rollup chain, such that any party that only trust the layer-1 (e.g., Ethereum) can fully verify that the rollup chain has correctly performed all transactions without trusting the rollup chain. The two broad approaches to Rollups are Optimistic Rollups and ZK-Rollups. They differ in the way they ensure validity of the rollup blocks. For Optimistic Rollups, validity is ensured by a fraud proof (asssume correct until proven wrong) and the synchrony assumption, while for ZK-Rollups, validity is ensured by zero-knowledge proofs (don't trust, just verify). While the Optimistic Rollups can be a cheaper solution, ZK-Rollups are the most secure and they eliminate a key design limitation of the Optimistic Rollup, which is at least 1 week withdrawal wait time. Some of the recent advancements in ZK technology have been able to optimize both time and cost of applying them to not only scale layer-1 (in rollups), but also achieve privacy and interoperability.
<aside> 💡 Zero-knowledge proof (ZK Proofs) technologies enables one party to prove to another party that they know something without the prover having to convey the information itself in order to prove their knowledge.
</aside>
In this short article, I will present a case for zero knowledge technology and why it is the right time for Harmony to invest heavily on it.
zkDAO – Succinct, Private, Fair
‣
Assuming Harmony block gas limit of 80 million and an Uniswap-like swap takes about 200,000 gas, we can only fit 400 transactions in a block. If the block time is 2s, our TPS per shard will be around 200. After the cross-shard smart contracts support, if we are able to keep the overheads to minimum and block time still around 2s, we can clock 800 TPS with 4 shards. Given that, not all transactions will be swaps, we can best approximate ~1K TPS using 4 shards. This scalability is sufficient to serve the needs of today (e.g., solana with so much traction is still doing only 750 TPS). However for the future needs, this is just on-par (if not below par) what some of the Ethereum rollups can achieve, and definitely low compared to other dominant layer1 solutions like solana, algorand, etc and tradfi use cases (Mastercard: 5K TPS, VISA: 24K).
One could argue that since Harmony supports sharding, which in theory allows infinite scalability by adding more and more shards to keep on serving the demand. However, there could be challenges when more shards are added and all of them are coordinated by beacon shard (shard 0). While sharding is a defecto scaling method, rollups on top of Harmony will be needed to serve the scalability demand of the future. Ethereum 2.0's 64 shards with approximate 50K TPS heavily promotes rollups as future scaling method for Ethereum in their rollup centric roadmap. A nice article to read: Why rollups + data shards are the only sustainable solution for high scalability.
Currently, the single greatest bottleneck to scalability is state bloat. When this article was written, Harmony already nearing 350 million transactions and growing. The blockchain state for a full node is few hundred gigabytes and some terabytes for archival nodes. As Harmony blockchain gets utilized more and more, the blockchain bloat problem will be imminent. Further, after the resharding is implemented the validators will be shuffled around different shards and they will need to be able to quickly sync to the destination shard state.
Ethereum researcher have explored two techniques to solve state bloat problem: weak statelessness and state expiry:
It is worthwhile for us to adopt some of these research to Harmony settings in Q1/Q2 2022, before it becomes too late to solve the problem (e.g., currently it is almost impossible for quickly spin-up a BSC node).
Read more about this in Stateless clients for Harmony
Blockchain by design is fully transparent and expose all transaction information. Anyone can track any financial activity on-chain like swapping, transacting, voting, lending, borrowing, and more. This may result in malicious activity, front-running of trades, and degrading the value of a decentralized financial system. Privacy technology is needed to shield users and their transactions from malicious attacks, yet can be fully validated.