zkWasm, opens the door for Web2 applications to enter Web3 Rollup

Intermediate1/7/2024, 9:04:27 AM
This article explains the advantages of zkWasm compared to zkEVM in terms of performance, interoperability, security, flexibility, etc., and discusses its suitable use areas.

【Foreword】

The entire blockchain is built on cryptography, because cryptography has created the first-layer ecology of the entire distributed ledger; and because of cryptography, a second-layer off-chain expansion plan has emerged. In August 2022, Vitalik released “ The article “The different types of ZK-EVMs” provides an overall comparison of the current mainstream expansion solutions, as shown in the figure below:

图1:The different types of ZK-EVMs Overview

Therefore, the current zkVM expansion solutions basically revolve around the zkEVM solution, because other zkVM solutions are not compatible with the continuation and support of the existing ecology, but they will be problematic in terms of the future. Web2 upgrade is an important part of Web3, especially after the emergence of solutions represented by zkWasm that are compatible with many C++, Rust, Go, AssemblyScript, C# and other languages, it has become possible to upgrade the account system of Web2 applications; the expected zkEVM From the left to the past, zkWasm moves from the right to the rear to jointly build a large ecology of Web3 application upgrades, instead of continuing the dispute over the public chain that has been confusing for many years.

【TL; DR】

  1. The ultimate core function of Ethereum is a distributed ledger positioning of DA + Settlement + Consensus. eWASM’s zkWasm solution is more suitable for building a Web3.0 ecosystem.

  2. zkEVM inherits the past and optimizes the blockchain ecology, and zkWasm starts the future and creates the future of Web3.0!

  3. Build Rollups with zkWasm, not just Blockchains

【zkEVM inherits the past, zkWasm starts the future】

As mentioned in the preface, the ecological era that truly connects Web2.0 and Web3.0 is the AppRollup era. Compared with the ecology that is still quiet about the chain idea, the Rollup era does not need to create too many chains, because the chain plays the role of The ledger, that is, the account layer is separated from a separate application and returns to the general layer, with ownership returned to the user; chain is naturally such a carrier, undertaking the essential functions of Data Availability (DA), Settlement and Consensus.

figure 2:AppRollup is much more flexible than Appchain

【ZKP,Zero-Knowledge Proof】

In cryptography, zero-knowledge proof (English: zero-knowledge proof) or zero-knowledge protocol (zero-knowledge protocol) is a method for one party (the prover) to prove a certain proposition to the other party (the tester). The characteristic is that in the process, “ No information will be revealed other than that the proposition is true. Therefore, it can be understood as “zero leakage proof”. It was first proposed by Shafi Goldwasser, Silvio Micali and Charles Rackoff of MIT in a 1985 paper titled “Knowledge Complexity of Interactive Proof Systems” ([GMR85]). The author mentioned in the paper that it is possible for the prover to convince the verifier of the authenticity of the data without revealing the specific data. Zero-knowledge proof can be interactive, that is, the prover must prove the authenticity of the data once for each verifier; it can also be non-interactive, that is, the prover creates a proof, and anyone who uses this proof can Can be verified.

image 3:Development History of Zero-Knowledge Proofs

zk-SNARK (Succinct Non-Interactive Arguments of Knowledge) is probably the most popular form of zero-knowledge proof, first appearing in the 2011 Bit+11 paper. By 2013, zero-knowledge proofs could be used in real-world applications thanks to the Pinocchio PHGR13 paper, which made zk-SNARKS suitable for general computation, albeit slower. The Groth16 algorithm proposed in 2016 greatly reduced the computational complexity, making zk-SNARKS so efficient that it remains the standard today.

However, a trusted setup is critical to the security of these zero-knowledge protocols. An initialization process must be used to generate encryption parameters in order to be able to run a zero-knowledge protocol. A third party performs this operation to ensure that encryption parameters are random, unpredictable, and secure.

This was followed by the introduction of Bulletproofs (BBBPWM17) in 2017 and zk-STARKs (BBHR18) in 2018 . Unlike their predecessors, they are a type of range proof that does not require an initial trust setup. The 2019 PlonK paper implemented a universal zero-knowledge proof algorithm, which means that only one trusted setup needs to be initiated, in contrast to Groth16, which requires a separate trusted setup for each circuit.

