Soursen

Independent writing on infrastructure, AI, security and crypto.

Security

Security

An AI Read Zcash’s Code for One Day. Then It Found the Bug That 4 Years of Human Audits Missed.

Here is a thought experiment worth sitting with. Imagine a piece of software has been audited repeatedly by some of the best cryptographers in the world. It has been live in production for 4 years. Hundreds of millions of dollars flow through it.

Last verified Also on Medium

Banner for “An AI Read Zcash’s Code for One Day. Then It Found the Bug That 4 Years of Human Audits Missed.”
Banner for “An AI Read Zcash’s Code for One Day. Then It Found the Bug That 4 Years of Human Audits Missed.”
On this page
  1. What Zcash Is, and Why This Matters More Than a Typical Bug
  2. Two Lines of Code, 4 Years, and Unlimited Counterfeit Currency
  3. How an AI Found in Hours What Experts Missed in Years
  4. The Response: Fast, Competent, and Still Not Enough to Resolve the Core Problem
  5. The Paradox at the Centre of Every Privacy Coin
  6. What the Market Said, and What That Tells You
  7. The People Who Sold
  8. The People Who Held
  9. What Comes Next, and What Can Never Be Undone
  10. The Question This Actually Raises

Here is a thought experiment worth sitting with. Imagine a piece of software has been audited repeatedly by some of the best cryptographers in the world. It has been live in production for 4 years. Hundreds of millions of dollars flow through it. The people who designed it, built it, reviewed it, and staked their professional reputations on it have all signed off.

Now imagine that an AI model reads that same code on the day it is publicly released, roughly 24 hours after it becomes available to anyone with an internet connection, and identifies a flaw so significant that it could have allowed an attacker to silently mint unlimited counterfeit currency for the entire four years the system was running.

That is not a thought experiment. That is what happened to Zcash in late May 2026. The implications reach well beyond one privacy coin, because what it tells us about the gap between human and machine pattern recognition in security-critical code is genuinely unsettling.

What Zcash Is, and Why This Matters More Than a Typical Bug

Zcash is a cryptocurrency built around one central promise: complete financial privacy.

While Bitcoin records every transaction on a fully public ledger where anyone can trace the movement of funds, Zcash offers what it calls shielded transactions, where the sender, recipient, and amount are all hidden. The technology underpinning this is called a zero-knowledge proof, a mathematical construction that lets one party prove to another that a statement is true without revealing any of the underlying information required to verify it.

In practical terms, a zero-knowledge proof allows Zcash to say this transaction is valid, the coins being spent exist, the arithmetic balances, without disclosing any of the specifics to anyone. It is elegant, mathematically powerful, and widely regarded as one of the more sophisticated privacy systems in production use. The specific implementation Zcash uses is called the Orchard Shielded Pool, which launched in May 2022 as the network’s most advanced privacy layer.

The entire system rests on a property cryptographers call soundness. Soundness is the guarantee that you cannot construct a valid proof for a false statement. If the proof says a transaction is legitimate, the transaction must actually be legitimate. That guarantee is not a nice-to-have. It is the mathematical foundation the entire privacy model sits on. Without it, the system does not just have a problem. It has no reliable basis.

The bug that sat undetected for 4 years was a crack in exactly that foundation.

Two Lines of Code, 4 Years, and Unlimited Counterfeit Currency

The vulnerability lived inside a Rust library called halo2, specifically in a component called the elliptic curve multiplication gadget. Elliptic curve cryptography is the mathematical backbone of most modern blockchain systems, including Bitcoin and Ethereum, used to verify ownership and authenticate transactions. In Zcash’s zero-knowledge circuit, this gadget performs a specific calculation as part of proving that a shielded transaction is valid.

The problem was that the gadget failed to properly constrain its inputs. In plain language, the circuit was supposed to accept only mathematically valid inputs. It was not doing that. Inputs that should have been rejected were passing the check. Cryptographers call this being under-constrained, and in a zero-knowledge proof system, being under-constrained is not a minor edge case. It means the soundness guarantee has been broken.

The consequence of that broken guarantee was severe. An attacker who understood the flaw could construct proofs for transactions that were mathematically invalid but would still pass verification. They could create Zcash inside the shielded pool that did not correspond to any real coins. Counterfeit currency, minted in unlimited quantities, completely invisible on the public ledger because the privacy mechanism that hides legitimate transactions would hide the fake ones equally well.

A real coin and a fake coin would be indistinguishable. Not just to outside observers. To anyone, including the Zcash developers themselves.

