{
  "id": "2025/2141",
  "url": "https://opencryptology.org/2025/2141",
  "original_url": "https://eprint.iacr.org/2025/2141",
  "title": "Memory Optimizations of Wagner's Algorithm with Applications to Equihash",
  "authors": [
    "Lili Tang",
    "Rui Ding",
    "Yao Sun",
    "Xiaorui Gong"
  ],
  "affiliations": null,
  "abstract": "The Generalized Birthday Problem ($\\textsf{GBP}$) serves as a cornerstone for a broad spectrum of cryptanalytic research. The classical solution, Wagner's $k$-tree algorithm (CRYPTO’02), is characterized by inherently high memory complexity. Subsequently, Biryukov and Khovratovich (NDSS'16) introduced $\\textsf{Equihash}$, a memory-hard proof-of-work scheme constructed upon a single-list variant of Wagner's algorithm. Due to its robust resistance to ASIC mining, $\\textsf{Equihash}$ has emerged as one of the most widely adopted proof-of-work schemes in blockchain. Memory optimization for Wagner-type algorithms remains a persistent challenge in cryptographic research. Conventional approaches primarily focus on reducing list size to lower memory consumption, yet this strategy typically incurs a prohibitive time penalty. For instance, halving the memory usage of the mining algorithm for $\\textsf{Equihash}(200, 9)$ increases its theoretical time complexity by a factor of $2^{24.6}$.\n\nIn this work, we explore a new optimization direction: List Item Reduction (LIR), which facilitates practical and fine-grained memory-time trade-offs. We systematize existing LIR techniques and propose novel optimization methods integrated into a new hybrid framework. While our approach does not improve asymptotic memory complexity, it achieves a near-linear trade-off in practice, offering substantial benefits for the concrete design of efficient Wagner-style algorithms. Specifically, our techniques reduce peak memory usage by more than 50% (from $> 2nN$ to $nN$ bits) across all $\\textsf{Equihash}$ parameters, with only an approximate twofold time penalty. For $\\textsf{Equihash}(144,5)$, our optimized algorithm requires only 700 MB of memory, compared to approximately 2.5 GB in previous implementations.",
  "category": "Implementation",
  "license": {
    "code": "CC BY",
    "url": "https://creativecommons.org/licenses/by/4.0/",
    "label": "CC BY 4.0",
    "attribution": "“Memory Optimizations of Wagner's Algorithm with Applications to Equihash” by Lili Tang, Rui Ding, Yao Sun, Xiaorui Gong, Cryptology ePrint Archive, Paper 2025/2141, https://eprint.iacr.org/2025/2141. Licensed under CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/).",
    "retroactive": false,
    "redistribute_verbatim_only": false,
    "non_commercial": false
  },
  "dates": {
    "submitted": "2025-11-23T08:50:56Z",
    "updated": "2026-05-30T15:17:08Z",
    "withdrawn": null
  },
  "withdrawn": false,
  "withdrawn_on": null,
  "pdf": {
    "url": "https://opencryptology.org/2025/2141.pdf",
    "sha256": "4ed3bf15ae0d8e849350be604c8de23e7ce82b41fc4f105b1e4fe5fd664da182",
    "size": 751186,
    "source": "upload",
    "source_date": "2026-11-14T03:46:55.030Z",
    "maybe_stale": false,
    "newer_on_eprint": null,
    "eprint_size": null,
    "withdrawn": false
  },
  "versions": [
    {
      "url": "https://opencryptology.org/2025/2141/versions/20261114T034655Z.pdf",
      "captured_at": "2026-11-14T03:46:55.030Z",
      "label": "copy captured 2026-11-14",
      "source": "upload",
      "source_url": null,
      "size": 751186,
      "sha256": "4ed3bf15ae0d8e849350be604c8de23e7ce82b41fc4f105b1e4fe5fd664da182",
      "is_default_pdf": true
    },
    {
      "url": "https://opencryptology.org/2025/2141/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/2025/2141.pdf",
      "size": 750182,
      "sha256": "5d86e9ffd05eb74cdcaa547b596a37ee0d810a8363c936ada8ad46b3fd800fba",
      "is_default_pdf": false
    },
    {
      "url": "https://opencryptology.org/2025/2141/versions/20251203T092722Z.pdf",
      "captured_at": "2025-12-03T09:27:22Z",
      "label": "copy captured 2025-12-03",
      "source": "wayback",
      "source_url": "https://web.archive.org/web/20251203092722id_/https://eprint.iacr.org/2025/2141.pdf",
      "size": 636955,
      "sha256": "915b88445ccb3e6388b0a9c2ecbc52a3275a75803b874da5e470d86f1684ca6f",
      "is_default_pdf": false
    }
  ],
  "other_sources": [
    {
      "kind": "github-mirror",
      "url": "https://raw.githubusercontent.com/arturo-kong/IACR-eprint-mirror/master/2025/2141.pdf",
      "captured_at": "2026-04-28T17:20:00Z",
      "size": 750182
    },
    {
      "kind": "wayback",
      "url": "https://web.archive.org/web/20260302163005id_/https://eprint.iacr.org/2025/2141.pdf",
      "captured_at": "2026-03-02T16:30:05Z",
      "size": 732903
    }
  ],
  "bibtex": "@misc{cryptoeprint:2025/2141,\n      author = {Lili Tang and Rui Ding and Yao Sun and Xiaorui Gong},\n      title = {Memory Optimizations of Wagner's Algorithm with Applications to Equihash},\n      howpublished = {Cryptology {ePrint} Archive, Paper 2025/2141},\n      year = {2025},\n      url = {https://eprint.iacr.org/2025/2141}\n}"
}