As the field has evolved, zero-knowledge proofs have transitioned from pure theory to having useful practical applications in blockchain, secure communications, electronic voting, access control, and gaming. As they continue to be put into commercial applications, there will be more exciting developments to advance the technology.

Therefore, zk-SNARKS, zk-STARKS, PLONK and Bulletproofs constitute the current main implementation methods of zero-knowledge proof. Each method has its own advantages and disadvantages in terms of proof size, prover time and verification time. In the blockchain expansion solution, it basically revolves around the ZK-SNARK-friendly implementation method.

【 WASM, WebAssembly】

WebAssembly (WASM for short) is a relatively new member of the Web technology family (JavaScript, HTML, CSS) and became an officially recognized standard by the W3C in December 2019. WebAssembly introduces a new runtime in the browser that works with the JavaScript runtime. In comparison, it is more lightweight, has a small instruction set and a strict isolation model (WebAssembly has no I/O by default). One of the main motivations for developing WebAssembly was to provide compilation targets for more programming languages ​​(C++, Rust, Go, etc.), allowing developers to develop new web applications or port existing applications using a wider toolset.

Figure 4:Wasm territory

Whether it is Web2 or Web3, the support and use scope of Wasm are becoming more and more extensive:

Figure 5: Major companies and organizations in the WebAssembly ecosystem

【zkWasm = zkp + WASM 】

As a new member of zkVM, zkWasm essentially solves complex operations through off-chain, on-chain storage proof, is compatible with the ideas of Web2 mainstream language, realizes the connection upgrade of Web2 and Web3, performs complex business logic off-chain calculation, and provides valuable results and The certificate is stored on the chain for traceability, authenticity verification and liquidation. The account system is composed of the existing wallet system. The entire ecosystem can be represented by the following figure:

Figure 6:zkWasm ecology

The overall data logical trend can be represented by the following figure:

图7:On-Chain Contracts + Off-Chain Virtual Machine (VM) + WASM Composability

An important core of the initial Ethereum 2.0 update also included the transition from EVM to eWASM; however, the actual progress of 2.0 was not as expected, so eWASM was not mentioned too much in the latest planning plan.

Figure 8:ETH 2.0 overall plan

Although eWASM is not mentioned in the recent planning, the benefits that eWASM can bring are also recognized. From the beginning, the EVM was designed to emphasize correctness over efficiency. This is reflected in the fact that all nodes on the network must run the EVM with complete accuracy. Wasm, although similar to EVM, was invented for the web. Unlike correctness, Wasm emphasizes efficiency and fast loading . Ethereum developer Lane Rettig said that the EVM was created without “a lot of design thought”. He believes that the EVM was designed from a theoretical perspective rather than a practical perspective, so although it is internally sound, it cannot perform its best in the real world. Excellent function. Nick Johnson agrees. In contrast, Wasm is written closer to actual hardware instructions, which makes it more effective at translating actual coding logic. In fact, Wasm instructions map directly one-to-one to the instructions used by the machine, which will greatly improve performance. At the same time, Ewasm can reduce or even eliminate the need for pre-compilation, will support more languages ​​for interoperability, and will benefit from a broader tool set than EVM.

The main advantages of using eWASM over EVM are recognized by the mainstream as follows:

  1. Performance : Compared to EVM, eWASM provides better performance because it uses WebAssembly, which is designed to be faster and more efficient than EVM bytecode. WebAssembly delivers near-native performance, which can significantly increase the speed and scalability of the Ethereum network.

  2. Interoperability : eWASM provides better interoperability than EVM because it supports multiple programming languages, including C++, Rust, and AssemblyScript. This enables developers to write smart contracts in their preferred language, improving code quality and developer productivity.

  3. Security : eWASM provides better security than EVM as it includes multiple security features, such as memory sandbox, which can isolate smart contracts from each other and prevent them from accessing each other’s memory. Additionally, eWASM provides better protection against common smart contract vulnerabilities such as reentrancy attacks and integer overflows.

  4. Flexibility : eWASM provides better flexibility than EVM because it supports dynamic linking, which allows smart contracts to be composed of multiple modules that can be updated independently. This can lead to better code organization and easier smart contract maintenance.

  5. Community support : eWASM has received strong support from the Ethereum community, and several major Ethereum clients, including Geth and Parity, have implemented eWASM support. This means developers have access to a wide range of tools and resources when building smart contracts using eWASM.