This vulnerability was present from the day the Orchard Shielded Pool launched in May 2022. It survived through multiple rounds of professional security review. The people who audited Zcash during this period were not amateurs. The codebase had been examined by cryptographers from firms like Trail of Bits, one of the most respected names in blockchain security auditing. Two lines of code. 4 years. Every human reviewer missed it.

How an AI Found in Hours What Experts Missed in Years

Taylor Hornby is a security researcher. In April 2026, he was hired by Shielded Labs, an organisation focused on Zcash’s long-term development, specifically to audit Zcash’s cryptographic infrastructure. His brief was to look for problems proactively rather than wait for one to surface.

Anthropic released Claude Opus 4.8 on May 28, 2026. Hornby discovered the bug on May 29. The gap between those two events is approximately 24 hours.

The important detail here is how Hornby used the model, because he did not simply paste the code into a chat window and ask what was wrong. He built what he described as a custom auditing framework, reportedly calling it a Zcash full-stack auditor, with carefully constructed prompts designed specifically to hunt for constraint failures in zero-knowledge circuits. He was directing the AI toward a specific class of vulnerability, using its pattern recognition capabilities within a structured methodology he had designed for the purpose.

The AI identified the under-constrained elliptic curve multiplication gadget. It then went further, helping Hornby write a working proof-of-concept exploit. When he ran it in a local test environment, the exploit succeeded. It generated unlimited counterfeit Zcash, invisible on-chain, exactly as the theoretical analysis predicted it would.

Shielded Labs confirmed the exploit worked. They said they believed Hornby had found it before any attacker did. The word they used was probably. That word is doing a lot of work.

This raises a question that extends beyond Zcash. If a model that had been publicly available for one day could identify a vulnerability of this magnitude in one of the most scrutinised codebases in crypto, the security assumptions underlying every comparable system become uncertain. Hornby’s methodology, combining structured prompting with AI pattern recognition to specifically target constraint failures, is reproducible. The security research community is now working through the implications. Reports suggest Hornby may be turning his attention to other privacy coin codebases, including Monero, though no formal announcement has been confirmed.

The Response: Fast, Competent, and Still Not Enough to Resolve the Core Problem

Credit where it is due. Once the vulnerability was confirmed, the Zcash development team moved with unusual speed.

On June 1 and 2, developers deployed an emergency soft fork that temporarily disabled all Orchard transactions, closing the attack window while a permanent fix was prepared. On June 3, the NU6.2 hard fork activated with a corrected circuit. The reason a hard fork was required, rather than a simpler update, is instructive. Changing even two lines of a zero-knowledge circuit changes its cryptographic verifying key. Every node in the network must upgrade to the new key to verify transactions correctly. There is no way to patch this class of vulnerability without requiring the entire network to move simultaneously.

The transition was not seamless. Block explorer synchronisation failures lasted over 4 hours, creating the visual appearance of a network halt, though the Zcash mainnet itself continued producing blocks throughout. Orchard transactions remained suspended for approximately 24 hours across the full remediation window.

When the dust settled, the official position was that no evidence of exploitation had been found. That statement is true. It is also, from a cryptographic standpoint, essentially the only statement that could ever be made, regardless of what actually happened.

The Paradox at the Centre of Every Privacy Coin

This is the part of the story that does not get resolved by a fast patch or a competent development team, because it is not a bug. It is a structural feature of the design.

Orchard’s privacy protections hide all transaction amounts and all participant identities from everyone, including the developers. When the Zcash Foundation said they found no evidence of exploitation, what they meant precisely is that they found no public-chain signals that exploitation occurred. They cannot say more than that, because the privacy mechanism that makes Zcash valuable makes that kind of verification impossible.

Consider what that means in practice. If an attacker had identified this vulnerability independently before Hornby, minted a large quantity of counterfeit Zcash inside the shielded pool, and simply held those coins without moving them, the turnstile mechanism that tracks value crossing between pools would show nothing unusual. The attacker would be sitting on an invisible reserve of currency that should not exist, with no verifiable way for anyone to detect it.

The Zcash developers do point to the turnstile as a meaningful safeguard. If an attacker tried to profit by moving counterfeit coins to a transparent address or an exchange, the turnstile would register a surplus that does not reconcile with the legitimate supply. That is a real defence. Its limitation is that it only functions if the attacker moves the coins. A patient attacker who never moves them remains invisible indefinitely.

The exact feature that protects your financial privacy is the same feature that makes it impossible to verify the total supply of the currency you are holding. Those two properties are not in tension. They are the same property, viewed from two different angles.

