Zero-Knowledge Proofs · 2 of 5L3algorithms
From Interactive to Non-Interactive: Fiat-Shamir, Commitments, and the Random-Oracle Caveat
Live back-and-forth is inconvenient. The Fiat-Shamir transform turns an interactive proof into a single string anyone can check by letting a hash function play the verifier's role.
Abstract
This article explains how zero-knowledge proofs are made non-interactive — collapsed from a live conversation into a single proof string that anyone can verify offline. It motivates the goal: a posted, publicly checkable proof needs no live prover and no shared randomness, which is what verifiable inference and public ledgers require. It builds the two ingredients. First, commitment schemes, the binding-and-hiding primitive that lets a prover lock in a value it cannot later change while revealing nothing yet, giving the commit-challenge-response shape of a sigma protocol. Second, the Fiat-Shamir transform, which replaces the verifier's random challenge with the output of a hash function applied to the statement and the prover's commitment — since a good hash is unpredictable, the prover can compute its own challenge honestly and cannot cheat by grinding, yielding a non-interactive proof. It then gives the essential caveat: Fiat-Shamir is proven secure only in the random-oracle model, an idealization real hash functions do not perfectly meet, and it must hash the full statement to avoid weak-Fiat-Shamir attacks. It closes on the AI stakes: non-interactivity is what lets a proof of a model's inference be published once and checked by any party or agent. The theme: a hash function, treated as a public source of unpredictable challenges, removes the interaction and makes zero-knowledge proofs portable.
The interactive proofs of the previous article require a live conversation: the verifier must be present to issue fresh random challenges, and the resulting conviction is personal to that one verifier. For most real uses this is impractical — you want a proof you can compute once, publish, and have anyone check later without talking to you. The Fiat-Shamir transform achieves exactly that, turning an interactive protocol into a single non-interactive proof string by letting a hash function stand in for the verifier's randomness. This article develops the commitment schemes that give proofs their structure, the transform itself, and the random-oracle caveat that qualifies its security.
Why remove the interaction
An interactive proof convinces one verifier, live, through challenges only that verifier issued. That is a poor fit for the situations where proofs are most useful. A proof attached to a transaction on a public ledger must be checkable by everyone, forever, with no prover still online. A proof that a model produced an output must be verifiable by any party who later receives it, not just by whoever happened to be in the conversation. What is wanted is a proof that is a self-contained object: computed once, posted, and independently verifiable by anyone.
Non-interactivity also removes a subtle trust problem. In an interactive proof the verifier's challenges must be genuinely random and unpredictable to the prover; if the prover could influence or foresee them, soundness would collapse. Coordinating that fresh randomness between parties, and convincing third parties it was honest, is awkward. A non-interactive proof sidesteps it by deriving the challenge deterministically from public data in a way no one can manipulate.
The goal, then, is to preserve completeness, soundness, and zero-knowledge while eliminating the live exchange — to keep the guarantees of an interactive proof in an object that needs no interaction to check. The route runs through two ideas: a way for the prover to lock in its first message irrevocably, and a way to manufacture the verifier's challenge without a verifier.
Commitments: the building block
A commitment scheme lets a prover seal a value in an envelope: it publishes a commitment that fixes the value without revealing it, and can later open the envelope to show what was inside. Two properties make this useful. Binding means the prover cannot change the committed value after the fact — once committed, it is stuck with it. Hiding means the commitment reveals nothing about the value until it is opened. Together they let a prover say I have chosen a value and cannot change it, but I am not telling you what it is yet.
This is precisely the structure many zero-knowledge protocols need. In a sigma protocol — the three-move template underlying much of the field — the prover first sends a commitment, the verifier replies with a random challenge, and the prover sends a response that opens the commitment in a way consistent with the challenge. Binding is what makes the protocol sound: because the prover locked in its commitment before seeing the challenge, it cannot retrofit an answer for a false statement across many possible challenges. Hiding is what supports zero-knowledge: the commitment leaks nothing on its own.
The commit-challenge-response shape is the hinge on which non-interactivity turns. The prover's first move, the commitment, is fixed before any challenge exists; the only thing that must come from the verifier is the challenge in the middle. If that single random value could be produced without a verifier — while remaining unpredictable to the prover until after it has committed — the interaction would be unnecessary. That is exactly what the Fiat-Shamir transform arranges.
The Fiat-Shamir transform
The Fiat-Shamir transform replaces the verifier's random challenge with the output of a hash function applied to the statement being proved and the prover's commitment. Instead of waiting for a verifier to send a random challenge, the prover computes the challenge itself by hashing what it has produced so far. Because a good hash function's output is effectively unpredictable until the input is fixed, the challenge behaves like a fresh random value that the prover could not have known before committing — the very property soundness required of the verifier's challenge.
Crucially, the prover cannot cheat by choosing a favorable challenge. The challenge is a deterministic function of the commitment, so to try a different challenge the prover would have to change its commitment, which changes the hash, which changes the challenge again — there is no way to aim for a challenge it can answer for a false statement without doing infeasible work to find a hash collision or preimage. The prover is thus forced to play honestly against a challenge it cannot control, exactly as if a real verifier had supplied it.
The result is a single non-interactive proof: the commitment together with the response, from which any verifier can recompute the challenge by hashing the statement and commitment and then check the response. No interaction, no shared randomness, no live prover — the proof is a self-contained string. The same transform preserves zero-knowledge in the idealized model, giving a non-interactive zero-knowledge proof. This one idea, hashing the transcript to synthesize the challenge, is what makes practically every deployed proof system non-interactive.
The random-oracle caveat, and the AI stakes
The security of Fiat-Shamir is proved in the random-oracle model, an idealization in which the hash function is treated as a truly random function that every party can query but no one can predict. In that model the transform is provably sound and zero-knowledge. Real hash functions are not random oracles — they are fixed, public algorithms — so the proof is a heuristic argument rather than a guarantee in the standard model, and there are contrived schemes secure with a random oracle but insecure with any concrete hash. In practice, instantiated with a strong hash, Fiat-Shamir has proven robust and is universally used, but the caveat is real and worth stating honestly.
There is also a concrete implementation pitfall. The hash must bind the entire statement, not merely the prover's commitment; the so-called weak Fiat-Shamir mistake of hashing too little has produced real vulnerabilities in deployed systems, letting a prover forge proofs for statements it never legitimately proved. Correct Fiat-Shamir hashes the full public input along with the commitment, and getting this right is a recurring source of subtle bugs — a reminder that the transform is simple to state but must be applied carefully.
For AI, non-interactivity is what makes verifiable inference deployable. A proof that a model produced a given output on a committed input is only useful if it can be published once and checked by anyone — a user, an auditor, another agent — without a live session with the prover. Fiat-Shamir is what turns the interactive zero-knowledge proof of the previous article into that portable, postable object, and it is why the succinct non-interactive systems of the coming articles are built on this foundation. The trade is a well-understood heuristic assumption about the hash function in exchange for proofs that travel freely across a network of mutually distrustful parties and agents, which is exactly the setting verifiable AI must operate in.
Key takeaways
- Non-interactive proofs are self-contained strings computed once, posted, and checkable by anyone offline — what ledgers and verifiable inference require.
- Commitment schemes provide binding (cannot change the value) and hiding (reveals nothing yet), giving the commit-challenge-response shape of a sigma protocol.
- Binding makes the protocol sound because the prover locks in its commitment before the challenge; hiding supports zero-knowledge.
- Fiat-Shamir replaces the verifier's random challenge with a hash of the statement and commitment, so the prover computes an unpredictable challenge it cannot grind.
- The proof becomes a single string (commitment plus response) whose challenge any verifier recomputes by hashing — no interaction or live prover needed.
- Security holds only in the random-oracle model (a heuristic for real hashes), and the hash must bind the full statement or weak-Fiat-Shamir forgeries become possible.
Practitioner Toolkit
Copy-paste, strictly defensive artifacts you can use today. Nothing here attacks a real system.
Guards against the common mistakes.
- Does the hash bind the full public statement, not just the commitment?
- Is the underlying interactive protocol a sound sigma protocol?
- Is a strong, collision-resistant hash used to instantiate the challenge?
- Is the random-oracle assumption acceptable for the threat model?
- Are commitments binding and hiding as the soundness and zero-knowledge arguments require?
How interaction is removed.
- Prover commits to its first message.
- Challenge is set to a hash of the statement and commitment.
- Prover responds; the proof is the commitment plus response, checkable by anyone.
A stub recording the Fiat-Shamir requirements.
fiat_shamir:
base_protocol: sigma
challenge: hash(statement, commitment)
hash_binds: full_statement # avoid weak Fiat-Shamir
security_model: random_oracle
proof_output: [commitment, response]
verifier: recompute_challenge_and_checkGlossary
- Non-interactive proof
- A single proof string that any verifier can check offline without interacting with the prover.
- Commitment scheme
- A primitive that lets a prover lock in a value (binding) while revealing nothing about it until opened (hiding).
- Binding
- The commitment property that the prover cannot change the committed value after publishing the commitment.
- Hiding
- The commitment property that the commitment reveals nothing about the value until it is opened.
- Sigma protocol
- A three-move commit-challenge-response protocol underlying many zero-knowledge proofs.
- Fiat-Shamir transform
- A method that makes a proof non-interactive by deriving the verifier's challenge from a hash of the statement and commitment.
- Random-oracle model
- An idealization treating a hash function as a truly random function; the setting in which Fiat-Shamir is proven secure.
References
- Fiat, Shamir, How to Prove Yourself: Practical Solutions to Identification and Signature Problems (CRYPTO 1986)
- Bellare, Rogaway, Random Oracles are Practical (CCS 1993)
- Canetti, Goldreich, Halevi, The Random Oracle Methodology, Revisited (J. ACM 2004)
- Dao, Miller, Wong, Weak Fiat-Shamir Attacks on Modern Proof Systems (IEEE S&P 2023)
- Thaler, Proofs, Arguments, and Zero-Knowledge (monograph, 2022)