Many people were confused after seeing @zkSync’s new zoo science pictures and texts. They compared the zoo to a circuit, regarded animals with special skills as “logic gates”, and took a group photo of all the animals happily. It is regarded as "proof", so that 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, thus completing a zero-knowledge proof process. Come on, let me try to popularize some hardcore science:
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 all A concentrated expression of the abilities of animals, it is also a basic element of computers. Therefore, the "data" passed into the circuit must be incorporated into various formulas and performed calculations.
In the layer2 environment, there are some data such as transaction hash values, accounts, and data balances. These data can be converted into formulas for calculation. If they cannot be formulated, other encoding conversions are required to make the original data usable. Becomes a formula, which is the prerequisite for the circuit to perform processing.
The logic gates in the circuit corresponding to various animals, in the zoo mode, are: wooden box - represents numbers that are not publicly displayed, called "variables"; glass box - represents public The displayed numbers are "public input"; stones - represent numbers that cannot be moved and are regarded as "constants";
Zebras have the ability to compare whether two numbers are "equal". If the result is equal, the zebra will 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 a more complex multi-selection gate. If you enter 0, the return must be true, and if you enter 1, the return will be false; in addition, you can Let the beaver represent division, the squirrel represent percentages, the caterpillar 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.
The combination of many animals + boxes of different types forms 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 a caterpillar , zebras, etc. came to work, and finally verified whether the formula was established. 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).
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 the 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.
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, and only the animals take photos happily Only then will the Proof be completed and generated. Finally, the visitor will take the photo and leave the zoo to 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.
Above.