Take zoos as an example, hardcore science zkSync circuit working principle

Original Author: Haotian (X:@tme l0 211)

Many people watched the @zkSync The new zoo science graphics and texts are confused, comparing the zoo to a circuit, treating animals with special skills as a “logic gate”, and taking a happy photo of animals as a “proof”, so that the data input into the circuit does not disclose the specific content, after a series of complex calculations, a proof is generated, and a Zero-Knowledge Proof process is completed. Come on, I’ll try hardcore science:

  1. The zoo corresponds to the “circuit”, which is actually an aggregation of a series of logic gate constraints (formulas for addition, subtraction, multiplication, division, etc.), which is equivalent to a concentrated representation of the abilities of all animals, and it is also the basic element of the computer. Therefore, the “data” passed into the circuit must be set into various formulas to be executed.

In the layer 2 environment, there are some transaction hashes, accounts, data balances and other data, which can be converted into formulas for calculation, or if they cannot be formulated, other encoding transformations are needed to make the original data into formulas, which is the premise of circuit execution processing.

  1. The logic gates in the corresponding circuits of various animals, in the zoo mode, are: wooden box - represents a number that is not publicly displayed, which is called a “variable”, a glass box - represents a number that is displayed publicly, which is “public input”, and a stone - represents a number that cannot be moved, which is regarded as a “constant”;

Zebras have the ability to compare whether two numbers are “equal”, and the results are equal and zebras are happy; crocodiles mean “less than”, crocodiles will be happy only if the number on the right is less than the number on the left; spiders represent more complex Long choice gates, entering 0 will return must be true, entering 1 will return false; in addition, you can also make beavers represent division, squirrels refer to percentages; caterpillars represent addition, and so on. Different animals represent different formulas for addition, subtraction, multiplication, and division, and the happy or sad animals represent the structure of the formula.

Long animals + different kinds of boxes 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 is true. Note that there is no need to worry about why different animals have different abilities, this is the basic principle of the working of circuit elements, and it is the basic rule for computers to perform calculations.

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

  1. Suppose the formula 2 x+ 3 =Y is true, which means that animals such as zebra caterpillars are happy, and then a “Proof” will be generated for the formula, and a character needs to be able to recognize whether the Proof is accurate. So, to ensure the credibility of the proof, the zookeeper, the builder of the circuit, simulates a special animal called Zeek, who can see if other animals are happy or not, which is the equivalent of Verifier in a layer 2 system.

Zeek’s process of observing whether the animal is happy is actually the verification process of the Prover system, and when they are happy, the verification is passed, and the Proof proof will actually be uploaded to the Mainnet and finally confirmed. Of course, there are thousands of animals in the zoo that produce a large number of proofs, and Zeek can’t look at them one by one, so Zeek can also observe whether thousands of Zeek’s own doppelgangers are happy, and this process is called Recursive Proof Recursive Proof.

  1. The process of taking pictures is equivalent to the process of generating SNARK proofs or KZG promises, and the printed negatives are equivalent to the STARK\SNARK proofs themselves, and the visitors to the zoo are equivalent to the transactions that enter one by one.

A zoo has a lot of Long animals, it is impossible to be happy and work according to the predetermined rules at the same time, there are very Long logical gates, and it is inevitable that there will be drops. In this way, there will be some congestion, lag and errors, so there will be invalid state transitions, Under-constrained, and it will not pass the final verification.

Link to original article

View Original
This page may contain third-party content, which is provided for information purposes only (not representations/warranties) and should not be considered as an endorsement of its views by Gate, nor as financial or professional advice. See Disclaimer for details.
  • Reward
  • Comment
  • Repost
  • Share
Comment
0/400
No comments
Trade Crypto Anywhere Anytime
qrCode
Scan to download Gate App
Community
English
  • 简体中文
  • English
  • Tiếng Việt
  • 繁體中文
  • Español
  • Русский
  • Français (Afrique)
  • Português (Portugal)
  • Bahasa Indonesia
  • 日本語
  • بالعربية
  • Українська
  • Português (Brasil)