Understand the Zero-Knowledge Proof Applications in Blockchain with One Article

2021-12-15, 09:41


【TL; DR】

1.Zero knowledge proof technology aims to prove a proposition to the validator, but in the process of proving, it does not disclose any information except "the proposition is true".

2.Zero knowledge proof needs three elements: completeness, reliability and zero knowledge.

3.Zk-SNARKs technology can prove that someone has certain information with zero disclosure, and is widely popular in the blockchain field.

4.The processes of replication proof and spatiotemporal proof adopted by Filecoin are based on zk-SNARK technology which refers to uploading the calculated hash value to the chain and periodically proving the storage validity.

5.ZK-rollup uploads the raw trading data to the chain, and uses zero knowledge proof to automatically validate the validity of the trade.

Suppose Alibaba is hijacked one day and is dealing with the kidnappers in front of the treasure. Correspondingly, is there any method he can prove to the kidnapper that he really knows the password without telling the kidnapper the password to open the door, to save his life? There are some methods. Alibaba can let the kidnapper stand at an appropriate distance with a bow and arrow, neither too close to him (the kidnapper may hear the password used for opening the door) nor too far away from him (perhaps Alibaba easily escapes). Then, Alibaba only needs to show the kidnappers an open and closed-door , so that he can prove that he really knows the password without telling the kidnappers the real password. In this process, Alibaba did not provide any useful information to the kidnapper (validator), but let the kidnapper (validator) confirm the authenticity of a conclusion. This is also the basic concept of zero knowledge proof (ZKP).

What is ZKPs?

ZKPs were created in 1985 and were first proposed in a paper entitled “The knowledge complexity of interactive proof systems'' by professors Safi Godwasser, Silvio Micali and Charles Lakford. ZKP technology aims to prove a proposition to the validator, but in the process of proving, it does not disclose any information except "the proposition is true". Therefore, "ZKPs" can also be considered a "zero disclosure proposition".
This concept sounds a bit awkward, but its connotation is clear. ZKPs need to have the following three elements:

1.Complete. The prover needs to be able to prove to the validator that the proposition is true, or to convince the validator.

2.Sound. If the proposition is false, the prover cannot prove to the validator that the proposition is true, so as to ensure that the proof is credible.

3.Zero-Knowledge. In the process of proving that the proposition is true to the validator, other valid information is not exposed at all.

ZKP is one of the foundations of modern cryptography. Shafi Godwasser and Silvio Micali also won the 2012 Turing Award for their achievements in ZKPs. In the modern Internet, ZKP is one of the most basic technologies in privacy computing. In the field of blockchain, because the data on the chain is completely open to the public, there is no privacy protection mechanism except that the address on the chain cannot correspond to people's offline real identity. Therefore, zero knowledge has also obtained many applications on the blockchain, such as identity systems, privacy protection, off-chain scaling, etc. In particular, zk-SNARKs technology (zero knowledge succinct arguments of knowledge) can prove that someone has certain information with zero disclosure, and is widely popular in the blockchain field.

Application of ZKPs

1/Filecoin

Filecoin is a distributed storage project based on a new Internet protocol - interplanetary file system (IPFS protocol). It is also the most famous project based on IPFS. Meanwhile, due to the use of storage proof technology based on ZKPs, Filecoin is also the largest ZKPs network in the world. Specifically, the processes of replication proof and spatiotemporal proof adopted by Filecoin are based on zk-SNARK technology which refers to uploading the calculated hash value to on-chain by storing raw data to off-chain and periodically proving the storage validity.

When storing files, it is necessary to build a Merkle tree for the raw data, calculate the VDE layer by layer, and finally upload the tree root of the Merkle tree to the on-chain. This encryption process consumes a lot of computing power, but the size of the on-chain data is very limited. It can compress hundreds of KBS of data to only hundreds of bytes. Therefore, it is a processing method of "exchanging time for space". After the data is chained, it is necessary to validate the data on a randomly selected Merkle leaf at regular intervals and calculate all the paths from the root to the leaf. This process is also called spatiotemporal proof. If the node required to provide proof does not store the corresponding data, it cannot provide the hash values of all required paths in a limited time, so it cannot pass the validation. In this way, we validate the validity of data storage without exposing the stored data itself through ZKPs.


For more details about IPFS and FileCoin, please refer to:
The IPFS Protocol That Could Revolutionize the Internet, and the FileCoin that Came Along

2/zk-Rollup

Filecoin uses zk-SNARKs technology for distributed storage to validate the validity of general data storage. ZK-rollup uploads the raw trading data to on-chain, and uses ZKPs to automatically validate the validity of the trade. However, all trading data needs to be proved, which leads to huge computational overhead and poor performance of ZK rollup.

In the blockchain system, each node needs to calculate the block information to validate the reliability of the trading information. For the whole system, this calculation is highly repetitive, and it is obviously faster to directly validate the block information than to calculate the block information. This is the basic principle of Zk-rollup's scaling of blockchain. In terms of data structure, it also maintains a global Merkle tree for trading states in the system, and each state is a leaf node on the tree. If the binary Merkle tree structure is adopted, in order to support 1 million users and 1000 kinds of assets, the depth of the Merkle tree needs to reach about 30. If each trade changes the information of 5 to 10 leaf nodes, about 200 hash calculations will be required.

For more details about zk-Rollup solutions, please refer to:
Crack The "Impossible Triangle": Overview of Layer 2 Solutions
Will Layer 2 and the Future Sharding Update to be Activated in 2022 be Ethereum’s Ultimate Solution to Boost Scalability?

Conclusion

ZKPs are the Pearl of cryptography. It plays an important role in privacy protection and reducing double computing. These excellent features will undoubtedly help us open a private, secure and fast blockchain future.

Answer questions to earn rewards

Author: Ashley.H, Gate.io Researcher
*This article represents only the views of the researcher and does not constitute any investment advice.
*Gate.io reserves all rights to this article. Reposting of the article will be permitted provided Gate.io is referenced. In all other cases, legal action will be taken due to copyright infringement.

Gate.io Featured Articles of the Week
Is SocialFi Going To Be The Next Big Thing in the Web3.0 Era?
Key Points of Encryption Hearing | The Industry Called for No Excessive Regulation, and Members of Congress Proposed to Ensure Web 3.0 Revolution Took Place in the United States
Endgame: Uncovering the Optimal Solution of Blockchain Scaling with Vitalik Buterin
Share
gate logo
Credit Ranking
Complete Gate Post tasks to upgrade your rank