Home  >  Article  >  Using a zoo as a metaphor, hard-core science popularization of the working principle of zkSync circuit

Using a zoo as a metaphor, hard-core science popularization of the working principle of zkSync circuit

王林
王林forward
2024-03-06 11:25:181023browse

Using a zoo as a metaphor, hard-core science popularization of the working principle of zkSync circuit

Many people were confused after seeing @zkSync’s new zoo science pictures and texts. They compared the zoo to a circuit circuit and regarded animals with special skills as "logic gates." ", think of the happy group photo of the animals as "proof". In this way, the data input to the circuit will go through a series of complex calculations without revealing the specific content, and a proof will be generated, completing a zero-knowledge proof process. Come on, let me try to popularize some hard-core science:

1) Zoo corresponds to "circuit". A circuit is actually an aggregation of a series of logic gate constraints (addition, subtraction, multiplication, division, etc. formulas), which is equivalent to A concentrated expression of all animal abilities, it is also the basic element of computers. Therefore, the "data" passed into the circuit must be incorporated into various formulas and performed calculations.

In the layer2 network, the stored data is usually transaction hash value, account information, data balance, etc. These data can be converted into mathematical formulas for calculation, but if they cannot be directly formulated, other coding transformations are required to convert the raw data into computable formulas. This step is the basis for the circuit to perform processing and ensures that the data can be effectively processed and utilized.

In the zoo mode, various animals symbolize logic gates in the circuit. For example, wooden boxes represent numbers that are not publicly displayed, called "variables"; glass boxes represent publicly displayed numbers, which are "Open input"; and the stone symbolizes an unchangeable number, regarded as a "constant".

The zebra has the ability to compare whether two numbers are "equal". If the result is equal, the zebra will be happy; the crocodile means "less than". The crocodile will be happy only if the number on the right is less than the number on the left; the spider represents more complexity The multi-selection gate will return true if you input 0, and false if you input 1. In addition, you can also let beavers represent division, squirrels represent percentages, caterpillars represent addition, and so on. Different animals represent different formulas for addition, subtraction, multiplication and division. The happy or sad animals represent the structure of formula operations.

Many boxes of different types of animals are combined into a circuit. For example: to calculate a formula 2 x 3 = Y, x represents the wooden box, Y represents the stone, 2 wooden boxes and caterpillars, zebras, etc. Come to work and finally verify whether the formula holds. Note that there is no need to worry about why different animals have different abilities. This is the basic principle of working of circuit elements and the basic rules for computers to perform calculations.

A complex circuit is constructed from a variety of animals (logic gates) and boxes (rules).

3) Assume that the formula 2x 3 =Y just entered is established, which is equivalent to zebra caterpillars and other animals being happy, and then a "Proof" will be generated for the formula, and a character needs to be able to recognize this It only matters if the Proof is accurate. Therefore, in order to ensure the credibility of the proof, the zookeeper, who is the builder of the circuit, simulated a special animal called Zeek. Zeek can see whether other animals are happy and is equivalent to Verifier in the layer2 system.

The process of Zeek observing whether animals are happy is actually the verification process of the Prover system. If they are all happy, the verification is passed. Only then will the Proof be uploaded to the main network and finally confirmed. Of course, thousands of animals in the zoo produce a large number of proofs, and it is impossible for Zeek to look at them one by one. Therefore, Zeek can also observe whether the status of thousands of Zeek's own clones is happy. This process is called Recursive Proof.

4) The process of taking pictures is equivalent to the process of generating SNARK certificates or KZG commitments, and the printed negatives are equivalent to the STARK\SNARK certificate itself. Visitors to the zoo are equivalent to the Transaction transactions that enter one by one. Only the animals are happy The photo will be completed and the proof will be generated. Finally, the visitor will leave the zoo with the photo and leave a proof before it can be uploaded to the chain and finalized.

There are many animals in a zoo, and it is impossible for them all to be happy at the same time and work according to predetermined rules. There are many logic gates, and it is inevitable that there will be disconnections and other situations. In this way, there will be some congestion, lags and error reports, which will result in invalid state transitions, Under-Constrained, and will not pass the final verification.

The above is the detailed content of Using a zoo as a metaphor, hard-core science popularization of the working principle of zkSync circuit. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:panewslab.com. If there is any infringement, please contact admin@php.cn delete