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

Odaily星球日报Опубліковано о 2024-03-04Востаннє оновлено о 2024-03-04

Анотація

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

原文作者: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,也就无法通过最终的验证。

原文链接

Пов'язані матеріали

The Computing Power Dilemma in the Sino-US AI Rivalry

The Sino-US AI rivalry faces a fundamental bottleneck: the widening compute power gap. While Chinese AI chip companies have seen investment surges, their current focus remains largely on the less demanding inference market. The real challenge lies in the high-end training chip sector, crucial for developing cutting-edge large language models (LLMs), where Nvidia holds a near-monopoly. The compute disparity is stark. US tech giants like Meta, Google, and xAI command massive GPU clusters, enabling them to train trillion-parameter models rapidly. Estimates suggest US data center count and total compute capacity significantly outstrip China's. This "brute force" advantage allows for faster model iteration and exploration of larger parameter scales, with top US models reportedly leading their Chinese counterparts by 8 to 15 months. Chinese alternatives, such as Huawei's Ascend and others from companies like Moore Thread and Biren, are emerging. They show promise in inference and some training scenarios, closing the performance gap with mid-range Nvidia products. However, the core hurdle extends beyond raw chip performance to the entrenched software ecosystem, exemplified by Nvidia's CUDA platform. The path forward involves "walking on two legs": navigating import restrictions while heavily investing in the domestic chip industry. Though still in a catch-up phase, China's vast market, talent pool, and capital are fostering progress. The ultimate test is whether Chinese firms can build a competitive hardware-software ecosystem to power the next generation of AI.

marsbit7 хв тому

The Computing Power Dilemma in the Sino-US AI Rivalry

marsbit7 хв тому

He Kaiming's Team's New Work: After Deleting VAE and Private Data, Text-to-Image Generation Becomes Even Stronger

KaiMing He's team introduces **MiniT2I**, a minimalist text-to-image (T2I) model that challenges the complexity of mainstream approaches. It eliminates components commonly considered essential: the VAE encoder-decoder, AdaLN conditioning mechanisms, auxiliary losses, private training data, and post-training alignment stages like RL/DPO. Instead, it uses a pure flow-matching objective trained directly on RGB pixels. The model employs a simplified **MM-JiT** Transformer architecture. It removes AdaLN blocks for conditioning and instead prepends two lightweight text adapter blocks to a standard pre-norm Transformer, allowing frozen T5 text features to adapt to the denoiser. Training follows a two-stage, LLM-like paradigm using only public datasets: pre-training on LLaVA-recaptioned CC12M for coverage, followed by fine-tuning on ~120k high-quality image-text pairs. With just 258M parameters (B/16), MiniT2I achieves competitive scores (0.87 on GenEval, 84.2 on DPG-Bench), outperforming larger pixel-space models. Scaling to 912M parameters (L/16) yields results comparable to SD3-Medium (~2B parameters) in style, composition, and imagination, though it lags in text rendering and named entities due to public data limitations. Key advantages include lower computational cost (~570 GFLOPs vs. ~1379 for latent models) and architectural simplicity. Acknowledged limitations include patch boundary artifacts in pixel space, side effects of high CFG scales, resolution ceilings for sequences longer than 1024 tokens, and the aforementioned data bottlenecks. The work demonstrates that high-performance T2I generation is possible with a radically simplified, publicly reproducible baseline.

marsbit11 хв тому

He Kaiming's Team's New Work: After Deleting VAE and Private Data, Text-to-Image Generation Becomes Even Stronger

marsbit11 хв тому

The Insurance Industry Faces Its Biggest Competitor: Are Prediction Markets the "Barbarians at the Gate"?

The insurance industry, long a stable "ballast" in the economy, may face a significant challenge from the rise of prediction markets, which are beginning to function as a new form of risk hedging and insurance. Platforms like Kalshi and Polymarket are demonstrating their utility in areas traditionally dominated by insurers. Examples include Kalshi's partnership with sports insurance broker Game Point Capital to offer more cost-effective hedging for NBA team performance bonuses, and Polymarket's collaboration with real estate platform Parcl, allowing users to hedge against housing price fluctuations in major US cities. A New York bar also used Kalshi to hedge a marketing promotion tied to an NBA game outcome, highlighting prediction markets' potential for small business risk management. These markets offer advantages over traditional insurance and sports betting in transparency, liquidity, and flexibility. They allow information monetization across a wider range of events, act as neutral platforms rather than direct counterparties, and provide clearer pricing. A historical precedent is the "Mattress Mack" marketing campaigns, which used sports betting for large-scale customer refunds, but prediction markets offer a more systematic and accessible model. Experts like SIG CEO Jeff Yass see their potential for efficient, parameter-based risk sharing, such as for weather-related property damage. However, challenges remain, including liquidity issues, unclear regulatory boundaries, and potential manipulation of event outcomes. Despite these hurdles, prediction markets represent a growing competitive force for both traditional gambling platforms and segments of the insurance industry.

marsbit13 хв тому

The Insurance Industry Faces Its Biggest Competitor: Are Prediction Markets the "Barbarians at the Gate"?

marsbit13 хв тому

Insurance Industry Faces Its Biggest Competitor: Are Prediction Markets the 'Barbarians at the Gate'?

"Insurance Industry Faces New Rival: Are Prediction Markets the 'Barbarians at the Gate'?" Prediction markets, exemplified by platforms like Kalshi and Polymarket, are emerging as potential disruptors to the traditional insurance industry by offering alternative risk-hedging mechanisms. These markets allow users to bet on specific event outcomes, effectively creating a form of customizable, on-demand insurance. Key examples highlight this shift. In sports, Kalshi partnered with insurance broker Game Point Capital to provide NBA teams with more affordable options to hedge performance bonuses compared to traditional insurers. In real estate, Polymarket's collaboration with Parcl lets users speculate on city-specific housing price indices, allowing homeowners to hedge against price drops or buyers against price increases. Furthermore, businesses like a New York bar have used Kalshi to hedge marketing promotions (e.g., offering free drinks if a team wins), framing the transaction explicitly as placing a "hedge." The article argues prediction markets offer advantages over traditional insurance and even sports betting in transparency, liquidity, and flexibility. They provide a wider range of event coverage, act as neutral platforms rather than counterparties, and offer clearer pricing. The piece cites historical precedents like large "refund promotion" hedges by businesses using sportsbooks but notes prediction markets modernize the concept. However, challenges remain for widespread adoption as an insurance alternative, including limited liquidity in some markets, unclear regulatory status, and potential vulnerabilities in event resolution mechanisms. Despite these hurdles, prediction markets are positioning themselves as new tools for risk management, directly challenging certain segments of the conventional insurance landscape.

Odaily星球日报18 хв тому

Insurance Industry Faces Its Biggest Competitor: Are Prediction Markets the 'Barbarians at the Gate'?

Odaily星球日报18 хв тому

Торгівля

Спот
Ф'ючерси
活动图片