Ethereum Scaling Solutions - ZK Proofs, Bulletproofs & Rollups
Dive deeper into an innovative scaling solution known as Rollups
In this article, we will dive into the world of Ethereum scaling solutions and explore the varied approaches that have been proposed. We will delve deeper into an innovative scaling solution known as Rollups, which is quickly becoming a popular choice among Ethereum developers. This technology promises to improve the scalability of the Ethereum network by using off-chain computations and data availability checks to increase transaction throughput. In addition, Rollups aims to reduce the cost of transactions by reducing the amount of data stored on the main Ethereum chain. We will examine the many benefits and potential drawbacks of rollups and discuss the potential impact this technology could have on the Ethereum network. Finally, we will explore the future of Rollups, including new use cases and potential applications.
Why Ethereum needs scalability solutions
Ethereum is one of the most popular and successful cryptocurrencies currently available. It has made a significant impact on the world of blockchain, smart contracts, and decentralized applications. Ethereum has grown exponentially over the last few years and is praised for numerous reasons, but some problems have yet to be solved in order to continue to be successful.
Thanks for reading Double Down! Subscribe for free to receive new posts and support my work.
Ethereum has often been referred to as the “Visa/Paypal scale,” but those use cases are not achievable until Ethereum can be scaled more effectively. Ethereum needs scalability solutions in order to meet the demands of its users. With the number of transactions and data that are being generated on the Ethereum network, it is increasingly important to have solutions that can facilitate scalability and increased performance. These solutions must be able to ensure the speed, security, and reliability of the network in order to ensure the seamless and efficient running of the Ethereum network.
Scalability solutions will also enable cheaper transactions within the ETH network, enable users to have a more enjoyable experience when using the network, and help attract more developers to the platform. Scalability solutions will also help Ethereum expand its user base and reach more people, ultimately making the Ethereum network more successful.
Ethereum's current scaling limitations
A “trilemma” is a situation where you can only get two out of three desirable outcomes. The "blockchain trilemma" is the challenge of developing a blockchain network that can achieve scalability, security, and decentralization all at the same time. While the goal of blockchain technology is to create a distributed and secure network, the network must also be able to handle a large number of transactions without compromising its security or decentralization. This is a difficult task, as increasing the number of transactions and data stored on the blockchain will require more resources, which can lead to centralization. Likewise, attempting to increase scalability by reducing the amount of data stored on the blockchain can lead to decreased security. Finding a balance between these three elements is essential for the success of the blockchain network.
Ethereum is currently facing scaling limitations that have been limiting its potential for growth. These limitations are rooted in the Ethereum network's mid-level protocols, which are responsible for the majority of the transactions that occur on the network. These protocols must be improved and optimized in order for Ethereum to reach its full potential. In order to address these issues, Ethereum is actively pursuing solutions like sharding, state channels, and other layer-2 solutions to increase scalability. With these solutions in place, Ethereum can begin to scale up to meet the demands of its ever-growing user base.
Ethereum scalability solutions
The basic objective of every scaling solution for Ethereum is to boost transaction throughput and speed while maintaining the blockchain's decentralized nature.
Scaling solutions are divided into two primary groups: on-chain and off-chain scaling.
On-chain Scaling aka Layer 1 Scaling
Layer 1 scaling solutions refer to increasing the capacity of the core blockchain layer, usually by increasing the number of transactions that can be fit in a block. This can be done by either increasing the block size or by implementing various technical solutions such as SegWit, sharding, and the Lightning Network. These solutions enable the blockchain to process a larger number of transactions at any given time, allowing the blockchain to scale up its capacity and handle more user traffic. Increasing the amount of data and transactions that can fit into a block would also increase the hardware requirements to run a node, raising some criticisms about this scaling solution.
Ethereum 2 enables the concept of Sharding, which is a way to partition the blockchain into multiple shards. This means that nodes only need to process parts of the blockchain, meaning the hardware requirements for running a node are reduced, thus encouraging more people to become node operators and contributing to a more decentralized network. Although sharding is undoubtedly a powerful scaling solution, there are still some concerns to be addressed. One of the main ones is that it can lead to a fragmentation of the network, as different parts of the blockchain might not be updated in the same way, potentially leading to a lack of consensus. (We will deep dive into Sharding in another article.)
Off-chain Scaling aka Layer 2 Scaling
Off-chain scaling solutions are designed to indirectly scale the primary layer of the blockchain by adding additional layers to process the transactions without interacting with the actual core of the blockchain. This off-chain scaling approach leverages the primary layer of the blockchain as a trust and arbitration layer.
Layer 2 scaling allows the added layers to process the transactions without affecting the actual core of the blockchain, allowing for a more efficient and secure transaction processing system. The additional layers are what make off-chain scaling solutions so attractive and efficient, as they can handle high transaction volumes without the need to use the main layer of the blockchain.
Layer 2 scaling is seen as a viable and immediate resolution for Ethereum scalability, as it successfully maintains the decentralization of the Ethereum network, which is the most highly valued asset among the Ethereum community. Despite being a viable solution, Layer 2 solutions still require additional hardware or complex software to be built, which can lead to a longer waiting period before their effects can be felt.
Furthermore, Layer 2 solutions derive their security from the Ethereum network, and can be custom-built or run by an individual, organization, or community, depending on the needed use cases. This flexibility allows for a range of different applications and scenarios, creating a wide variety of opportunities for Ethereum users.
Layer 2 Scaling Solutions
Rollups execute transactions outside of the primary layer of the blockchain and then transmit the transaction data back to the primary network.
State channels refer to the process in which users transact with one another directly outside of the blockchain, or ‘off-chain,’ and minimize their use of ‘on-chain’ operations. It’s one of the most exciting Ethereum scaling solutions in development and the closest advancement to being production ready. We will deep dive into this topic in the next article.
Sidechains are bridge-connected blockchains that are EVM-compatible and linked to Ethereum. They have their own block parameters and consensus protocol. The main difference between sidechains and Ethereum layer 2 solutions is that while layer 2 inherits the security of the main Ethereum network, sidechains rely on their own security.
Plasma is an architecture where sidechains are connected to the main blockchain via a root contract that records the current state and specifies the rules for the child chains. These side chains are tethered to the Ethereum blockchain.
A brief introduction to rollups
Rollups are a layer-2 scaling solution that enables Ethereum users to offload transactions to sidechains and send transaction data back to the main Ethereum network, allowing for faster execution times, lower transaction fees, and improved scalability. Rollups improve the scalability of the Ethereum network by utilizing off-chain computations and data availability checks, which can increase transaction throughput and reduce the amount of data stored on the main Ethereum chain. This technology is quickly gaining traction among Ethereum developers and could potentially have a major impact on the Ethereum network.
How layer-2 scaling rollups work
Rollups enable users to process transactions off-chain and then send the transaction data back to the main Ethereum network. This process involves the use of "sidechains,” which are separate blockchains connected to the main Ethereum blockchain via a root contract. These sidechains are able to execute transactions while keeping Ethereum's decentralized nature intact.
When a transaction is sent to the sidechain, it is processed, and then the transaction data is sent back to the main Ethereum network. This allows for faster execution times, reduced transaction fees, and increased scalability. The data availability for the transactions is checked via a Merkle tree, which creates a single proof that is sent back to the main Ethereum network. This proof is used to verify that the transaction has been successfully processed and is valid.
This layer-2 scaling solution is quickly becoming popular among Ethereum developers and could have a major impact on the Ethereum network in the future. By increasing the scalability of the network, Rollups can allow Ethereum to continue to grow and reach more users.
Rollups are especially beneficial for high-volume applications such as decentralized exchanges, where the speed of transaction execution is a key factor for success.
There are two main types of Rollups: Zero-Knowledge Rollup (ZK Rollup) and Optimistic Rollup (OR rollup).
Zero Knowledge Rollup (ZK Rollup)
ZK, which stands for “Zero-Knowledge”, is a concept that no additional information is needed other than the validity of the transactions. This concept can be applied to many aspects of data security and privacy, allowing users to prove the validity of their transactions without needing to divulge any extra details. By using Zero-Knowledge, users can guarantee the privacy of their data while still being able to verify the validity of the transactions they are making.
For example, Zero-Knowledge can be used for digital identity verification. Instead of providing personal details such as name, address, and date of birth, users can use Zero-Knowledge proofs to prove their identity without having to disclose such details. This means that the user's identity can be securely verified without the need for the user to reveal any additional information about themselves. This can be particularly useful in situations where privacy is a concern, such as when applying for a loan or registering for a new account.
A great example of a use case for Zero-Knowledge is in the banking industry. Banks can use Zero-Knowledge proofs to confirm the validity of transactions without disclosing the amount of money being transferred. This ensures that the privacy of the parties involved is preserved while still allowing the banks to verify the accuracy of the transactions.
How does ZK Rollup work as a scaling solution?
Zero Knowledge Rollup (ZK Rollup) is a layer-2 scaling solution that utilizes the concept of Zero-Knowledge to increase the scalability of the Ethereum network.
ZK-rollups provide an efficient way to process transactions on its layer2 protocol, by bundling thousands of transactions into a single batch. This process involves the use of a Merkle tree, which creates a single proof, called ‘validity proof’ that is sent back to the main network and used to verify that the transaction has been successfully processed and is valid. After that, only the most essential data is sent to the mainnet, as a minimal summary. This ensures that the mainnet stays unaffected and that the scalability of the platform is increased significantly.
Let us discuss the two types of ZK-rollups, ZK-SNARK, and ZK-STARK, which are both variations of zero-knowledge proofs.
ZK-SNARK stands for “Zero-Knowledge Succinct Non-Interactive Argument of Knowledge” and is a type of proof that uses a cryptographic technique to prove that a statement is true without revealing any information about the statement itself.
Explanation of each term of the ZK-SNARK acronym:
S – Succinct. This suggests that a minimal proof size will lead to speedy and simple processing of transactions. This ZK-SNARKs functionality enables Ethereum to execute more transactions.
N – N:on-interactive, implying that there is no need for communication with the other systems that check the work or transactions.
ARK – Argument of Knowledge. This means the validity proof provided by the checker (that these transactions are legitimate) holds true. This part implies the quality of computational strength of ZK-SNARKs.
In ZK-SNARKS, verifiers and provers go through an extensive process to verify the legitimacy of transactions off-chain. This process involves the verifiers repeatedly challenging the provers to confirm the validity of transactions in a specific rollup. Once the verifiers are satisfied that the transactions are valid, they will submit the 'validity proof' of these transactions to layer1 Ethereum, thereby ensuring that the transactions are safe and secure. ZK-SNARKs ensure the security and privacy of the transactions. However, they are susceptible to certain types of hacks called “quantum computing hacks.”
Two primary characteristics of ZK-SNARKs:
Small proof sizes: These proof sizes remain small regardless of the size of the statement that is being proven, making them incredibly beneficial for applications that require a lightweight and efficient way of verifying data. Additionally, these proofs can be verified without interaction or interaction with any other party, meaning that they are incredibly secure and reliable.
Constant-time verification. ZK-SNARKs allow for the verification of a computation with a constant amount of time, regardless of the size of the computation, making them highly efficient. This property of ZK-SNARKs makes them particularly useful for applications where speed and scalability are key factors, such as in identity verifications in blockchain technology, where the ability to verify transactions quickly and efficiently is essential for its success.
Furthermore, ZK-SNARKs are also useful for private data sharing, as they allow for the exchange of information without revealing the underlying data. All of these benefits make ZK-SNARKs a valuable tool for a variety of applications, and their use is becoming increasingly widespread.
ZK-STARK is the acronym for Zero-Knowledge Scalable Transparent Argument of Knowledge, which is an innovative technology being developed by StarkWare Industries.
Explanation of each term of the ZK-STARK acronym:
S – Scalable. It emphasizes how ZK-STARKS can be scaled up more easily than ZK-SNARKS. They make use of cutting-edge technology, which enables them to provide proofs more quickly than ZK-SNARKs.
T – Transparent. ZK-STARK rollups are more transparent than ZK-SNARKs since they do not rely on reliable trust parties.
ARK – Argument of Knowledge. Although they employ a different calculation strategy and do away with the necessity for trustworthy installations, this means the same as ZK-SNARKS.
ZK-STARK is chiefly focused on scalability and is designed to increase the capability of blockchains and other distributed systems to handle higher throughput.
ZK-STARKs work similarly to ZK-SNARKS, and function in a similar way by bundling up transactions, verifying their validity off-chain, and creating proofs to submit to the mainnet. However, ZK-STARK is a more recent and improved version of ZK-SNARKs, granting a number of advantages over their predecessor. For instance, they are much more scalable, as they can process a larger number of transactions in a given period of time. Additionally, they are much more transparent, as they do not require the use of a trusted setup. Furthermore, this type of proof is more efficient and requires less time to generate the proof than ZK-SNARK, making it a great choice for those looking for a faster and more efficient way to verify their transactions.
Although ZK-STARKs generate proofs quicker due to their advanced technology, they create larger proof sizes, which take more time to verify than ZK-SNARKs. As a result, ZK-STARKs can be seen as more scalable, secure, and transparent when compared to ZK-SNARKs. For this reason, they are increasingly being adopted by many blockchain and cryptocurrency networks that are looking for better security and scalability.
Furthermore, ZK-STARKs are estimated to consume only 24% of the gas fees when compared to other methods. This is beneficial to the end-user, as it makes the transaction execution less expensive. Additionally, it also means that the blockchain and cryptocurrency networks that use ZK-STARKs will incur fewer costs in terms of gas fees. As a result, this could lead to an increase in the overall efficiency and scalability of the network in question.
The Ethereum Virtual Machine (EVM) wasn’t designed to work with Zero-Knowledge proof computation. There’s no possibility of executing complex transactions like smart contracts with zk-proof-computation. A zkEVM stands for Zero-Knowledge Ethereum Virtual Machine and it is an attempt to build an EVM compatible with rollups with zk-proofs while preserving the EVM codes and the knowledge derived from them so far.
zkEVM leverages zk-SNARKs and zk-STARKs to enable increasingly complex and secure applications to be developed on the Ethereum blockchain.
Bulletproof Zero Knowledge Proofs
Bulletproof Zero Knowledge Proofs (also known as "Bulletproofs") is a type of Zero Knowledge Proof (ZKP) that allow for the verification of the validity of a statement without revealing any additional information about the statement itself. Bulletproofs are short, non-interactive zero-knowledge proofs that require no trusted setup - likewise, zkSTARK.
A bulletproof can be used to convince a verifier that an encrypted plaintext is well formed. For example, prove that an encrypted number is in a given range, without revealing anything else about the number. Compared to SNARKs, Bulletproofs require no trusted setup. However, verifying a bulletproof is more time-consuming than verifying a SNARK proof. Bulletproofs are highly efficient and require a minimal amount of data, making them suitable for use in applications that require a lightweight and efficient verification process.
Optimistic Rollups (OR)
Optimistic rollups, an innovative scaling solution for Ethereum, process transactions off-chain, but then submit a condensed version of the transaction data, referred to as 'call data', to the main chain. This innovative approach reduces the amount of data posted to Ethereum, which in turn improves scalability and allows more transactions to be processed in a given period of time. By leveraging compression techniques to reduce the size of the data that is posted, optimistic rollups provide a powerful and efficient solution to the scalability issues that have been plaguing the Ethereum blockchain. Optimistic rollups are considered "optimistic" because they assume that all off-chain transactions have been executed in a valid manner, and therefore do not require any proof of validity for the transaction batches that are posted on-chain. This is a significant difference from zero-knowledge rollups, which make use of cryptographic proofs of validity for all off-chain transactions.
This will save a lot of time and effort that would have been required for executing transactions and submitting data to the main chain.
Optimistic rollups instead rely on a fraud-proving scheme to detect cases where transactions are not calculated correctly. This is a process that allows for a high level of security and trust, as it ensures that the transactions being processed are valid and can be trusted. After a rollup batch is submitted on Ethereum, there's a time window (called a ‘challenge period’) during which anyone can challenge the results of a rollup transaction by computing a fraud-proof. While ZK rollups use validity proofs, optimistic rollups involve fraud proofs. They use a fraud-proving mechanism to identify illegitimate transactions. This ‘challenge period’ is important, as it allows users to verify the integrity of the rollup transaction before it is committed to the Ethereum blockchain, and also ensures that any errors or malicious actions can be identified and rectified. Furthermore, in the event of a challenge, proof of fraud is used to ensure that the proper compensation is awarded to any affected users. This incentivizes users to challenge any suspicious transactions and provides a layer of protection for all users of the roll-up system.
If the fraud-proof succeeds, the OR protocol re-executes the transaction(s) and updates the rollup's state accordingly. Along with updating the state, the other effect of successful proof of fraud is the imposition of a penalty on the sequencer responsible for incorrectly executing the transaction in a block. This penalty serves as a deterrent to future fraud attempts and ensures the integrity of the rollup's state. Additionally, the OR protocol allows for the rollup to be rolled back to a previous state, which can also help restore the rollup's integrity if needed.
If the rollup batch remains unchallenged after the challenge period elapses and all transactions are correctly executed, it is deemed valid and accepted on Ethereum. This means that others can continue to build on an unconfirmed rollup block, but they should be aware of the potential risk associated with this. If one of the previously published transactions was incorrectly executed, then any transactions based on it could be reversed. As such, it is important to be aware of this caveat when building on unconfirmed OR blocks.
Smart contracts on Ethereum control the operation of optimistic rollups, and thus they are dependent on the Ethereum mainnet for security. This is because the security of the rollups is a direct consequence of the security of the underlying Ethereum network. Despite this, there is still a greater risk of fraudulent activity when there is a lack of honest validators or nodes. Such a situation could be caused by malicious actors or even a significant decrease in the number of validators or nodes, leaving the rollup vulnerable to attack. To prevent this, it is important to ensure that there is an adequate number of honest validators or nodes to maintain the security of the rollup. This can be done through incentivizing participation, for example, by rewarding honest validators for their work.
Optimistic rollups are fairly straightforward to set up and are much more cost-effective than ZK rollups. This is largely due to the fact that ZK-SNARKs require sophisticated hardware to generate the 'validity proofs' for the transactions that are processed. Additionally, when it comes to transparency, Optimistic rollups and ZK-STARKs outperform ZK-SNARKs. Optimistic rollups additionally provide more flexibility when it comes to customizing the way transactions are processed, as well as the ability to scale more quickly than ZK-rollups. This makes them an ideal choice for projects which require a high degree of efficiency and cost-effectiveness.
Thanks for reading Double Down! Subscribe for free to receive new posts and support my work.