search
Homeweb3.0Hard-core science popularization: Taking the zoo as an example to analyze the working principle of zkSync circuit

硬核科普:以动物园为例,剖析 zkSync 电路工作原理

Author: Haotian

Many people were confused after seeing @zkSync’s newly published zoo science pictures and text, comparing the zoo to The circuit regards animals with special skills as "logic gates" and the happy group photos of the animals as "proof". In this way, the data input to the circuit goes through a series of complex calculations without revealing the specific content. Generating a Proof completes a zero-knowledge proof process. Come on, let me try to popularize some hardcore 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 calculated by converting them into formulas. Before the circuit can perform processing, it must be ensured that the data can be formulated. If the data cannot be converted directly into formulas, additional encoding conversions are required so that the raw data can be processed and calculated. The premise of this data processing is to ensure the compatibility of data formats so that data operations and calculations can be performed smoothly in the layer2 environment. Therefore, proper encoding and transformation of data are critical steps to ensure the proper functioning of the system and the effectiveness of data processing.

In the zoo mode, various animals have specific symbols corresponding to the logic gates in the circuit: the wooden box represents a number that is not publicly displayed, which is the so-called "variable"; the glass box symbolizes public display numbers, as "public input"; and the stones represent those immovable numbers, considered "constants". This analogy setting establishes a wonderful connection between logic gates and animals, adding fun and visual imagery to the understanding and learning of circuits.

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 Multi-selection gate, if you input 0, it will return true, if you input 1, it will return false; in addition, you can also let beavers represent division, squirrels represent percentages, caterpillars represent addition, etc. 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 Proof depends on whether it is accurate. Therefore, in order to ensure the credibility of the proof, the zookeeper, the builder of the circuit, simulated a special animal called Zeek. Zeek can see whether other animals are happy and is equivalent to a Verifier in the layer2 system.

Zeek The process of 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 proof or KZG commitment, and the printed negative is equivalent to the STARK\SNARK proof 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 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 Hard-core science popularization: Taking the zoo as an example to analyze 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:ChainCatcher. If there is any infringement, please contact admin@php.cn delete
How to register a Sesame Open Account Sesame Open Account Full Tutorial for Registration for NoviceHow to register a Sesame Open Account Sesame Open Account Full Tutorial for Registration for NoviceApr 22, 2025 am 09:03 AM

To register a Sesame Door account, you need to prepare a valid email or mobile phone number and a stable network. The steps include: 1. Visit the official website, 2. Enter the registration page, 3. Select the registration method, 4. Fill in the registration information, 5. Get and fill in the verification code, 6. Agree to the user agreement, 7. Complete the registration. After successful registration, you need to log in to your account, perform KYC identity verification, and set security measures.

A must-see for beginners! Ten common exchange usage tutorialsA must-see for beginners! Ten common exchange usage tutorialsApr 22, 2025 am 09:00 AM

The principles of choosing a cryptocurrency exchange include: 1. Security, 2. Compliance, 3. User experience, 4. Transaction fees, 5. Currency selection, 6. Liquidity. Tutorials include: 1. Register an account, 2. Identity authentication (KYC), 3. Security settings, 4. Recharge, 5. Spot transactions, 6. Withdrawal.

Can two exchanges convert coins to each other? Can two exchanges convert coins to each other?Can two exchanges convert coins to each other? Can two exchanges convert coins to each other?Apr 22, 2025 am 08:57 AM

Can. The two exchanges can transfer coins to each other as long as they support the same currency and network. The steps include: 1. Obtain the collection address, 2. Initiate a withdrawal request, 3. Wait for confirmation. Notes: 1. Select the correct transfer network, 2. Check the address carefully, 3. Understand the handling fee, 4. Pay attention to the account time, 5. Confirm that the exchange supports this currency, 6. Pay attention to the minimum withdrawal amount.

Review of the most complete historical price since the birth of Bitcoin (2025 edition)Review of the most complete historical price since the birth of Bitcoin (2025 edition)Apr 22, 2025 am 08:54 AM

Since its birth in 2009, Bitcoin’s price has experienced many fluctuations. 1. 2009-2010: From worthless to $0.3. 2. 2011-2013: From $1 to $1,000. 3. 2014-2017: From $200 to nearly $20,000. 4. 2018-2021: From bear market to highs of $64,000. 5. 2022-2024: From falling below $20,000 to the rise after the ETF is approved.

Who is the best digital currency exchange in the worldWho is the best digital currency exchange in the worldApr 22, 2025 am 08:51 AM

There is no "best" digital currency exchange, only the "most suitable" ones because everyone has different needs. 1. Newbies should choose simple and easy-to-understand exchanges, such as Coinbase. 2. Users who focus on security should choose Coinbase or Kraken. 3. Users who pursue rich trading options should choose Binance or Ouyi. 4. Users who like to trade derivatives should choose Bybit or Ouyi. 5. Users interested in new coins should choose Sesame to open the door.

What platform is PumpSwap? Which country is the PumpSwap platform from?What platform is PumpSwap? Which country is the PumpSwap platform from?Apr 22, 2025 am 08:48 AM

PumpSwap is a decentralized exchange launched by pump.fun, focusing on low-cost, cross-chain interoperability and Meme token trading. 1) Seamless token migration and transaction integration: deeply bound to pump.fun, tokens can be migrated to PumpSwap transactions for free. 2) Low cost and incentive mechanism: Provide zero-cost liquidity pool creation and handling fee sharing. 3) Cross-chain interoperability and multi-chain support: Through cooperation with TRON, SOL/TRX cross-chain transactions are realized, and the plan is to expand to Aptos and other chains. PumpSwap mainly serves the global crypto market and is a typical multinational blockchain project.

What are the digital currency trading apps suitable for beginners? Learn about the coin circle in one articleWhat are the digital currency trading apps suitable for beginners? Learn about the coin circle in one articleApr 22, 2025 am 08:45 AM

When choosing a digital currency trading platform suitable for beginners, you need to consider security, ease of use, educational resources and cost transparency: 1. Priority is given to platforms that provide cold storage, two-factor verification and asset insurance; 2. Apps with a simple interface and clear operation are more suitable for beginners; 3. The platform should provide learning tools such as tutorials and market analysis; 4. Pay attention to hidden costs such as transaction fees and cash withdrawal fees.

How to set stop loss in Ouyi Digital Currency App?How to set stop loss in Ouyi Digital Currency App?Apr 22, 2025 am 08:42 AM

There are two ways to set a stop loss in the Ouyi Digital Currency App: 1. Set a stop loss on the trading page: Set a stop loss when opening a position or after opening a position. 2. Set stop loss on the specific position page: Click "Position", select the position, and set the stop loss trigger price and quantity.

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools