# Proving the Wrong Program: Miscompilations as a Threat to zkVM Guarantees

DevFeed: [Proving the Wrong Program: Miscompilations as a Threat to zkVM Guarantees](<https://devfeed.tech/articles/proving-the-wrong-program-miscompilations-as-a-threat-to-zkvm-guarantees-116157.md>)

Original publisher: [Read original article](<https://arxiv.org/abs/2611.04701>)

Author: Hui Xuan Tan, Stefanos Chaliasos, Alastair F. Donaldson

Published: 2026-11-04T05:00:00Z

Content type: article

Language: en

Sources: [arXiv: Cryptography and Security](<https://devfeed.tech/sources/arxiv-cryptography-and-security.md>)

Topics: [LLVM](<https://devfeed.tech/topics/llvm.md>), [Zero-knowledge proof](<https://devfeed.tech/topics/zkp.md>), [toolchain](<https://devfeed.tech/topics/toolchain.md>)

Tags: [bug](<https://devfeed.tech/tags/bug.md>), [bugs](<https://devfeed.tech/tags/bugs.md>), [compiler](<https://devfeed.tech/tags/compiler.md>), [cs-cr](<https://devfeed.tech/tags/cs-cr.md>), [cs-pl](<https://devfeed.tech/tags/cs-pl.md>), [llvm](<https://devfeed.tech/tags/llvm.md>), [risc-v](<https://devfeed.tech/tags/risc-v.md>), [rust](<https://devfeed.tech/tags/rust.md>), [virtual-machine](<https://devfeed.tech/tags/virtual-machine.md>), [zero-knowledge](<https://devfeed.tech/tags/zero-knowledge.md>)

## AI overview

The study finds that compiler miscompilations can undermine zkVM guarantees even when the zkVM and guest source are correct. Among 88 known rustc and LLVM bugs tested, 48 caused wrong outputs on SP1 and 46 on Jolt; many others did not reproduce because their faulty code was unreachable on the target. Accidental effects on existing guests appeared uncommon: across 552 buildable guest-bug pairs from 13 guests in 10 SP1 projects, 447 produced byte-identical binaries, while the rest had the same code or agreed on tested inputs. By contrast, an LLM agent found source-preserving, optimization-like patches that exposed bugs in 12 of 366 project-bug pairs across 11 of 20 projects. Four led to wrong outputs, including an Ethereum client rejecting a valid block; eight caused failures on valid inputs. The authors recommend treating the compiler as part of the trusted base and tracking known toolchain bugs.

## Source excerpt

arXiv:2611.04701v1 Announce Type: cross Abstract: A zero-knowledge virtual machine (zkVM) lets an untrusted prover convince a verifier that a program, typically Rust compiled to RISC-V, ran correctly. The proof covers the compiled binary, so a miscompilation can make a correct zkVM produce a valid proof of a computation that differs from the developer's source. We present the first empirical study of miscompilation as a threat to zkVM guarantees, on the production zkVMs SP1 and Jolt. We assemble 88 known rustc and LLVM miscompilations with Rust reproducers, using an LLM agent to recover Rust triggers for 60 of 124 LLVM bugs reported only as LLVM IR. Many of the bugs carry over to zkVMs: 48 of the 88 make a guest commit a wrong output on SP1 and 46 on Jolt, including the same 15 rustc bugs on both. Most bugs that do not reproduce never reach the faulty code on the zkVM's target, e.g. because they need an instruction-set extension. Existing guest programs are rarely affected by accident. Across 13 guests of 10 popular SP1 projects, the buggy and the fixed compiler produce byte-identical binaries in 447 of the 552 guest-bug pairs that build, and the other 105 have the same code or agree on every input we ran. An attacker who contributes code to a guest, however, can trigger these bugs on purpose. For about $40 per project, an LLM agent found patches that look like ordinary optimisations, preserve the behaviour of the guest's source, and expose a known bug in 12 of 366 project-bug pairs, across 11 of 20 projects. In four cases the guest commits a wrong output, including an Ethereum client that rejects a valid block, and in the other eight it fails on a valid input. Reviewing or formally verifying the zkVM or the guest's source cannot catch such a patch, because both are correct. zkVM projects should treat their compiler as part of their trusted base and track the known bugs of their toolchain.