{
  "id": "2024/562",
  "url": "https://opencryptology.org/2024/562",
  "original_url": "https://eprint.iacr.org/2024/562",
  "title": "Practical Proofs of Parsing for Context-free Grammars",
  "authors": [
    "Harjasleen Malvai",
    "Siam Hussain",
    "Gregory Neven",
    "Andrew Miller"
  ],
  "affiliations": null,
  "abstract": "We present a scheme to prove, in zero-knowledge (ZK), the correct parsing of a string in context-free grammar (CFG). This is a crucial step towards applications such as proving statements about web API responses in ZK.\n\nTo the best of our knowledge, this is the first ZK scheme to prove the correctness of CFG parsing with complexity linear in the length of the string. Further, our algorithm flexibly accommodates different ZK proof systems. We demonstrate this flexibility with multiple implementations using both non-interactive and interactive proof paradigms.\n\nGiven general-purpose ZK programming frameworks, our implementations are not only compact (e.g., around 200 lines of code for the non-interactive version) but also deliver competitive performance. In the non-interactive setting, proving the correct parsing of a $\\approx 1$KB string takes 24 seconds, even for grammars with $2^{10}$ production rules. In the interactive setting the same proof takes just 1.6 seconds.",
  "category": "Applications",
  "license": {
    "code": "CC BY",
    "url": "https://creativecommons.org/licenses/by/4.0/",
    "label": "CC BY 4.0",
    "attribution": "“Practical Proofs of Parsing for Context-free Grammars” by Harjasleen Malvai, Siam Hussain, Gregory Neven, Andrew Miller, Cryptology ePrint Archive, Paper 2024/562, https://eprint.iacr.org/2024/562. Licensed under CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/).",
    "retroactive": false,
    "redistribute_verbatim_only": false,
    "non_commercial": false
  },
  "dates": {
    "submitted": "2024-04-11T17:16:31Z",
    "updated": "2024-09-27T21:00:14Z",
    "withdrawn": null
  },
  "withdrawn": false,
  "withdrawn_on": null,
  "pdf": {
    "url": "https://opencryptology.org/2024/562.pdf",
    "sha256": "64542f53ca83394433ebeeaabf1d5539b23514b802dba0ce8f761596cdf739fa",
    "size": 376505,
    "source": "github-mirror",
    "source_date": "2026-04-28T17:20:00Z",
    "maybe_stale": false,
    "newer_on_eprint": null,
    "withdrawn": false
  },
  "versions": [
    {
      "url": "https://opencryptology.org/2024/562/versions/20260428T172000Z.pdf",
      "captured_at": "2026-04-28T17:20:00Z",
      "label": "copy captured 2026-04-28",
      "source": "github-mirror",
      "source_url": "https://raw.githubusercontent.com/arturo-kong/IACR-eprint-mirror/master/2024/562.pdf",
      "size": 376505,
      "sha256": "64542f53ca83394433ebeeaabf1d5539b23514b802dba0ce8f761596cdf739fa",
      "is_default_pdf": true
    },
    {
      "url": "https://opencryptology.org/2024/562/versions/20240512T024516Z.pdf",
      "captured_at": "2024-05-12T02:45:16Z",
      "label": "copy captured 2024-05-12",
      "source": "wayback",
      "source_url": "https://web.archive.org/web/20240512024516id_/https://eprint.iacr.org/2024/562.pdf",
      "size": 530620,
      "sha256": "19ac0ccfce24d2efe10d066b72bc8cfd8ccebc9e923e09b1db0c91d482f338a7",
      "is_default_pdf": false
    }
  ],
  "other_sources": [
    {
      "kind": "github-mirror",
      "url": "https://raw.githubusercontent.com/arturo-kong/IACR-eprint-mirror/master/2024/562.pdf",
      "captured_at": "2026-04-28T17:20:00Z",
      "size": 376505
    },
    {
      "kind": "wayback",
      "url": "https://web.archive.org/web/20241009022045id_/https://eprint.iacr.org/2024/562.pdf",
      "captured_at": "2024-10-09T02:20:45Z",
      "size": 366824
    }
  ],
  "bibtex": "@misc{cryptoeprint:2024/562,\n      author = {Harjasleen Malvai and Siam Hussain and Gregory Neven and Andrew Miller},\n      title = {Practical Proofs of Parsing for Context-free Grammars},\n      howpublished = {Cryptology {ePrint} Archive, Paper 2024/562},\n      year = {2024},\n      url = {https://eprint.iacr.org/2024/562}\n}"
}
