Paper 2025/1500 Original: eprint.iacr.org/2025/1500 ↗

Data Matching in Unequal Worlds and Applications to Smart Contracts

Dmitry Khovratovich
Mikhail Vladimirov
Benedikt Wagner
Abstract

SNARKs enable compact proofs that an NP statement is true and that the prover knows a valid witness. They have become a key building block in modern smart contract applications, including rollups and privacy-focused cryptocurrencies. In the widely used Groth16 framework, however, long statements incur high costs. A common workaround is to pass the statement’s hash to the SNARK and move the statement into the witness. The smart contract then hashes the statement first, and the circuit that is proven additionally checks consistency of the hash and the statement. Unfortunately, virtually any hash function is expensive to call either in a smart contract (in terms of gas) or in the proven circuit (in terms of prover time). We demonstrate a novel solution to this dilemma, which we call hybrid compression. Our method allows us to use two different hash functions—one optimized for the proof circuit, and another optimized for on-chain verification—thereby combining the efficiency advantages of both. We define a clean and simple security property of the two hash functions to which our security reduces in the standard model, namely, joint UHF hardness. We then show the plausibility of this assumption in the random oracle model. Our benchmarks show that it achieves near-optimal performance in both gas usage and prover time. As an example, compressing an 8 KB statement with our approach results in a 10-second prover time and a smart contract spending 270K gas, whereas the existing approaches either need a much longer proof generation (290 seconds for SHA-256 hashing) or a much more expensive contract (5M gas for Poseidon hashing). Along the way, we develop a two-party protocol of independent interest in communication complexity: an efficient deterministic method for checking input equality when the two parties do not share the same hash function.

Metadata
Available format(s)
PDF
Category
Cryptographic protocols
Publication info
Preprint.
History
2026-01-12: last updated
2025-08-20: published
Short URL
https://ia.cr/2025/1500
License
https://creativecommons.org/licenses/by/4.0/

BibTeX

@misc{cryptoeprint:2025/1500,
      author = {Dmitry Khovratovich and Mikhail Vladimirov and Benedikt Wagner},
      title = {Data Matching in Unequal Worlds  and Applications to Smart Contracts},
      howpublished = {Cryptology {ePrint} Archive, Paper 2025/1500},
      year = {2025},
      url = {https://eprint.iacr.org/2025/1500}
}
Note: In order to protect the privacy of readers, this archive does not use cookies or embedded third party content.