This is not specific to Zcash. It is the fundamental trade-off of any fully private monetary system. Bitcoin’s entire value proposition as sound money rests partly on the fact that you can verify the supply at any time. Anyone can check the blockchain and confirm that exactly 21 million Bitcoin will ever exist. With a fully shielded system, that kind of verification is by design impossible. You are trusting a mathematical proof system to be correct. This incident demonstrated that those proof systems can contain flaws that survive years of expert review.

What the Market Said, and What That Tells You

Before the full disclosure on approximately June 5, ZEC was trading between $620 and $640. Within a day or two of the vulnerability becoming public, the price had fallen to intraday lows between $255 and $310. That is a decline of roughly 50% to 57%. Approximately $5 billion in market capitalisation was erased.

Illustration for the section “What the Market Said, and What That Tells You”

What analysts noted about the sell-off was its character. This was not the leverage-driven cascade that typically characterises large crypto price drops, where futures positions get liquidated in sequence, amplifying the move. The selling was primarily spot-driven, meaning actual holders selling actual coins, which indicates genuine loss of conviction rather than a technical market event. Liquidations were substantial, with some trackers reporting nine-figure totals in a single twenty-four-hour window, though exact figures were not independently confirmed.

Cypherpunk Holdings, a Winklevoss-backed company listed on NASDAQ that holds Zcash as a treasury asset, watched its stock fall approximately 37% on disclosure, closing at $59. The company held approximately 303,900 ZEC at an average cost basis of roughly $333 per coin, putting the position briefly and deeply underwater.

The People Who Sold

Arthur Hayes, co-founder of BitMEX and a well-known figure in crypto markets, disclosed publicly that he liquidated his entire Zcash position on the day of disclosure. His reasoning was specific and worth examining on its own terms. He was not claiming an exploit had definitely occurred. He was arguing that the privacy thesis for a coin like Zcash depends on a narrative of mathematical perfection, not mathematical probability. In his framing, a supply that cannot be cryptographically verified is a broken promise to holders, regardless of how unlikely actual exploitation might be.

On-chain researcher ZachXBT responded by pointing out that Hayes had publicly exited four previously hyped positions within roughly fifteen days, raising the question of whether followers were being used as exit liquidity. The criticism landed. Hayes’s standing in crypto circles took a visible hit in the days following.

The People Who Held

Cypherpunk Technologies and Cameron Winklevoss reaffirmed their position. Their argument was that the bug had been found by a researcher the project itself commissioned, not by a hostile attacker, and that the patch was deployed within days of discovery. They characterised this as evidence of a mature security culture rather than a sign of fundamental failure.

Grayscale’s legal team made a statistical argument: any attacker sophisticated enough to have independently found and exploited this vulnerability would almost certainly have cashed out during the significant Zcash bull run that occurred prior to disclosure, rather than sitting silently on an invisible reserve. The counterargument is that we are assuming rationality and impatience on the part of a hypothetical attacker. Neither assumption can be verified. Grayscale’s public statement laid out their reasoning in detail.

Both positions are defensible. That is precisely what makes the situation uncomfortable. The honest answer is that nobody knows, not in the probabilistic sense of unlikely, but in the stronger sense of unknowable with the information available.

What Comes Next, and What Can Never Be Undone

The Zcash development team has announced an upgrade called Ironwood, targeted for late July 2026, which includes a strict turnstile accounting mechanism. The Ironwood proposal would force all coins migrating from the old Orchard pool through a publicly auditable checkpoint, enabling what amounts to a verifiable census of the supply at that moment.

Understanding precisely what Ironwood can and cannot establish is important. If the supply reconciles cleanly when coins migrate through the new checkpoint, that is the strongest possible signal that the books are honest. It is not cryptographic proof that exploitation did not occur, because it cannot account for coins that were minted and are being held inside the old pool without ever moving. It is, however, evidence that is currently absent, and its presence or absence after the migration will be informative.

What Ironwood cannot do is retroactively verify the history of the Orchard pool from May 2022 to the present. That history is sealed by the same privacy guarantees that sealed it before the bug was found. The window of uncertainty covers four years. It does not close when Ironwood activates.

The broader question the security research community is now sitting with is less about Zcash specifically and more about what Hornby’s methodology implies for other systems. Zero-knowledge proof circuits are complex, difficult to audit, and increasingly deployed in high-value contexts. The Ethereum Foundation has invested heavily in ZK-rollup technology, which uses related cryptographic constructions. If constraint failures of this kind can survive four years of expert review in one of the most watched codebases in privacy-focused crypto, the audit confidence levels assigned to comparable systems deserve reconsideration.

