Proof-based general-purpose computing with Magnetar
https://www.microsoft.com/en-us/research/blog/proof-based-general-purpose-computing-with-magnetar/📌 Magnetar:只靠雜湊函式,讓程式執行可以被數學證明
TL;DR:Microsoft Research 推出 zkVM「Magnetar」,用標準雜湊函式證明 RISC-V 程式的執行,速度達每秒數百萬指令。
當一個 AI agent 代替你做決策、一間金融機構說自己的交易處理無誤,你要怎麼確認,而不是單純相信?零知識證明給出的答案是:讓程式執行的同時,附上一份簡短、可快速驗證的數學證明。
🤔 信任與驗證之間,缺的是什麼
每個電腦運算結果背後都藏著一個問題:程式真的照著宣稱的方式執行、並得出正確輸出了嗎?目前多數情況下,答案仍仰賴一定程度的信任,加上合約、稽核與日誌來補強。零知識證明提供了另一種路徑:程式執行完畢後,連同輸出一起產生一份短小、驗證速度快的密碼學證明,接收者不需要重跑程式,就能在毫秒級時間內確認結果,還能把證明轉交給其他需要同樣保證的人。若具備零知識特性,證明本身也不會洩漏任何該保密的輸入內容。
這個概念從 1980 年代就存在,但一直受限於三個難以同時解決的挑戰:效率(過去產生證明所需的運算量,比單純執行程式多出數百萬倍)、通用性與易用性(許多證明系統要求開發者手動把程式改寫成固定的密碼學電路,耗時數月,且每次程式異動都要重做,翻譯過程本身也常是安全漏洞來源),以及安全性(許多證明系統建立在可被量子電腦破解的橢圓曲線上,或仰賴尚未經過長期檢驗、甚至基於未被證明的數學猜想的新密碼學函式)。
🧩 從 sum-check 到 Spartan,再到 Magnetar
Microsoft Research 過去十餘年在零知識證明與可驗證計算上的早期研究走了兩條路,但都只適用於小型程式:第一條路用一種名為 sum-check protocol 的技術,讓驗證者透過與證明者的簡短對話檢查一段長運算,但只適用於具有特定分層結構的計算;第二條路靠橢圓曲線密碼學產生極小的證明,幾乎適用於任何計算,但需要一次性的信任設置(trusted setup),一旦其中的秘密資訊外洩,任何人都能偽造證明,而且同樣無法抵禦量子電腦。
2019 年出現的零知識證明系統 Spartan 重新採用 sum-check 的思路,使其適用於通用程式,且不需要信任設置。Spartan 的另一個特性是可以搭配不同的密碼學底層元件,這個彈性後來讓整套系統得以完全建立在雜湊函式之上。一系列後續研究補齊了剩下的拼圖,而 Magnetar 正是把這些拼圖拼在一起的成果。
Magnetar 是一個 zkVM(零知識虛擬機),它證明的是 RISC-V 這種開放處理器架構的執行,而 RISC-V 有成熟的編譯器支援所有主流語言。開發者用 Rust、Go 或 C 寫程式,照常編譯,Magnetar 就能依照程式原樣產生證明,不需要手動改寫成電路。這意味著一份商業政策、一條資料管線、甚至一個以太坊虛擬機(EVM)的解譯器,只要是程式,維護它的工程師就能直接證明其執行過程,產生證明不再是專家才能做的事。
📊 速度與安全性的實測數據
Magnetar 在筆記型電腦上每秒可證明 720 萬到 870 萬條處理器指令。在涵蓋密碼學雜湊運算到小型 EVM 解譯器內代幣轉移的 15 個基準程式測試中,它平均比同機器上最快的現有 zkVM 快 10 到 39 倍,在一個代幣轉移基準測試中,比另外兩個系統快超過 300 倍。經過最佳化的版本每秒可證明 950 萬到 1280 萬個 cycle,使上述各項加速倍數再提升約 1.3 倍。它產生的證明驗證時間約為 12 毫秒。
安全性方面,Magnetar 僅依賴 SHA-256 或 SHA-3 這類標準雜湊函式,不需要橢圓曲線、不需要 lattice、不需要特製的密碼學雜湊函式、不需要信任設置,也不依賴任何未經證明的錯誤更正碼猜想。雜湊函式是密碼學工具中被研究最透徹的基本元件,也是 NIST 標準化的無狀態雜湊式簽章所採用的保守後量子選項之一。對一個必須在未來數十年仍可信任的系統來說,只依賴標準雜湊函式,等於從未來的技術路線圖上移除了一次密碼學遷移的負擔。
💡 驗證證明本身,也是 Magnetar 擅長的運算
這個設計決策還帶來第二個好處:檢查一份 Magnetar 證明主要就是計算標準雜湊函式與二元體(binary-field)運算,恰好正是 Magnetar 本身能夠高效證明的運算類型。換句話說,驗證一份證明對它來說是一般的工作負載,這讓 Magnetar 可以把任意大小的計算拆成多個片段分別證明,再把片段組合起來,也因此能夠證明像帳本或區塊鏈這類長時間執行的系統。
🎯 實務啟示
對已經在維護業務邏輯、資料管線或鏈下計算的工程團隊而言,Magnetar 釋出的訊號是:產生執行證明不再需要重寫一份電路版本的程式,而是直接對現有的 Rust/Go/C 程式下手。若團隊正在評估可驗證運算或 AI agent 的合規性保證,現在值得關注的問題,可能不再是「證明程式執行是否可行」,而是「哪些結果值得被證明,而不是被信任」。
🔗 來源
- 標題:Proof-based general-purpose computing with Magnetar
- 作者/機構:Microsoft — Srinath Setty
- 連結:https://www.microsoft.com/en-us/research/blog/proof-based-general-purpose-computing-with-magnetar/
#ZeroKnowledgeProofs #zkVM #Magnetar #MicrosoftResearch #VerifiableComputing #RISCV #Cryptography #PostQuantum #Blockchain #AIAgents
原始資料 Microsoft Research · 收集於 2026-10-15
摘要原文
Every result a computer produces comes with an implicit question: did the program run as claimed and produce correct outputs? Today, answering that question often requires a degree of trust alongside verification. We trust the operator, the vendor, the counterparty, or the agent, and we rely on contracts, audits, and logs to establish that trust. Zero-knowledge proofs offer a fundamentally different approach to establishing trust. A program runs, and along with its output it produces a short proof, a cryptographic certificate that this program, on these inputs, produced this output. The proof is small and fast to check. Whoever receives it can confirm the result in milliseconds without rerunning the program, and can pass the proof on to anyone else who needs the same assurance. With the zero-knowledge property, the proof also reveals nothing about inputs that should stay private. This changes what correctness means in the real world. A result no longer has to be trusted because of who produced it. It can be checked because of what accompanies it. An AI agent acting on someone’s behalf could attach a proof that each action complied with the policy it was given. Regulated financial institutions could prove that transactions were processed correctly without making their transactions public. These become possible once producing a proof is as routine as running the program. Zero-knowledge proofs were invented in the 1980s, and the ideas behind proving program execution have been around nearly as long. What has kept them from becoming a general tool is three challenges that have resisted being solved at the same time. Efficiency . Producing a proof has historically taken millions of times more computation than running the program itself. Years of research have brought that overhead down, but the fastest systems have achieved their speed by making compromises elsewhere. Generality and usability. Many proof systems require developers to manually rewrite their program as a cryptographic circuit, which is a fixed arithmetic description of that exact computation. This takes months. Every change to the application means a new circuit, and the translation is itself a frequent source of security bugs. A general-purpose alternative is to prove the execution of an ordinary processor, so that any compiled program can be proven as written. Until recently, that generality came at a steep cost in speed or security. Security. A proof is only as strong as the cryptography beneath it. Many proof systems rest on elliptic curves, which can be broken by a sufficiently powerful quantum computer. Microsoft is addressing this problem with its Quantum Safe Program, which will move its products and services to post-quantum cryptography, a goal it recently accelerated to 2029 . Post-quantum proof systems already exist, but some rest on lattice assumptions, and most rest on new cryptographic functions invented to reduce the cost of proving. These new cryptographic functions have not faced the decades of scrutiny given to the cryptography protecting today’s internet, and some rest on mathematical conjectures about error-correcting codes that have not been proven. They have bought their speed with strong assumptions. For more than a decade, Microsoft Research has worked on making zero-knowledge proofs and verifiable computing practical. Early research followed two approaches, both practical only for small programs. The first (opens in new tab) (opens in new tab) lets a verifier check a long computation through a short conversation with the prover using a technique called the sum-check protocol (opens in new tab) , but this applied only to computations with a particular layered structure. The second (opens in new tab) (opens in new tab) used elliptic-curve cryptography to create very small proofs for almost any computation. But this requires a one-time trusted setup involving secret information which, if leaked, could allow anyone to forge proofs. This approach is also vulnerable to quantum computers. In 2019, a new zero-knowledge proof system called Spartan returned to the sum-check approach and made it work for general-purpose programs without a trusted setup. Spartan can also be instantiated with different cryptographic building blocks. That flexibility is what later allowed the proof system to be built on hash functions alone. A sequence of results then filled in the remaining pieces: Each of these solved a piece of the problem. Magnetar is where the pieces come together. Magnetar is a zero-knowledge virtual machine, or zkVM, and it makes major progress on all three challenges at once. It is general-purpose. Magnetar proves the execution of RISC-V, an open processor architecture with mature compilers for every mainstream language. A developer writes a program in Rust, Go, or C, compiles it as usual, and Magnetar proves it as written. Consider what this means in practice. A business policy, a data pipeline, or an interpreter for the Ethereum Virtual Machine (EVM) is just a program, and the engineers who already maintain it can prove their executions exactly as written. As a result, proving stops being a specialist activity. It is faster than prior systems in the same class. Magnetar proves 7.2 to 8.7 million processor instructions per second on a laptop. Across 15 benchmark programs, from cryptographic hashing to token transfers inside a small EVM interpreter, it is 10 to 39 times faster on average than the fastest existing zkVMs on the same machine, and more than 300 times faster than two others on a token-transfer benchmark. An optimized Magnetar proves 9.5–12.8 million cycles per second, which increases each speedup reported here by about 1.3×. Its proofs verify in about 12 milliseconds. Its security rests on standard cryptography. Magnetar depends on a standard hash function such as SHA-256 or SHA-3, the same primitives that already protect every organization’s systems. It requires no elliptic curves, no lattices, no special-purpose hash functions, no trusted setup, and no unproven conjecture about error-correcting codes. Hash functions are the most thoroughly studied primitives in the cryptographic toolkit, and they are the basis of the stateless hash-based signatures that NIST standardized as its own conservative post-quantum option. For a system that must still be trustworthy in many decades to come, relying only on standard hash functions removes a cryptographic migration from the roadmap. The same design decision pays a second dividend. Checking a Magnetar proof consists mostly of evaluating standard hash functions and binary-field arithmetic, which are exactly the operations Magnetar proves efficiently. Verifying a proof is therefore an ordinary workload for it. This is what allows Magnetar to prove computations of any size, by proving them in pieces and then combining the pieces. This also allows Magnetar to prove a long-running system such as a ledger or a blockchain. The technical paper gives the full design, security analysis, and measurements. Magnetar advances zero-knowledge proofs and verifiable computing to a stage where they can be built on the cryptography that organizations already trust, at speeds that make it usable, by engineers who write normal code. Magnetar enables a future where cryptographic proofs are a routine output of computation. We expect that technology leaders will stop asking whether proofs of execution are practical and focus instead on which results would they prefer to verify rather than taking on trust . If you’re interested in exploring how zero-knowledge proofs can support your use case, we’d love to hear from you (opens in new tab) . The post Proof-based general-purpose computing with Magnetar appeared first on Microsoft Research .
由 claude-code/sonnet 自動生成