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

Odaily星球日报Published on 2024-03-04Last updated on 2024-03-04

Abstract

一个复杂电路就是形形色色的逻辑门和规则共同构建。

原文作者:Haotian(X:@tme l0 211)

不少人看了@zkSync 新发的动物园科普图文大呼懵圈,把动物园比做电路 circuit,把拥有特殊技能的动物视为「逻辑门 Gate」,把动物们都开心的合影当成「证明 Proof」,这样输入电路的数据在不透露具体内容的前提下,经过一系列复杂计算,生成一个 Proof,就完成一次零知识证明过程。来,我试着硬核科普一下:

1)动物园对应的是「电路」,电路其实是一系列逻辑门约束(加、减、乘、除等公式)的聚合,相当于所有动物们能力的一次集中表现,它也是构成计算机的基本元素。因此传入电路的「数据」一定可被套进各种公式内被执行运算。

在 layer 2 环境都是一些交易哈希值、账户、数据余额之类的数据,这些数据可以转变成公式进行计算,若不能公式化则需进行其他编码转化让其原始数据可以变成公式,这是电路执行处理的前提。

2)各种动物对应电路里的逻辑门,在动物园模式里,分别有:木箱——代表不公开显示的数字,被称之为「变量」;玻璃箱——代表公开显示的数字,为「公开输入」;石头——代表无法移动的数字,被视为「常数」;

斑马具有比较两个数是否「相等」的能力,结果相等斑马就开心;鳄鱼则表示「小于」,只有右边的数小于左边的数,鳄鱼才会开心;蜘蛛代表更复杂的多选择门,输入 0 则返回一定是 true,输入 1 则返回是 false;此外还可以让河狸表示除法、松鼠指代百分比;毛毛虫代表加法等等。不同的动物代表不同的加减乘除运算公式,动物们开心或伤心代表公式运算的结构。

很多个动物 + 不同种类的箱子组合起来就是一个电路,比如:要计算一个公式 2 x + 3 = Y,x 代表木箱,Y 代表石头, 2 个木箱 和毛毛虫、斑马等前来工作,最后来验证该公式是否成立。注意,不用纠结为啥不同动物具备不同能力,这就是电路元素工作基础原理,是计算机执行计算的基本规则。

一个复杂电路就是形形色色的动物(逻辑门)和箱子(规则)共同构建。

3)假设刚才输入的公式 2 x+ 3 =Y 成立了,相当于斑马 毛毛虫等动物都开心了,然后就会为该公式生成一个「Proof」,需要有一个角色能识别这个 Proof 是否准确才行。因此,为了确保证明的可信性,动物园管理员即电路的构建者,模拟了一个特别的动物叫 Zeek,Zeek 能看出其他动物是否开心,在 layer 2 系统中相当于 Verifier。

Zeek 观察动物是否开心的过程其实就是 Prover 系统的验证过程,都开心了则验证通过,Proof 证明才会真正通过上传到主网,并最终确认。当然,动物园成千上万的动物,产生大量证明,Zeek 不可能挨个看,因此 Zeek 也可以观察千千万万个 Zeek 自己的分身状态是否开心,这个过程就叫 Recursive Proof 递归证明。

4)拍照的过程相当于生成 SNARK 证明或 KZG 承诺的过程,而打印的底片则相当于 STARK\SNARK 证明本身,动物园的游客相当于一个个进入的 Transaction 交易,只有动物开心合照才会完成并生成 Proof 证明,最终游客拿着照片出了动物园留底证明才能被上链最终确定。

一个动物园有很多动物,不可能同时都开心并按照预定规则工作,有很多逻辑门,也难免会出现掉线等情况。这样就会出现一些,拥堵卡顿以及报错的情况,因此会产生无效的状态转化,Under- Constrained,也就无法通过最终的验证。

原文链接

Related Reads

A Company Once on the Brink of Bankruptcy Just Surpassed Bitcoin in Market Cap

