TruthTable: A Verifiable Query Engine
Ryan Marcus (University of Pennsylvania), Pratyush Mishra (University of Pennsylvania), Bharath Namboothiry (University of Pennsylvania), Alireza Shirzad (University of Pennsylvania), Spencer Solit (Seismic Systems)
Accepted paper presented at ZKProof 8 in Rome, May 9–10, 2026.
Speaker

Bharath Namboothiry
University of Pennsylvania
About this talk
Read the summary
This summary was generated with AI from the talk recording and edited by the ZKProof team. It was not written or reviewed by the speaker or the paper's authors, and may contain errors. For the authoritative account of this work, please refer to the paper.
At ZKProof 8 in Rome, Bharath Namboothiry presented TruthTable, a system that proves SQL query results are correct. Instead of compiling a whole query into one giant circuit, it breaks queries into operators the way databases do, and proves each one.
Should you trust a query result?
Many applications send a query to a server and simply trust the answer. Light clients rely on third-party indexers for historical blockchain data, where wrong answers can have financial consequences. In agentic AI, a hallucinated or altered query result can propagate through a whole system of agents.
This is captured by the verifiable database model: a trusted data owner commits to a database and hands it to an untrusted server. A computationally weak client then sends queries to the server and gets back each result with a short proof that it was correctly computed over the committed database. Verifiable databases have a long academic history and are deployed by companies such as Space and Time and Provably.
Why not just compile SQL into a SNARK?
Most systems turn an entire SQL query into one big arithmetic circuit. That works, but:
- queries become complex circuits that must be built before proving;
- every new query, database, or instance size needs a new circuit;
- performance is limited by whichever off-the-shelf proof system is used.
Following how databases execute queries
Databases parse a query into a logical plan: a tree whose leaves are tables and whose nodes are operators such as filters and joins. A query planner then optimizes it into a physical plan that an execution engine runs.
TruthTable reuses this pipeline. Intermediate tables on the plan's edges become witnesses, and a query result is correct if and only if there is an assignment to the plan's edges that satisfies every node. TruthTable keeps the parser and logical plan, replaces the query planner with a proof planner that picks a proof protocol for each node, and replaces the execution engine with a proof engine. This gives:
- expressiveness, since any query that produces a logical plan can be proved;
- efficiency, by designing dedicated protocols for a small set of operators;
- free optimizations, since decades of database research on logical plans can be reused.
Proving operators
Each operator gets a relation capturing its correctness. For a filter: every output row is an input row, every output row satisfies the condition, and every input row missing from the output fails it.
Joins are more interesting. Formally, a join is a full cross product of the two tables filtered to matching pairs, far too large to prove at scale. TruthTable instead adds two witness columns recording, for each output row, the row it came from in each input table. The join is then correct if:
- each output row's left and right halves really come from matching rows in the inputs, which is a lookup and also validates the witness columns;
- no pair of source rows appears twice;
- the number of output rows equals the number of matching pairs, so nothing is omitted.
Tables are encoded as polynomials: each value is mapped to a field element, and each column becomes a multilinear polynomial. Each operator then gets a polynomial IOP, compiled into a SNARK with a polynomial commitment scheme. The join protocol combines a standard lookup (such as LogUp) with new protocols for checking that there are no duplicates and that the counts match. All of TruthTable's protocols ultimately reduce to sumcheck.
Implementation
TruthTable is an end-to-end system of about 54,000 lines of Rust. It uses the parser and logical plans of Apache DataFusion, applies standard and new proof-specific optimizations to the plan, and plugs in a protocol for each node. The proof engine is packaged as an open-source Rust library for building sumcheck-based proof systems. It includes several optimizations:
- degree reduction, rewriting polynomials so sumcheck costs, which grow faster than linearly with degree, stay low;
- batching of zero checks, sumchecks and lookup-style claims, to reduce the number of sumchecks proved at the end;
- sparsity awareness, skipping unnecessary field operations, since real data rarely fills the whole hypercube.
Results
- Against PoneglyphDB, the latest academic system, which hand-optimizes a circuit per query: TruthTable supports 17 TPC-H benchmark queries against PoneglyphDB's 6, the broadest coverage the authors know of. It proves about 5× faster, with similar proof sizes and verifier times. PoneglyphDB also doesn't bind proofs to a database commitment, which skips work linear in the database size, so this is a lower bound on the gap.
- Against industrial systems: compared with QEDB (Provably), TruthTable is 80× faster to prove and 175× faster to verify, with small differences in proof size. Compared with Proof of SQL (Space and Time), it proves 50× faster, with some variation in proof size and verifier time.
According to the paper, on TPC-H with a million-row database, average proving time is 55 seconds, verification 32 ms, and proof size 24 kB.
From the Q&A
- What does the weak client have to do? It parses the query into a logical plan, which is cheap and deterministic. The prover's plan optimizations come from a known, sound set and are sent along with the proof, so the verifier can reproduce exactly the plan being proven.
- Are database indexes supported? The polynomial representation shown in the talk is simplified: TruthTable already uses tricks from database engineering such as bit masks, and the paper has details.
- Which field is used? Any field supported by the polynomial commitment scheme that is large enough for soundness and to encode data types. The authors use a 256-bit field, which also leaves room for 128-bit types. Strings are currently hashed into field elements, which supports lookups and uniqueness checks but not operations inside strings, a future direction. As an audience member noted, a large field also reduces the chance of hash collisions.
Go further
More ZKProof 8 talks on this topic
Applications of zero-knowledge proofs
Analysis and Vulnerabilities in zkLogin
Sofia Celi (Brave & University of Bristol), Kyle Den Hartog (Brave), Hamed Haddadi (Imperial College London & Brave Software)
- Video
- Paper
Using existing credentials and MPC-in-the-Head for browser-based private authentication to blockchain
Andres Ojamaa (Cybernetica AS), Martin Pettai (Cybernetica AS), Martin Suomalainen (Cybernetica AS), Peeter Laud (Cybernetica AS)
- Video
Laminate: Succinct SIMD-Friendly Verifiable FHE
Ben Fisch (Yale University), Zeyu Liu (Yale University), Kabir Peshawaria (Boston University), Eran Tromer (Boston University)
- Video
- Paper
Batch, Pack, and Prove: More Efficient Verifiable Computation for CKKS
Ignacio Cascudo (IMDEA Software), Anamaria Costache (École Polytechnique), Daniele Cozzo (IMDEA Software Institute), Dario Fiore (IMDEA Software Institute), Antonio Guimarães (IMDEA Software Institute), Eduardo Soria Vazquez (Technology Innovation Institute)
- Video
- Paper