However, does the underlying Ethereum network really need to replace EVM with eWasm? The various security risks during the replacement process and the impact on the existing ecosystem cannot be underestimated. Perhaps this is the reason why eWASM has not been mentioned too much in the latest plan.

Figure 9:Vitalik Buterin proposes the latest Ethereum roadmap

The roadmap divides upgrades into several categories based on their impact on the Ethereum architecture. This includes:

Merge : Involves an upgrade from Proof-of-Work to Proof-of-Stake

Surge : An upgrade involving scaling through volume stacking and data sharding

Scourge : An upgrade involving protocol risks for censorship resistance, decentralization, and maximum extractable value

Verge : Upgrades involving easier verification of blocks

Purge : involves reducing the computational cost of operating nodes and simplifying protocol upgrades

Splurge : Other upgrades that do not fall into the above categories

Everyone realizes that the ultimate core function of Ethereum is a distributed ledger positioning of DA + Settlement + Consensus. In this way, many scalability requirements do not require too many modifications to Ethereum itself and bring other unknown risks. Fish and bears. The way to have both at the same time is to divide the work in layers. Placing eWASM on the second layer should be a more reasonable and effective solution. Especially after combining with zk, zkWasm’s technical solution can perfectly inherit the effect that eWASM wants to achieve. At the same time, it can provide services to both Web2 and Web3 and connect each other. zkEVM inherits the past and optimizes the blockchain ecology, zkWasm starts the future and creates the future of Web3.0!

Figure 10:zkWasm = zkp + WASM

Disclaimer:

  1. This article is reprinted from [Putin学习区块链]. All copyrights belong to the original author [Putin]. If there are objections to this reprint, please contact the Gate Learn team, and they will handle it promptly.
  2. Liability Disclaimer: The views and opinions expressed in this article are solely those of the author and do not constitute any investment advice.
  3. Translations of the article into other languages are done by the Gate Learn team. Unless mentioned, copying, distributing, or plagiarizing the translated articles is prohibited.

zkWasm, opens the door for Web2 applications to enter Web3 Rollup

Intermediate1/7/2024, 9:04:27 AM
This article explains the advantages of zkWasm compared to zkEVM in terms of performance, interoperability, security, flexibility, etc., and discusses its suitable use areas.

【Foreword】

The entire blockchain is built on cryptography, because cryptography has created the first-layer ecology of the entire distributed ledger; and because of cryptography, a second-layer off-chain expansion plan has emerged. In August 2022, Vitalik released “ The article “The different types of ZK-EVMs” provides an overall comparison of the current mainstream expansion solutions, as shown in the figure below:

图1:The different types of ZK-EVMs Overview

Therefore, the current zkVM expansion solutions basically revolve around the zkEVM solution, because other zkVM solutions are not compatible with the continuation and support of the existing ecology, but they will be problematic in terms of the future. Web2 upgrade is an important part of Web3, especially after the emergence of solutions represented by zkWasm that are compatible with many C++, Rust, Go, AssemblyScript, C# and other languages, it has become possible to upgrade the account system of Web2 applications; the expected zkEVM From the left to the past, zkWasm moves from the right to the rear to jointly build a large ecology of Web3 application upgrades, instead of continuing the dispute over the public chain that has been confusing for many years.

【TL; DR】

  1. The ultimate core function of Ethereum is a distributed ledger positioning of DA + Settlement + Consensus. eWASM’s zkWasm solution is more suitable for building a Web3.0 ecosystem.

  2. zkEVM inherits the past and optimizes the blockchain ecology, and zkWasm starts the future and creates the future of Web3.0!

  3. Build Rollups with zkWasm, not just Blockchains

【zkEVM inherits the past, zkWasm starts the future】

As mentioned in the preface, the ecological era that truly connects Web2.0 and Web3.0 is the AppRollup era. Compared with the ecology that is still quiet about the chain idea, the Rollup era does not need to create too many chains, because the chain plays the role of The ledger, that is, the account layer is separated from a separate application and returns to the general layer, with ownership returned to the user; chain is naturally such a carrier, undertaking the essential functions of Data Availability (DA), Settlement and Consensus.