The Question This Actually Raises

What the Zcash incident is really asking you to think about is not whether Zcash is safe to hold or whether an exploit happened. It is a more fundamental question about what you are trusting when you hold a fully private asset.

With Bitcoin or Ethereum, the trust model is explicit and auditable. The supply is public. The transaction history is public. Anyone with the technical capability can verify that the rules of the system are being followed. The transparency is not incidental. It is the mechanism by which trust is established without requiring you to trust any particular party.

A fully shielded privacy coin inverts that model. The privacy is the product. The opacity is the feature. You are trusting the mathematics, the implementation of the mathematics, and the audit history of that implementation to all be correct. This incident did not break the mathematics. It found a flaw in the implementation of the mathematics, a flaw that survived the audit history. The mathematics itself, the underlying zero-knowledge proof theory, remains sound.

The question is whether that distinction matters to you as a holder. A system can be theoretically sound and still contain implementation errors that undermine its guarantees in practice. That is true of every complex software system ever built. What is unusual here is that the privacy mechanism makes it impossible to determine whether any particular error was exploited.

The Ironwood upgrade in late July will provide the clearest available signal. If the supply reconciles, the most likely interpretation is that the books are honest. If it does not reconcile cleanly, the implications are severe and probably irreversible. Either way, the four years before that migration are not something any audit can retroactively resolve.

What Hornby and his AI-assisted methodology demonstrated is that the tools available for finding these vulnerabilities have changed substantially. The question that follows is whether the tools available for verifying that they were never exploited have changed at all. The answer, in a fully private system, is that they have not, because the privacy that needs protecting and the transparency that enables verification are in direct conflict by design.

That is not a solvable problem. It is the trade-off you accept when you hold a privacy coin. This incident just made that trade-off harder to ignore.

Sources

  1. Zcash Official Website — Protocol overview and privacy model documentation.z.cash. Accessed 15 June 2026.
  2. ZIP-0224: Orchard Shielded Protocol — Technical specification for the Orchard Shielded Pool, launched May 2022.zips.z.cash. Accessed 15 June 2026.
  3. halo2 Library on GitHub — The Rust cryptographic library containing the elliptic curve multiplication gadget where the vulnerability resided.github.com. Accessed 15 June 2026.
  4. Shielded Labs — Organisation that commissioned Taylor Hornby’s audit in April 2026.shieldedlabs.net. Accessed 15 June 2026.
  5. Anthropic: Claude Opus 4.8 Release — Released May 28, 2026. Bug discovered May 29.anthropic.com. Accessed 15 June 2026.
  6. ZIP-0253: NU6.2 Hard Fork Specification — The emergency hard fork deployed June 3, 2026 with the corrected zero-knowledge circuit.zips.z.cash. Accessed 15 June 2026.
  7. ZIP-0255: Ironwood Upgrade Proposal — Proposed strict turnstile accounting mechanism targeted for late July 2026.zips.z.cash. Accessed 15 June 2026.
  8. ZEC Price History on CoinMarketCap — Price data showing the decline from $620 to $640 range to intraday lows of $255 to $310 following disclosure.coinmarketcap.com. Accessed 15 June 2026.
  9. Cypherpunk Holdings — Winklevoss-backed NASDAQ-listed company holding approximately 303,900 ZEC as treasury asset.cypherpunk.holdings. Accessed 15 June 2026.
  10. Grayscale Public Statement on Zcash Security Assessment 2026 — Grayscale legal team’s analysis of exploitation probability.grayscale.com. Accessed 15 June 2026.
  11. Trail of Bits Security Research — One of the leading blockchain security audit firms that previously reviewed Zcash’s codebase.trailofbits.com. Accessed 15 June 2026.
  12. Arthur Hayes Public Statement — Hayes’s public disclosure of his Zcash exit and reasoning on disclosure day.twitter.com. Accessed 15 June 2026.
  13. Ethereum Foundation: ZK-Rollup Documentation — Context on zero-knowledge proof deployment across the broader Ethereum ecosystem.ethereum.org. Accessed 15 June 2026.
  14. Monero Project — Privacy coin whose codebase has been reported as a potential next audit target for Hornby’s methodology.getmonero.org. Accessed 15 June 2026.
  15. Zcash Foundation Security Disclosure — Official Zcash Foundation statement on the vulnerability, including the admission that exploitation during the four-year window cannot be cryptographically disproven.zfnd.org. Accessed 15 June 2026.

Search