On June 22nd, driven by rising stock prices, SK Hynix’s market capitalization reached $1.35 trillion, surpassing Bitcoin's total market cap of approximately $1.29 trillion. This temporarily made it South Korea's highest-valued company. The core driver of this surge is HBM (High Bandwidth Memory), for which SK Hynix is the primary supplier to NVIDIA, holding over 60% market share. AI's demand for high memory bandwidth has translated into immense profitability, with SK Hynix reporting a 72% operating profit margin in Q1. The company's success follows a 13-year bet on HBM technology, beginning in 2009. It nearly failed after the 2001 dot-com bubble, was acquired by SK Group in 2012, and was subsequently recapitalized to continue its long-term HBM development. The article contrasts this with the Crypto AI narrative. Capital currently favors AI infrastructure players like SK Hynix due to "real orders, physical barriers, and quantifiable profit margins." In comparison, Crypto AI projects, promising decentralized compute and data markets, remain largely conceptual with limited tangible progress. Examples include Bittensor, whose core mechanisms are still under development, and Bitcoin miners transitioning to AI, who face significant funding gaps and execution challenges. The piece cites analysis suggesting the AI sector has absorbed nearly all new market liquidity since 2022, leaving little for crypto. It concludes that the current AI infrastructure红利 is captured by entities with proven technical barriers and supply capabilities, while crypto networks still need to define their concrete role in the value chain.

链捕手32m ago

A Company Once on the Brink of Bankruptcy Just Surpassed Bitcoin in Market Cap

链捕手32m ago

Bittensor Moves Towards Ultimate Decentralization: The Critical 18 Months for the TAO Ecosystem is Here?

Bittensor, a decentralized AI protocol, is accelerating its transition to full decentralization over the next 18 months, as outlined in a recent post by co-founder Const. The project currently operates in a "semi-decentralized" state: ownership and network participation are open and permissionless, with TAO distribution based on competitive contribution. However, protocol upgrades and governance have remained under core team control to enable rapid iteration in the fast-evolving AI sector. This strategic shift comes as the ecosystem matures, boasting 128 subnets and a large community. Const argues that continued centralization now poses risks, including single points of failure and regulatory scrutiny. The upcoming decentralization roadmap includes optimizing validator competition, opening liquidity pools, introducing governance rights for Alpha holders, and refining economic models. The move could fundamentally reshape TAO's value proposition, adding governance premiums to its existing valuation based on AI narrative and scarcity. It also signals a potential maturation of the AI crypto sector, where competition may shift from hype to sustainable protocol design and real economic activity. Bittensor positions itself not just as another AI token, but as foundational infrastructure aiming to decentralize intelligence production—analogous to Bitcoin's role in decentralizing money—with the goal of creating a resilient "Millennium Intelligence Federation."

marsbit44m ago

Bittensor Moves Towards Ultimate Decentralization: The Critical 18 Months for the TAO Ecosystem is Here?

marsbit44m ago

Japan's AI Dark Horse Emerges: How a 7B Small Model Challenges Fable and Mythos?

In June 2026, Sakana AI's new model Fugu caused a stir in the AI community. Its Fugu Ultra variant achieved scores of 73.7 on SWE-Bench Pro and 82.1 on TerminalBench 2.1, surpassing GPT-5.5 and Claude Opus 4.8, and was claimed to be comparable to export-restricted models like Fable 5 and Mythos Preview. Remarkably, the core of this high-performance system is not a massive model, but a small 7B-parameter RL Conductor model. Fugu operates as a multi-agent orchestrator: the 7B model acts as a "foreman," dynamically analyzing user tasks and delegating subtasks to a pool of top-tier global models (e.g., GPT-5, Gemini 3.1 Pro). It then synthesizes and verifies their outputs. This architecture represents a paradigm shift from monolithic models to an expert-team approach. It enhances performance in complex, multi-step engineering tasks like code review and security testing by enabling cross-validation from specialized models, improving long-session stability and token efficiency. However, Fugu's strengths come with trade-offs: it faces inherent latency due to multiple API calls, relies heavily on underlying US model APIs (creating dependency risks), and its benchmark comparisons with Fable/Mythos are based on reported scores, not head-to-head testing. For Japan's AI ecosystem, which lacks the massive compute and data resources of the US or China, Fugu exemplifies an "asymmetric breakthrough" strategy. Instead of competing directly in parameter scale, it focuses on intelligent orchestration of existing global models, offering a degree of AI sovereignty and resilience. While a significant system-level innovation, its ultimate capability is still bounded by the underlying models it coordinates.

marsbit44m ago

Japan's AI Dark Horse Emerges: How a 7B Small Model Challenges Fable and Mythos?

marsbit44m ago

Trading

Spot
Futures
活动图片