figure 2:AppRollup is much more flexible than Appchain

【ZKP,Zero-Knowledge Proof】

In cryptography, zero-knowledge proof (English: zero-knowledge proof) or zero-knowledge protocol (zero-knowledge protocol) is a method for one party (the prover) to prove a certain proposition to the other party (the tester). The characteristic is that in the process, “ No information will be revealed other than that the proposition is true. Therefore, it can be understood as “zero leakage proof”. It was first proposed by Shafi Goldwasser, Silvio Micali and Charles Rackoff of MIT in a 1985 paper titled “Knowledge Complexity of Interactive Proof Systems” ([GMR85]). The author mentioned in the paper that it is possible for the prover to convince the verifier of the authenticity of the data without revealing the specific data. Zero-knowledge proof can be interactive, that is, the prover must prove the authenticity of the data once for each verifier; it can also be non-interactive, that is, the prover creates a proof, and anyone who uses this proof can Can be verified.

image 3:Development History of Zero-Knowledge Proofs

zk-SNARK (Succinct Non-Interactive Arguments of Knowledge) is probably the most popular form of zero-knowledge proof, first appearing in the 2011 Bit+11 paper. By 2013, zero-knowledge proofs could be used in real-world applications thanks to the Pinocchio PHGR13 paper, which made zk-SNARKS suitable for general computation, albeit slower. The Groth16 algorithm proposed in 2016 greatly reduced the computational complexity, making zk-SNARKS so efficient that it remains the standard today.

However, a trusted setup is critical to the security of these zero-knowledge protocols. An initialization process must be used to generate encryption parameters in order to be able to run a zero-knowledge protocol. A third party performs this operation to ensure that encryption parameters are random, unpredictable, and secure.

This was followed by the introduction of Bulletproofs (BBBPWM17) in 2017 and zk-STARKs (BBHR18) in 2018 . Unlike their predecessors, they are a type of range proof that does not require an initial trust setup. The 2019 PlonK paper implemented a universal zero-knowledge proof algorithm, which means that only one trusted setup needs to be initiated, in contrast to Groth16, which requires a separate trusted setup for each circuit.

As the field has evolved, zero-knowledge proofs have transitioned from pure theory to having useful practical applications in blockchain, secure communications, electronic voting, access control, and gaming. As they continue to be put into commercial applications, there will be more exciting developments to advance the technology.

Therefore, zk-SNARKS, zk-STARKS, PLONK and Bulletproofs constitute the current main implementation methods of zero-knowledge proof. Each method has its own advantages and disadvantages in terms of proof size, prover time and verification time. In the blockchain expansion solution, it basically revolves around the ZK-SNARK-friendly implementation method.

【 WASM, WebAssembly】

WebAssembly (WASM for short) is a relatively new member of the Web technology family (JavaScript, HTML, CSS) and became an officially recognized standard by the W3C in December 2019. WebAssembly introduces a new runtime in the browser that works with the JavaScript runtime. In comparison, it is more lightweight, has a small instruction set and a strict isolation model (WebAssembly has no I/O by default). One of the main motivations for developing WebAssembly was to provide compilation targets for more programming languages ​​(C++, Rust, Go, etc.), allowing developers to develop new web applications or port existing applications using a wider toolset.

Figure 4:Wasm territory

Whether it is Web2 or Web3, the support and use scope of Wasm are becoming more and more extensive:

Figure 5: Major companies and organizations in the WebAssembly ecosystem

【zkWasm = zkp + WASM 】

As a new member of zkVM, zkWasm essentially solves complex operations through off-chain, on-chain storage proof, is compatible with the ideas of Web2 mainstream language, realizes the connection upgrade of Web2 and Web3, performs complex business logic off-chain calculation, and provides valuable results and The certificate is stored on the chain for traceability, authenticity verification and liquidation. The account system is composed of the existing wallet system. The entire ecosystem can be represented by the following figure:

Figure 6:zkWasm ecology

The overall data logical trend can be represented by the following figure:

图7:On-Chain Contracts + Off-Chain Virtual Machine (VM) + WASM Composability

An important core of the initial Ethereum 2.0 update also included the transition from EVM to eWASM; however, the actual progress of 2.0 was not as expected, so eWASM was not mentioned too much in the latest planning plan.

Figure 8:ETH 2.0 overall plan

Although eWASM is not mentioned in the recent planning, the benefits that eWASM can bring are also recognized. From the beginning, the EVM was designed to emphasize correctness over efficiency. This is reflected in the fact that all nodes on the network must run the EVM with complete accuracy. Wasm, although similar to EVM, was invented for the web. Unlike correctness, Wasm emphasizes efficiency and fast loading . Ethereum developer Lane Rettig said that the EVM was created without “a lot of design thought”. He believes that the EVM was designed from a theoretical perspective rather than a practical perspective, so although it is internally sound, it cannot perform its best in the real world. Excellent function. Nick Johnson agrees. In contrast, Wasm is written closer to actual hardware instructions, which makes it more effective at translating actual coding logic. In fact, Wasm instructions map directly one-to-one to the instructions used by the machine, which will greatly improve performance. At the same time, Ewasm can reduce or even eliminate the need for pre-compilation, will support more languages ​​for interoperability, and will benefit from a broader tool set than EVM.

The main advantages of using eWASM over EVM are recognized by the mainstream as follows:

  1. Performance : Compared to EVM, eWASM provides better performance because it uses WebAssembly, which is designed to be faster and more efficient than EVM bytecode. WebAssembly delivers near-native performance, which can significantly increase the speed and scalability of the Ethereum network.

  2. Interoperability : eWASM provides better interoperability than EVM because it supports multiple programming languages, including C++, Rust, and AssemblyScript. This enables developers to write smart contracts in their preferred language, improving code quality and developer productivity.

  3. Security : eWASM provides better security than EVM as it includes multiple security features, such as memory sandbox, which can isolate smart contracts from each other and prevent them from accessing each other’s memory. Additionally, eWASM provides better protection against common smart contract vulnerabilities such as reentrancy attacks and integer overflows.

  4. Flexibility : eWASM provides better flexibility than EVM because it supports dynamic linking, which allows smart contracts to be composed of multiple modules that can be updated independently. This can lead to better code organization and easier smart contract maintenance.

  5. Community support : eWASM has received strong support from the Ethereum community, and several major Ethereum clients, including Geth and Parity, have implemented eWASM support. This means developers have access to a wide range of tools and resources when building smart contracts using eWASM.

However, does the underlying Ethereum network really need to replace EVM with eWasm? The various security risks during the replacement process and the impact on the existing ecosystem cannot be underestimated. Perhaps this is the reason why eWASM has not been mentioned too much in the latest plan.

Figure 9:Vitalik Buterin proposes the latest Ethereum roadmap

The roadmap divides upgrades into several categories based on their impact on the Ethereum architecture. This includes:

Merge : Involves an upgrade from Proof-of-Work to Proof-of-Stake

Surge : An upgrade involving scaling through volume stacking and data sharding

Scourge : An upgrade involving protocol risks for censorship resistance, decentralization, and maximum extractable value

Verge : Upgrades involving easier verification of blocks

Purge : involves reducing the computational cost of operating nodes and simplifying protocol upgrades

Splurge : Other upgrades that do not fall into the above categories

Everyone realizes that the ultimate core function of Ethereum is a distributed ledger positioning of DA + Settlement + Consensus. In this way, many scalability requirements do not require too many modifications to Ethereum itself and bring other unknown risks. Fish and bears. The way to have both at the same time is to divide the work in layers. Placing eWASM on the second layer should be a more reasonable and effective solution. Especially after combining with zk, zkWasm’s technical solution can perfectly inherit the effect that eWASM wants to achieve. At the same time, it can provide services to both Web2 and Web3 and connect each other. zkEVM inherits the past and optimizes the blockchain ecology, zkWasm starts the future and creates the future of Web3.0!

Figure 10:zkWasm = zkp + WASM

Disclaimer:

  1. This article is reprinted from [Putin学习区块链]. All copyrights belong to the original author [Putin]. If there are objections to this reprint, please contact the Gate Learn team, and they will handle it promptly.
  2. Liability Disclaimer: The views and opinions expressed in this article are solely those of the author and do not constitute any investment advice.
  3. Translations of the article into other languages are done by the Gate Learn team. Unless mentioned, copying, distributing, or plagiarizing the translated articles is prohibited.
Start Now
Sign up and get a
$100
Voucher!