Gungnir codec enabling high error-tolerance and low-redundancy DNA storage through substantial computing power

Domain: biology
Published: 2026-04-04
Editorial outcome: minor_revision

Abstract
DNA has emerged as a compelling archival storage medium, offering unprecedented information density and millennia-scale durability. Despite its promise, DNA-based data storage faces critical challenges due to error-prone processes during DNA synthesis, storage, and sequencing. In this study, we introduce Gungnir, a codec system using the proof-of-work idea to address substitution, insertion, and deletion errors in a sequence. With a hash signature for each data fragment, Gungnir corrects the errors by testing the educated guesses until the hash signature is matched. For practicality, especially when sequenced with nanopore long-read, Gungnir also considers biochemical constraints including GC-content, homopolymers, and error-prone motifs during encoding. In silico benchmarking demonstrates its outperforming error resilience capacity against the state-of-art methods and achieving complete binary data recovery from a single sequence copy containing 20% erroneous bases. Gungnir requires neither keeping many redundant sequence copies to address molecular decay in archival storage, nor high-coverage sequencing to address sequencing error, reducing the overall cost of using DNA for storage.

Introduction
DNA is an attractive storage medium with great potential to meet the growing demand for archiving. In DNA archiving, binary information is encoded into sequences composed of A/C/G/T nucleotides according to a defined protocol. These sequences are then synthesized into fragments and stored in vitro. In contrast to conventional information storage media, DNA-based storage exhibits an ultra-high storage density (~6 orders of magnitude greater than traditional media 1) and remarkable durability (maintaining molecular stability for millennia 2 under proper storage conditions). Additionally, DNA can be passively preserved without additional energy consumption. These unique properties make DNA a compelling solution for next-generation archival storage systems.

Despite its advantages, DNA archiving poses great challenges due to the errors introduced throughout its lifecycle, including synthesis, archival storage, and sequencing. During DNA synthesis, multiple DNA sequences (oligos) of 100–300 nucleotides 3 are produced for each encoded sequence, and might introduce 0.5–2% synthetic errors 4. However, these errors might be amplified during polymerase chain reaction (PCR) 4 and accumulate over time due to molecular decay in archival storage 5. Sequencing technologies, such as short-read 6 and long-read 7 sequencing, which are employed to recover the encoded data, can also introduce additional errors. Consequently, a more robust codec system is necessary 8 to correct the common 3–5% erroneous bases.

In particular, three types of errors might corrupt the encoded information, including substitutions (replacing bases), insertions (adding bases), and deletions (removing bases). Among these, dense insertions and deletions (Indels) pose the most severe challenge, as existing systems cannot effectively address them. Analysis of existing experimental datasets 9 indicates an overall error rate of approximately 5%. However, a substantial 7.1% of reads contain more than 10% erroneous bases, while 12.0% of reads contain more than 7% Indels. To fix these errors, existing codec systems used decoding strategies that convert Indels to substitutions 10, 11 or sequence losses 12, 13, 14, 15, 16, and used computer erasure codes, such as DNA fountain 17 and Reed-Solomon (RS) codes, to correct remaining errors or erasures. Notably, these existing systems often fail to function effectively at Indels-rich reads. Experimental results show that existing codec systems fail when the overall error rate exceeds 5.25% 8—a threshold frequently exceeded in the long lifecycle 18 of DNA storage. To compensate, they require excessive physical redundancy (5–10× DNA copies, 50–100× high-coverage sequencing 19) or logical redundancy (an information density of less than 1 bit per base) to address these errors.

Therefore, to enable efficient, durable and reliable DNA-based long-term storage, codec systems with high error tolerance that can accurately correct substitutions and Indels are essential. To address these challenges, we developed a novel approach drawn from the blockchain proof-of-work concept 20. In blockchain systems, miners repeatedly guess combinations of transactions and nonces to find one that produces a valid hash signature, thereby earning rewards such as Bitcoin 21. Similarly, in a DNA-based codec system, a decoder can iteratively generate candidate sequences that follow predefined character generation rules until the resulting hash signature matches the target. This cryptographic framework ensures correct sequence recovery given substantial computing power, while the inherent difficulty of cryptographic hashing prevents false positives.

In this work, we proposed Gungnir, a DNA-based storage codec system named after the weapon of the Norse god Odin, known for its unwavering accuracy. Gungnir substantially raises the upper limit of the maximum tolerable error rate of a codec system—even information stored in sequences with 20% erroneous bases (equivalent to 406 years of archival storage at 13 degrees Celsius 22) can be fully recovered. To the best of our knowledge, Gungnir is the first codec system that can effectively handle >10% indels using only a single sequence copy. Gungnir supports adjustable configurations to maintain a balance between information density and error tolerance. Compared to existing methods, Gungnir achieves the same performance while requiring only half the DNA bases. Additionally, Gungnir can employ base preference tables for generated sequences; for instance, it can produce sequences with a 28.4% reduction in expected Nanopore sequencing errors, albeit at the cost of some acceptable error tolerance capacity. The outstanding results suggest that Gungnir has great applicability in diverse DNA-based storage scenarios, including both long-term archiving and high-frequency retrieval scenarios. With affordable computational resources, Gungnir facilitates robust information recovery while maintaining low redundancy, making it a reliable solution for DNA-based data storage codec systems.

Results
Overview of Gungnir Codec System

Figure 1a illustrates the workflow of DNA-based digital information storage, which comprises two key stages: encoding and decoding. Encoding converts binary data fragments into DNA sequences, whereas decoding reconstructs the original information from error-prone DNA sequences. When encoding a file, such as an image, video, or audio, the encoder is designed to transcode the binary stream into DNA sequences using a minimal number of bases. The decoder, on the other hand, is designed to correctly reconstruct data from a sequence with a number of erroneous bases. However, as the error rate increases, the codec system may fail to maintain a balance between information density and error tolerance. This is because the vast array of potential correct sequences becomes more challenging to distinguish, necessitating excessive redundancy for error correction. This redundancy ultimately leads to suboptimal information density 23.

This observation forms the core principle of Gungnir: if a decoder can produce a decoded binary fragment from a sequence, it should be mathematically proven to be reliable and accurate. Guided by this principle, Gungnir introduces a hash signature for each data fragment, serving as a proof of identity, as detailed in the Methods section Gungnir Transcoding. As shown in Figure 1a, the Gungnir encoder transcodes the hash signature of each data fragment into nucleotides, along with the data bits (payload). During decoding, the Gungnir decoder exhausts all possible payloads and hash signatures that correspond to a sequence with errors (see Figure 2a) within a specified W (i.e., maximum hypotheses allowed). Only hypotheses that successfully pass max the hash signature validation are outputted. If no valid results are generated, the Gungnir decoder increases the W and repeats the decoding algorithm until obtaining correct max hypothesis. In this manner, when sufficient bits for the hash signature and adequate computing power for the proof-of-work architecture are available, the Gungnir decoder can reliably identify the correct binary stream as output.

Performance of the Gungnir Codec System

The robustness of a DNA-based codec system is primarily determined by its ability to correct errors. To evaluate the data recovery performance of the Gungnir codec system, we compared it to five state-of-the-art codec systems: Church 12, Grass 14, Yin-yang 15, DNA-Aeon 16, and HEDGES 10. All systems were configured with consistent constraints: a maximum homopolymer length of 3 and a GC content between 40–60%.

To assess each codec’s native error tolerance capacity with single-read coverage, we conducted tests using single-molecule reads without consensus correction and established two error profiles for evaluation. In error profile 1, we maintained equal proportions of substitutions, insertions, and deletions errors and increased the errors to each sequence until the overall error rate reached 20%. This in silico benchmark aimed to evaluate the error tolerance capabilities of the different codec systems. In error profile 2, we fixed a specific Indel rate (0.54% deletions and 0.23% insertions, based on the in vitro test data from HEDGES) and incrementally added substitutions to each sequence until the error rate reached 20%. This error profile mimicked real-world conditions where archival storage primarily generates substitutions 4.

Figure 3a illustrates data recovery performance when with the same proportions of substitutions, insertions, and deletions errors (error profile 1), with parameters and settings detailed in Supplementary Text 1. The Church, Grass, and Yin-yang codec systems were optimized for substitutions, and they failed to achieve 100% data recovery when insertions or deletions were introduced. Notably, when the total error rate reached 1%, their data recovery rates fell between 35.3% and 48.0%. This trend persisted as the error rate increased to 3%. DNA-Aeon, in collaboration with its outer DNA fountain 17 code, maintained perfect data recovery until 3.9% error rate and failed completely by 4.2% error rate. Similarly, HEDGES, in collaboration with its outer Reed-Solomon code, achieved 100% data recovery until an error rate of 5.25%, after which its performance deteriorated significantly around 6% to 7.5% error rate. In contrast, Gungnir maintained 100% data recovery even at 20% error rates, demonstrating superior robustness against Indels and representing a 3–5× improvement over existing systems.

Figure 3b illustrates the data recovery performance of different codec systems when fixing insertion and deletion rates at 0.23% and 0.54% respectively (error profile 2). When no substitutions were introduced, Church, Grass, and Yin-yang recovered 41.9% to 44.3% of the data. However, their data recovery rates decreased significantly when the number of substitutions increased, falling to less than 11% when with 2.23% substitutions (3% total errors). Like observations from error profile 1, DNA-Aeon maintained perfect data recovery until 3.43% (4.2% total errors) substitution rate and then dropped sharply to zero. HEDGES maintained 100% data recovery up to a substitution rate of 4.48% (5.25% total errors). In contrast, Gungnir achieved 100% recovery even with up to 19.23% substitutions (20% total errors). This exceptional performance demonstrates Gungnir’s capacity to recover information from degraded DNA samples in archival storage applications.

Beyond error tolerance capacity, it is also crucial to optimize information density for DNA-based codecs. The primary measure of information density is the number of bits that each base can encode (bits/base). Noteworthy, the metric should account for all redundancy, including both inner code overhead and supplementary sequences from outer error correction code.

In Figure 3c and 3d, we analyzed the correlation between the maximum tolerable error rate and information density for all benchmarked codec systems. Considering the redundancy introduced by indexing and error correction, the actual information densities of the benchmarked codec systems 10, 12, 14, 15, 16 range from 0.64 to 1.50 bits/base. For the state-of-the-art codec system HEDGES, the actual information density is ~0.64 bits/base, with a maximum tolerable error rate of 5.25% in both error profiles. In contrast, Gungnir tolerated 5% and 4.5% errors in an information density of 1.35 bits/base in error profile 1 and 2, respectively, achieving ~2 times the information density of HEDGES while maintaining similar levels of error tolerance. At 0.6 bits/base, Gungnir tolerated 18% and 17% errors in error profile 1 and 2, surpassing HEDGES’ tolerance by more than three times.

In the previous simulations, we deliberately excluded computational constraints to facilitate exhaustive hypothesis testing. This approach enabled the decoder to iteratively increase the W (maximum hypotheses allowed) during exhaustive searching, as detailed in the Methods max section Decoding Algorithm of Gungnir. However, for practical deployment, it is essential to comprehend how Gungnir manages memory usage and processing time during iterative decoding. To this end, we selected the two codec systems with the best error tolerance, DNA-Aeon and HEDGES, as baselines, and encoded a 19.4 KB text file containing the fairy tale The Ugly Duckling into DNA sequences. Following error profile 1, we maintained equal proportions of substitution, insertion, and deletion errors. For a fair comparison, we evaluated error rates from 3% to 8%, spanning the error tolerance limits of both DNA-Aeon and HEDGES. All tests in these experiments were performed on a dual 32-core Xeon Platinum 8369C server with 512 GB of RAM.

Figure 4a summarized the time and memory consumption of Gungnir, DNA-Aeon, and HEDGES. For Gungnir, the sequence length was fixed at 100 bases, and three different configurations were evaluated. In these configurations, Gungnir decodes faster than DNA-Aeon. While it is slower than HEDGES, the runtime remains within the same order of magnitude. In terms of memory usage, Gungnir is comparable to DNA-Aeon but exceeds HEDGES by more than an order of magnitude, primarily because Gungnir processes up to 88 sequences in parallel. Nevertheless, within the error tolerance range of HEDGES (<6% error rate), the peak memory required to decode a single Gungnir sequence is slightly lower than that of HEDGES. Because the sequence length of HEDGES is longer than that of Gungnir and DNA-Aeon, we conducted a more balanced comparison of Gungnir and HEDGES under matched parameters (sequence length = 300 bases, density = 0.64 bit/base). Under this configuration, Gungnir is still robust that we did not apply a fixed edit distance cutoff (see Section Performance Analysis of Gungnir with Limited Computing Resources). As shown in Figure 4b, Gungnir’s memory usage under these settings is comparable to that the results reported in Figure 4a. However, its decoding speed is substantially lower—about an order of magnitude slower than HEDGES. The increase in runtime reflects a performance saturation effect: at an error rate of 3–8%, the noise is still well below Gungnir’s performance limit, so the decoder incurs a roughly constant minimum decoding time, independent of the actual error rate, leading to an apparent gap relative to HEDGES in this regime.

For higher error rates (>10%), we focus on quantifying the time and memory required for Gungnir to decode the same file under these edge-case conditions. In this setting, “The Ugly Duckling” was encoded into 3,108 DNA sequences of 100 bases each, yielding an information density of 0.5 bit/base. Following error profile 1, the total error rate was increased from 10% to 20%, and we tracked the resulting changes in computational resource usage. For each simulation, we began with a smaller W value of 100k, which required ~100MB memory. If a valid guess was not found, larger W settings (1M, 5M, 20M, and 200M) were employed in max subsequent rounds (up to five rounds). The maximum W required ~200GB memory, but it max was only activated when the error rate reached at least 18% (as illustrated in Figure 4c and 4d), which is not a frequent occurrence during DNA synthesis and sequencing. The maximum memory consumption was ~20GB when the error rate was ≤16% and only 1GB when the error rate was 10%, both of which are well within the capacities of modern personal computers.

In terms of the runtime, it takes ~2 hours on a standard server when the error rate reaches 10%. As the error rate further increased, it is more challenging to decode the sequence, requiring additional computational resource. For instance, with 14% error rate, the time consumption increased to ~11h, with the fourth round (W =20M, ~20GB) activated. When the error rate max eventually reached 20%, the total time consumption exceeded 37 hours, with over 73% of this time concentrated in the last three rounds. Following the rapid development in the computing power, we anticipate that the time required for this process will be further reduced in the near future due to advancements in hardware industry and algorithms.

Performance Analysis of Gungnir with Limited Computing Resources

To satisfy the needs and constraints for diverse application scenarios and computing platforms, Gungnir offered various configurable options to balance information density, error tolerance, and computing resources.

DNA-based storage encodes data bits into nucleotide bases A/C/G/T. Existing codec systems, primarily binary-based, can be categorized into two types: 1) one base represents two bits (quaternary), relying on computer error correction codes; 2) one base represents one bit (binary), offering better error tolerance but fundamentally limited to 1 bit per base in information density. Gungnir, to enhance robustness, abandons quaternary encoding. Instead, we introduce Gungnir-Trit, a variant that converts input from binary to trinary before transcoding, enabling higher information density. By controlling the length of hash signatures (in both binary and ternary settings), Gungnir offers adjustable configurations for information densities, ranging from 0.5 to 1.45 bits/base. For high error rate scenarios (>10%), users can choose the binary setting (densities between 0.5 and 0.8 bits/base) to ensure accurate reconstruction. Lower error rate applications (<10%) may utilize the ternary setting to minimize the amount of DNA sequences needed for storage. These different options allow users to balance storage efficiency and error tolerance based on their needs.

For fair comparison, following experiments were conducted with a fixed sequence length of 100 and the W (maximum hypotheses allowed) was set to 20M (~20 GB memory). The file “The max Ugly Duckling” was encoded into DNA sequences with 40%–60% GC content and a maximum homopolymer length of 3. We increased the error rates for two error profiles until data recovery fell below 90% or total error exceeded 20%.

Figure 4e and 4f demonstrate the data recovery performance of Gungnir at various bits/base levels, and Figure 4g and 4h illustrate the corresponding precision and recall. Sequences that are decoded but with incorrect output reduce precision, while sequences that are unable to be decoded with the given resources reduce recall. When the information density ranged from 0.5 to 0.8 bits/base, Gungnir consistently achieved 100% correct decoding in error profile 1 for error rates below 14%, and in error profile 2 with error rates below 12%. However, as the error rates increased further, data recovery gradually declined due to two main factors: decoding failures and decoding mistakes. Decoding failures result in no output, occurring when insufficient computational power is available, which subsequently leads to a decrease in recall. These failures are generally reversible, as additional computational resources can restore them. In contrast, decoding mistakes lead to incorrect outputs, primarily due to hash collisions caused by insufficient bit length in the hash signature, which reduces precision. These mistakes are typically irreversible, leading to incorrect information being decoded.

Figure 4i and 4j demonstrates the precision and recall of Gungnir-Trit, and the corresponding data recovery performance is presented in Supplementary Figure 1. In comparison with Gungnir, Gungnir-Trit's trit-per-base encoding increases hypothesis space, making the decoder more sensitive to base errors. Despite that, when the error rate reached 5% in error profile 1 and the information density was set to 1.35 bits/base, Gungnir-Trit maintained its precision and recall at 100%. The results demonstrate Gungnir-Trit’s capacity to correct the typical 3–5% erroneous bases while preserving a better information density (1.35 bits/base vs 0.8 bits/base) than Gungnir.

In addition to different information density configurations, Gungnir also offers flexibility with arbitrary sequence lengths. Since common oligonucleotide lengths range from 100 to 300 nucleotides, we conducted simulations with sequence lengths of 100, 200, and 300, at error rates ranging from 5% to 20% in error profile 1. Gungnir’s information density is fixed at 0.9 bits per base, where each base represents one bit, with only 10% of the bits allocated for the hash signature. Additionally, the W was set to 100k (~100MB memory), which is more resource- max constrained compared to the experiments conducted in the previous sections to highlight the impact of sequence length on Gungnir.

The precision and recall using different sequence lengths are presented in Figure 5a and 5b. Notably, longer sequences demonstrate higher precision at the same error rate, indicating greater error tolerance capacity of Gungnir. For instance, as shown in Figure 5a, a sequence length of 300 nucleotides maintained 100% precision at a 20% error rate with a configuration of 0.9 bits/base, while a sequence length of 100 nucleotides achieved the same precision only when the error rate ≤5%. Nevertheless, longer sequences result in lower recall, reflecting the increased computational power required for decoding. Specifically, under the same error rate, longer sequences generated more potential correct hypotheses during decoding and required more time for validation. As demonstrated in Figure 5b, at a 20% error rate, the recall for a sequence length of 100 nucleotides was 99.0%, while for a sequence length of 300 nucleotides, it dropped to only 3.0% due to the W constraint. max

During decoding, if the decoder outputs a valid result with abnormally high edit distance (e.g., edit distance >30 in a sequence of length 100), it is more likely to be a hash collision rather than a correct output. To reduce decoding mistake caused by hash collision, we set an edit distance cutoff, denoted as ED , and reject hypotheses with accumulated edit distance exceeding max ED , as detailed in the Methods section Decoding Algorithm of Gungnir. For sequences that max remain undecodable after multiple attempts, the decoder increases ED and restarts the max decoding process. This design minimizes decoding mistakes resulting from hash collision in early attempts.

Figure 5c illustrates the impact of the edit distance cutoff ED on decoding mistakes and max failures at varying error rates. The simulation was conducted in error profile 1, with a configuration of 0.8 bits/base and an error rate ranging from 15% to 18%. The W was set to max 20M, which required ~20 GB memory. The results showed that applying ED substantially max reduced decoding mistakes, as many mistakes caused by hash collisions were effectively rejected in early attempts, which could then be corrected in subsequent attempts. This result demonstrates the necessity of edit distance cutoff for the reliability of the decoder.

Analysis of the Characteristics of Decoding Mistakes

Decoding errors can be categorized into two types: failures and mistakes. While a decoding failure results in no output, a decoding mistake remains undetected and produces incorrect data bits (payload). In this section, we investigated instances of undetected decoding mistakes, and analyzed their underlying causes and characteristics.

Decoding mistakes in Gungnir are primarily caused by hash collisions, where an incorrect sequence happens to satisfy the hash signature constraints. The probability of such collisions is largely determined by the effective length of the hash signature: longer signatures lower the collision risk but also reduce information density, while shorter signatures increase both density and collision risk. As shown in Figure 5d, at an information density of 0.5 bit/base, the hash collision rate remains below 0.2%. Moreover, the collisions can be resolved by choosing the candidate sequence with the smallest edit distance to the observed read. As the density increases, the effective hash signature becomes shorter, leading to a gradual rise in collision risk. This risk remains relatively stable at a given density and shows a noticeable increase at 0.8 bit/base only when the error rate exceeds 12%, where the system is close to Gungnir’s error-tolerance limit. Even in this extreme regime, the collision rate stays below 8%.

Beyond the overall collision rate, we further examined where and how these decoding mistakes occur within the sequences. Existing decoding algorithms based on the hypothesis tree 10, 11 may encounter a challenge where the last few bits are prone to mistakes. This is because when the decoder attempts to guess these bits, there is insufficient subsequent information to effectively prune erroneous branches. In contrast, the primary cause of decoding mistakes in Gungnir shifted from untimely pruning to hash collisions. For configurations with lower information density, where more bits are allocated for hash signature, the distribution of mistaken bits became more uniform across different positions (Figure 5e and 5f). Furthermore, as depicted in Figure 5g and 5h, the number of mistaken bits decreased proportionally to the reduction in information density. These observations align with our expectations: a longer hash signature (with its lower information density ) enhances the decoder’s resilience to errors.

To better understand the conditions under which these mistakes occur, we also analyzed the underlying error patterns in sequences that led to decoding mistakes. Figure 5i and 5j illustrate some cases where Gungnir and Gungnir-Trit yielded decoding mistakes. The distribution of errors in the sequences was plotted. Notably, in such sequences, errors were densely clustered, with every sequence exhibiting a local region of high error concentration. These dense error clusters caused the decoder to incorrectly prune correct branches when navigating these areas. Consequently, if another potential sequence that resulted from hash collision was available, it is possible to be mistakenly identified as a valid output.

Gungnir-ONT: Frequent Data Retrieval Using Nanopore Long Reads

In addition to long-term archiving, performance for frequent data retrieval is also crucial 2. In this scenario, data is frequently read from oligos using sequencing technologies, in which sequencing errors can greatly increase costs. To minimize errors associated with sequencing, we proposed Gungnir-ONT, a variant that utilize a base preference table to reduce errors in Nanopore sequencing platforms (detailed in the Methods section Gungnir Transcoding), and evaluated its performance.

As depicted in Figure 6b, the GC content of sequences generated using Gungnir, Gungnir-Trit, and Gungnir-ONT was effectively constrained within the acceptable range of 0.4 to 0.6. Notably, the majority of sequences generated by Gungnir-ONT exhibited a GC content between 0.4 and 0.45, to fit the optimal GC content range for Nanopore sequencing technology.

Figure 6c illustrates the estimated Nanopore sequencing error rates for the generated DNA pools based on different codecs. Compared to the Gungnir, Gungnir-ONT significantly reduced the sequencing error rate by 28.4%. In comparison with other benchmarked methods, Gungnir-ONT significantly reduced errors by 19.6% to 29.9%. Notably, the maximum expected error rate for Gungnir-ONT was 2.08%, which is close to the observed Nanopore sequencing error rate of ~2% for R10 chemistry. Furthermore, as depicted in Figure 6d, the 7-mer distribution of Gungnir-ONT closely resembled the natural human sequences, whereas the distributions produced by other benchmarked codecs exhibited a deviation. These results demonstrate Gungnir-ONT’s ability to effectively manage Nanopore sequencing errors.

Figure 6e and 6f depict the precision and recall of Gungnir-ONT, and the corresponding data recovery performance is presented in Supplementary Figure 2. For a fair comparison, we used the same setup described in the section Performance Analysis of Gungnir with Limited Computing Resources. Relative to Gungnir, Gungnir-ONT shows only a modest reduction in error-tolerance capacity—approximately 15% and 10% under error profiles 1 and 2, respectively—a trade-off we consider acceptable given its improved decoding efficiency.

To evaluate this efficiency, we used the same configuration as in Figure 4c and 4d, but reduced the error rate by 25% and measured the decoding time of Gungnir-ONT. As shown in Figure 6g and 6h, decoding time decreases across all benchmarked error rates, especially at higher error levels. For example, when the error rate reaches 20%, Gungnir requires more than 37 hours to decode, whereas Gungnir-ONT can recover data with a 15% error rate in under 8 hours, which is one quarter of the original time. These results underscore the potential of Gungnir-ONT for high-frequency data retrieval scenarios that prioritize low latency and computational efficiency.

Notably, the base preference table is empirically derived from a training dataset, so it might be influenced by the specific ONT chemistry and basecalling model used. Any changes in chemistry or model would necessitate regenerating the table. Moreover, the underlying principle of constructing and applying a base preference table is not specific to Nanopore sequencing. As described in the Methods section Generation of Base Preference Table, our workflow relies on profiling systematic, context‑specific errors from a training dataset. In principle, this strategy can be adapted to other sequencing platforms, such as Illumina 6 and PacBio 24, to model their own characteristic error profile.

Methods
Overview of Gungnir

Gungnir is a DNA-based storage codec system that relies on substantial computing power for low-redundancy DNA storage. Figure 1a shows an overview of the Gungnir codec. The Gungnir codec system supports any type of information (such as images, videos, or audio) to be segmented into short binary fragments and subsequently transcoded into DNA sequences using the Gungnir encoder. The Gungnir encoder takes a binary fragment along with its corresponding address (i.e., the exact location of this fragment in the original information) and outputs an encoded sequence for DNA synthesis. The Gungnir decoder is designed for reconstructing the binary fragments from sequences with up to 20% of errors either from DNA synthesis, archival storage, or sequencing. Once all binary fragments are recovered, the original information can be accurately assembled according to the address in the fragment.

The error patterns introduced during DNA synthesis, archival storage, and sequencing are different, platform-specific, and usually known in prior. To demonstrate that Gungnir can optimize for platform-specific error patterns, we implemented Gungnir-ONT, an extension of Gungnir that is optimized for Nanopore sequencing technologies with specific sequencing error patterns.

To demonstrate the versatility of Gungnir on a different balance between information density and tolerable error rate, we implemented Gungnir-Trit, a reconfigured Gungnir that has a higher information density (1.35 bits/base vs. 0.8 bits/base) while maintaining a moderate tolerable error rate (5% vs. 14%).

Gungnir Transcoding

As depicted in Figure 1b, the Gungnir encoder concatenates the hash signature and data bits (payload) of a fragment into a binary stream and sequentially maps the bits into nucleotides. At each position, two of the A/C/G/T nucleotides are assigned to represent 0 and 1, while the other two nucleotides are utilized for redundancy in error correction. The specific mapping rules between bits (or trits) and bases for Gungnir, Gungnir-Trit, and Gungnir-ONT will be discussed in this section.

Gungnir: the Gungnir encoder generates a new reference table between the binary domain (0,1) and the nucleotide alphabet (𝐴,𝐶,𝑇,𝐺) for each incoming bit, according to the previously encoded bases. As illustrated in Figure 1b, the encoding process begins by concatenating the 16-bit fragment address (i.e., the exact location of this fragment in original information), the 8-bit bit index (denoting the position of the target bit within the fragment), and the 40-bit history of previously encoded bits into a 64-bit transient seed. This seed serves as the input to a pseudorandom number generator for generating a 2-bit random number 𝑟. Within the finite field mod 4, the cyclic permutation (𝑟,𝑟+1,𝑟+2,𝑟+3), defines an ordered mapping between the numerical sequence (0,1,2,3) and the nucleotide (𝐴,𝐶,𝑇,𝐺). For example, when 𝑟 = 2, the resulting permutation (2,3,0,1) yields the correspondence (0 → 𝑇,1 → 𝐺,2 → 𝐴,3 → 𝐶). This permutation (i.e., the reference table in Figure 1b) determines the encoding scheme: nucleotides 𝑇 and 𝐺 encode the information bits 0 and 1, respectively, while 𝐴 and 𝐶 are reserved as redundant bits for error correction purposes.

Gungnir-ONT: in Gungnir, the reference tables between the nucleotides (𝐴,𝐶,𝑇,𝐺) and digits (0,1) are generated based on contextual information. While in Gungnir-ONT, base preferences specific to Nanopore sequencing technology are incorporated into the generated sequences. As depicted in Figure 6a, the prior information (with more details in the Methods section Generation of Base Preference Table) is derived from the error rates observed in 7-mers distribution from a GIAB HG002 sample 26. Similar to the Gungnir, a 64-bit seed is generated based on the previously encoded bases. This seed then generates a random number 𝑟 within the range [0,5], which partitions the set (𝐴,𝐶,𝑇,𝐺) into [(𝐶 ,𝐶 );(𝐶 ,𝐶 )]. The details of the partitions associated with different random number 𝑟 are presented in Supplementary Table 1. Based on the partition, the bit message 0 is mapped to the character with lower error rate among (𝐶 ,𝐶 ), while the bit message 1 is mapped to the character with lower error rate among (𝐶 ,𝐶 ). For instance, as shown in Figure 6a, when 𝑟 = 1, the partition of (𝐴,𝐶,𝑇,𝐺) results in [(𝐴,𝐺);(𝐶,𝑇)]. Since 𝐴 and 𝐶 exhibit lower error rates, the reference table is established as (0 → 𝐴,1 → 𝐶).

Gungnir-Trit: In Gungnir and Gungnir-ONT, each base represents one bit, resulting in a maximum theoretical information density of 1 bit per base. For Gungnir-Trit, each base can accommodate one ternary digit (trit) rather than a bit. For a sequence of length 100, a maximum of 157 bits of information can be encoded. The transcoding rules of Gungnir-Trit are illustrated in Supplementary Figure 3. Following the concatenation of the payload and hash signature into a binary stream by the encoder, this binary stream undergoes conversion into its ternary representation (as detailed in Supplementary Text 1). Following the transcoding rules of Gungnir, a 101-bit seed is obtained for random number generation, comprising a 16-bit address, an 8-bit bit index, and 77 bits from the previous trits. The seed then generates a 2-bit random number 𝑟, with which a reference table between the trits (0,1,2) to nucleotide bases (𝐴,𝐶,𝑇,𝐺) is selected according to the same principles as in Gungnir. In this configuration, the trits (0,1,2) represent valid bases, while only the base corresponding to 3 is rejected as redundancy for error correction.

Biomedical Constraints-aware Transcoding

In our designed transcoding system, we proposed biomedical constraints-aware transcoding to adhere to several general biomedical constraints that could potentially limit DNA synthesis and sequencing. These constraints can be broadly categorized into three groups 27: GC content, homopolymers, and undesired motifs. To comply with these constraints, certain characters may be disabled at specific times, necessitating corresponding modifications in the transcoding rules. In this section, we will provide a detailed description of these constraints along with the associated transcoding rules.

GC content: DNA-based data storage faces a critical constraint: maintaining the GC content of synthesized sequences within the optimal range of 40% to 60%. An imbalanced GC content can lead to secondary structure formation 27 or non-uniform sequence coverage 28 during synthesis and sequencing. To address this, the Gungnir encoder incorporates a real-time GC content balancing mechanism. If the GC content exceeds the specified range, the encoder dynamically adjusts nucleotide selection by excluding non-compliant bases. For instance, consider a reference table where (0 → 𝐺,1 → 𝐴,2 → 𝐶,3 → 𝑇), if the GC content among previously encoded bases exceeds 60%, the 𝐺 and 𝐶 should be disabled, resulting in a new reference table of (0 → 𝐴,1 → 𝑇).

Homopolymers: defined as continuous repeats of identical nucleotides, which pose great challenges for accurate sequencing. Nanopore sequencing methods typically exhibit reduced performance in determining the length of homopolymer 29, especially when they exceed 5 bases 30. To address this issue, the Gungnir encoder is designed to prevent homopolymers longer than 3 bases by excluding corresponding characters. For instance, if the original reference table in a position is (0 → 𝑇,1 → 𝐺,2 → 𝐴,3 → 𝐶), but the previous 3 characters are “𝐺𝐺𝐺”, the 𝐺 should be disabled to prevent a homopolymer of length 4. Consequently, the new reference table becomes (0 → 𝑇,1 → 𝐴).

Undesired motifs: biologically functional motifs are crucial sequence elements that necessitate systematic consideration. For instance, restriction enzyme recognition sites 31 are essential for initiating the amplification steps of various workflows. Consequently, due to the limitations associated with synthesis, it is crucial to exclude such motifs during the encoding process. Gungnir implements this functionality as optional, with the encoder maintaining a predefined library of undesired motifs. For instance, 6-mer “𝐺𝑇𝐺𝐶𝐴𝐶” is a restriction enzyme recognition in this library. When the previous 5-mer “𝐺𝑇𝐺𝐶𝐴” is detected, the 𝐶 should be disabled at the next position to prevent the occurrence of this motif.

A related consideration is that storage‑induced mutations may cause previously valid sequences to newly violate biomedical constraints. In our decoding framework, such sequences are automatically rejected during the constraint‑validation step and excluded from the candidate solution set, as detailed in the Decoding Algorithm of Gungnir section below. The probability of these events is inherently reflected in the reported recovery rates under simulated degradation. Consequently, no dedicated fallback mechanism is required, as constraint compliance is enforced as an integral part of the decoding search.

Generation of Base Preference Table

The base preference table is an optional module within the Gungnir codec system, which is designed to assign scores to each k-mer. K-mers with higher scores are more likely to be selected by the Gungnir encoder. This table can be informed by relevant prior knowledge, such as Nanopore sequencing error rates, enabling the generation of sequences that are preferred in specific target scenarios.

Gungnir-ONT is an implementation that utilizes a base preference table to minimize sequencing errors. The value of 𝑘 is set to 7 to align with the characteristics of Nanopore sequencing. To generate the base preference table, we reviewed all reads in a 50-fold GIAB HG002 sample 26 and filtered out reads longer than 500 bases. Using the ONT variant caller Clair3 32, we masked undesired germline variants and counted the occurrences of each 7-mer. Substitutions, deletions, and insertions at different positions within each 7-mer were recorded separately and summarized to obtain a total error rate. Subsequently, the Gungnir-ONT encoder can assign scores to different bases based on these error rates.

Decoding Algorithm of Gungnir

The Gungnir decoder employs a proof-of-work framework that combines exhaustive search with cryptographic hash signature validation to recover the data bits from a single sequence copy containing erroneous bases. Unlike the conventional one-pass decoding strategies, Gungnir decoder adopts a progressive verification mechanism inspired by blockchain architectures. The framework employs a hash signature validation scheme based on murmur3 33, a renowned hash function celebrated for its exceptional speed and randomness, to provide robust mistake detection capabilities. Within a proof-of-work-style decoding algorithm, the decoder systematically explores the solution space until it identifies a candidate that satisfies all cryptographic validation criteria. This section will delve into the technical details of the Gungnir decoder.

Generation of Initial Hypothesis

As depicted in Figure 2a, the Gungnir decoder is a variant of the A* algorithm 34 to explore potential hash matches through a dynamically constructed hypothesis tree (Figure 2b). In each hypothesis, Gungnir guesses the address and the binary stream simultaneously, and tracks the corresponding positions in the sequence copy. Additionally, the hypothesis accumulates an edit distance to prune the incorrect branches.

When decoding, the decoder generates initial hypotheses without considering prior knowledge of the exact location (address) of the data bits (payload). Each address is assigned with an initial hypothesis, assuming an empty binary stream and zero edit distance. However, for branches stemming from initial hypotheses with an incorrect address, as detailed in the section ‘Gungnir Transcoding’, the downstream seed for random number generation will invariably be incorrect (as detailed in Supplementary Text 2). This results in an erroneous reference table between (0,1) and (𝐴,𝐶,𝑇,𝐺). Consequently, hypotheses with an incorrect address will be pruned in a very early stage due to their higher accumulated edit distance (details in the Methods section Construction of the Hypothesis Tree) or fail hash validation (details in the Methods section Hash Signature Validation in a Hypothesis).

Generation of Children Hypothesis from a Parent Hypothesis

Figure 2c illustrates how a parent hypothesis generates its children hypotheses. Following the transcoding rules, a new reference table between (0,1) and (𝐴,𝐶,𝑇,𝐺) at the new position can be selected based on the guessed information within the parent hypothesis. For instance, if the reference table is selected as (0−𝐶 ,1−𝐶 ), then either C or C will be permitted in the 0 1 0 1 subsequent position. In the sequence to be decoded, the base to be looking at is designated as C . To ascertain what happened to C , five children hypotheses are generated: N N

1) Match or Substitution (two children hypotheses). In this case, the decoder guesses that the C is either C or C , corresponding to the digit 0 or 1. If the guessed base (C or C ) differs N 0 1 0 1 from C , the decoder assumes a substitution error here and accumulates the edit distance N by 1. For example, in Figure 2b, if the decoder guessed that the next bit is 0, the C will be 0 G. However, in the sequence to be decoded, C is C, resulting in an assumption of N substitution of G→C. Similarly, if the decoder guessed that the next bit is 1, then C matches N 1 C , so no edit distance is accumulated. N

2) Deletion (two children hypotheses). In this case, the decoder guesses that a deletion has occurred prior to C . Consequently, the decoder disregards C and attempts to guess the N N deleted base to be either C or C , with edit distance accumulated by 1 for both children 0 1 hypotheses.

3) Insertion (one children hypothesis). In this case, the decoder guesses that an insertion has occurred at C , indicating that C is not a base in the original sequence. Consequently, the N N decoder refrains from attempting to guess any new bit and accumulates the edit distance by 1.

Construction of the Hypothesis Tree

In an initial hypothesis, all bits remain unguessed, and the edit distance is set to zero. Following the children hypothesis generation rules, bits are guessed in the generation of subsequent hypotheses. As illustrated in Figure 2a, the initial layer comprises hypotheses corresponding to all possible addresses. Then each hypothesis within a layer generates five sub-hypotheses (as detailed in the Methods section Generation of Children Hypothesis from a Parent Hypothesis), and accumulating edit distance for any substitutions, deletions, or insertions. To maintain computational tractability, the decoder implements a constraint W (maximum hypotheses max allowed): when the number of hypotheses exceeds W , the candidates with highest edit max distance are pruned. Once a hypothesis has completed guessing, the leaf is retained in the following steps and stops children generation. The hypothesis tree construction stops only when all preserved hypotheses completed guessing. According to the transcoding rules, if a parent hypothesis is incorrect regarding the address, previous bits, or bit index, the reference table for its children hypotheses is also incorrect. This leads to a substantial increase in the edit distance of children hypotheses, ultimately resulting in hypotheses pruning. Hence, the remaining leaf hypothesis is more likely to be correct for subsequent hash signature validation.

Hash Signature Validation in a Hypothesis

Upon completing the construction of the hypothesis tree, the decoder generates a set of hypotheses, each containing the exact expected number of bits for hash signature validation. For clarity, 𝐻 represents the hash signature, 𝐴 denotes the address, and 𝑃 signifies the payload. As depicted in Figure 2a, the decoder validates each hypothesis by verifying the equation ℎ𝑎𝑠ℎ(𝐴,𝑃) = 𝐻. Hypotheses that meet this condition are retained, while those that fail verification are discarded. The cryptographic properties of the murmur3 hash function ensure that even minor errors in 𝐴 or 𝑃 result in a drastically different 𝐻, thereby safeguarding the validation process and retaining only the successful hypotheses. Following this verification, successful hypotheses are added to a candidate set, from which the hypothesis with the minimal edit distance is selected as the decoding result.

However, if the W (maximum hypotheses allowed) is too small, the correct branch may be max pruned, potentially leaving an empty candidate set. In such instances, the decoder would increase the W and try the decoding algorithm again until a valid output is obtained. max Theoretically, with a sufficiently large W , the correct branch will ultimately be included in the max candidate set.

An Advancing Cutoff for Edit Distance

The Gungnir decoder employs an advancing cutoff for edit distance (ED ) as an optional max parameter to control decoding efficiency. Initially, it is set to a small value, such as 3. During decoding, the decoder prunes the hypothesis with an accumulated edit distance exceeding ED . When decoding, W is increased for sequences with decoding failures at this ED to max max max provide more computational power. If failures persist due to sequences containing more errors than ED allows, the decoder increases ED and restarts the decoding algorithm. This max max process iterates until all sequences are decoded or reaching upper limit of ED , such as ED max max = 20 in a sequence of length 100.

Configurations for Different Information Density

In each sequence, the information density is defined as bits/base, where 𝑙𝑒𝑛(𝑃) 𝑙𝑒𝑛(𝑃)+𝑙𝑒𝑛(𝐻) represents the payload and 𝐻 denotes the hash signature. A longer 𝐻 reduces the likelihood of hash collisions, allowing the decoder to identify the correct hypothesis more accurately from the candidate set after hash signature validation. However, when the total sequence length remains constant, increasing the hash signature length results in a corresponding decrease in payload length, leading to a reduction in information density. Consequently, the configurations of Gungnir involves a trade-off between information density and error tolerance capacity. To accommodate the diverse requirements of different scenarios, we provide various configurations, spanning from 0.5 to 1.45 bits/base. In this section, we will delve into these configurations.

Default configuration: this configuration is designed for better information density. It is effective when the length of the hash signature is relatively short (information density ≥0.8 bits/base for Gungnir and Gungnir-ONT, information density ≥1.35 bits/base for Gungnir-Trit). As illustrated in Supplementary Figure 4a, the binary stream can be represented as [𝐻;𝑃], and the hash validation between 𝐻 and ℎ𝑎𝑠ℎ(𝐴,𝑃) will be performed after all digits have been guessed.

Multiple Hash Validation Configuration: this configuration is designed for better error tolerance. Our default configuration operates effectively for Gungnir when error rates remain below 10%. However, at elevated error rates exceeding 15%, the primary challenge of the decoding algorithm shifts from the reliability of hash signature validation to preventing the decoder from pruning correct branches. Specifically, correct branches may accumulate higher edit distances and are more likely to be incorrectly pruned, especially in regions of the sequence to be decoded characterized by a high concentration of errors. Consequently, increasing the length of 𝐻 may not improve the decoding success rate. To address this, multiple hash validation proves to be more effective by frequently pruning incorrect branches during hypothesis tree construction. This configuration is applied when the length of the hash signature is relatively long (information density <0.8 bits/base for Gungnir and Gungnir-ONT, information density <1.35 bits/base for Gungnir-Trit).

In multiple hash validation configuration, the digits of 𝑃 are divided into a set (𝑝 ,𝑝 ,…,𝑝 ), 0 1 𝑘 where the length of each 𝑝 is approximately equal. As illustrated in Supplementary Figure 4b, 𝑖 the hash signature 𝐻 is not a single number but rather a set (ℎ ,ℎ ,…,ℎ ). The binary stream 0 1 𝑘 can be represented as [ℎ ;ℎ ;𝑝 ;ℎ ;𝑝 ,…,ℎ ;𝑝 ;𝑝 ]. Within this information stream, ℎ 0 1 1 2 2 𝑘 𝑘 0 0 serves as the overall hash signature, computed as ℎ = ℎ𝑎𝑠ℎ(𝐴,𝑝 ,𝑝 ,…,𝑝 ), or equivalently, ℎ = 0 0 1 𝑘 0 ℎ𝑎𝑠ℎ(𝐴,𝑃). For ℎ (1 ≤ 𝑖 ≤ 𝑘), is calculated as ℎ = ℎ𝑎𝑠ℎ(𝐴,ℎ ,𝑝 ). During the decoding 𝑖 𝑖 0 𝑖 process, a hash validation is performed for each ℎ (0≤ 𝑖 ≤ 𝑘). The overall hash signature 𝑖 validation for ℎ is conducted after the construction of the hypothesis tree has been completed 0 (as detailed in the Methods section Construction of the Hypothesis Tree). For any other ℎ (1 ≤ 𝑖 𝑖 ≤ 𝑘), hash validation occurs once expected number of digits in a hypothesis have been guessed, and hypotheses that fail any hash validation are immediately pruned. For example, once all digits of ℎ , ℎ and 𝑝 have been guessed in a hypothesis, the decoder verifies the 0 1 1 equality ℎ = ℎ𝑎𝑠ℎ(𝐴,ℎ ,𝑝 ), promptly pruning incorrect branches if a hypothesis fails this 1 0 1 validation. By doing this, correct hypothesis can be preserved when the decoder navigates sequence regions of high error concentration.

Peer review rounds
[{"round": 1, "reviewer_comments": {"reviewer_1": "This manuscript by Zhang et al. introduces Gungnir, a DNA-based storage codec inspired by blockchain proof-of-work, designed to tolerate high levels of substitutions, insertions, and deletions. The authors demonstrate recovery from single reads containing up to 20% total errors, and present two extensions (Gungnir-Trit and Gungnir-ONT) optimized for high-density encoding and Nanopore sequencing, respectively. The framing is novel, the system is technically distinctive, and the potential impact on DNA storage is significant.\nOverall, the paper is interesting and timely. Nevertheless, several aspects of the evaluation and presentation require further clarification or elaboration before the work can be fully assessed, particularly concerning computational cost, practical relevance of extreme-error experiments, and fairness in comparisons. Addressing these issues would substantially strengthen the manuscript.\n1. Joint consideration of recovery rate, information density, and computational resources\nThe current benchmarking focuses primarily on error tolerance and information density. However, computational resources are an equally critical dimension for evaluating codec practicality. Because Gungnir achieves its error-tolerance advantages through substantial search-space exploration (e.g., multi-round Wmax adjustments and large memory usage), it would be helpful for readers to see a more integrated assessment.\nFor example, a three-axis comparison: recovery rate, density, and computational load, would better illustrate the practical trade-offs among different codec systems. This would also help contextualize where Gungnir’s strengths are most applicable.\n2. Practical scenarios for very high error-rate recovery\nThe manuscript highlights Gungnir’s ability to fully recover sequences with 20% errors, which is technically impressive. However, since lines 50–51 of the manuscript note that real-world systems typically encounter ~3–5% errors, it would strengthen the paper if the authors could clarify under what practical circumstances extremely high error loads (e.g., 15–20%) may occur, and how often such scenarios are expected in archival or sequencing workflows.\nThis clarification would help contextualize the importance of Gungnir’s extreme-robustness regime without diminishing the novelty of the work.\n3. Computational comparison with HEDGES and other codecs\nThe manuscript provides detailed analysis of Gungnir’s runtime and memory requirements but does not include comparisons against existing codecs, particularly HEDGES, which is the most relevant baseline for indel correction. Because computational scalability is critical for both archival and retrieval applications, it would be beneficial to include a matched computational comparison. Even if only approximate or using similar sequence lengths, such a comparison would help readers understand whether Gungnir’s computational requirements are comparable, moderately higher, or substantially higher relative to the best existing methods.\nThis addition would substantially clarify the practical feasibility of the proposed approach.\n4. Applicability to high-frequency retrieval scenarios\nThe manuscript states that Gungnir can be used for high-frequency data retrieval. Since such applications often emphasize low latency and efficiency, it would be helpful if the authors could elaborate on how Gungnir (or Gungnir-ONT) satisfies these requirements in practice. For example, does reduced Nanopore error rate offset the higher decoding cost? Are there specific retrieval regimes where Gungnir is especially advantageous?\nA brief clarification would help readers better understand the intended use cases.\n5. Potential complementarity with redundancy-based systems\nGiven that Gungnir excels under heavy indel conditions, it may be worth discussing whether it could complement existing redundancy-based schemes (e.g., outer RS codes, fountain codes) to balance robustness and computational load. This is not required to implement but could provide insight into how Gungnir fits within the broader landscape of DNA storage architectures.\n6. Fairness of comparisons involving Gungnir-Trit\nGungnir-Trit performs a binary-to-trinary conversion prior to transcoding, while competing methods operate directly in the binary domain. Although the design is reasonable, it would be helpful if the authors could comment on how this affects comparison fairness and whether the trinary-based approach introduces advantages unavailable to binary-based schemes. Additionally, the authors might briefly comment on whether alternative representations, such as quaternary encoding, could generalize the approach or offer a natural fit to DNA’s four-base alphabet. This does not need to be explored experimentally, but acknowledging the design choice would improve clarity.\nMinor comments\n1.Section structure\nSome sections in the Results and Methods are relatively short. Merging related subsections into more cohesive units would improve flow and align more closely with Nature Communications formatting norms.\n2.Figure 4c readability\nThe color scheme (blue background with white text) reduces readability. A high-contrast palette may improve clarity, especially when numerical values are important.\n3.Nanopore optimization details\nGungnir-ONT shows substantial reduction in expected Nanopore error rates, which is valuable. It would help if the manuscript included brief context on how stable the base-preference table is across sequencing chemistries or models, and whether its selection strategy generalizes.\n4.Biological plausibility of extreme indel conditions\nSince Gungnir’s main advantage is correcting heavy indels, the authors may consider adding a short explanation or citation describing contexts where such patterns might realistically arise in DNA storage systems.\n5.Address-guessing mechanism\nThe decoder guesses fragment addresses rather than encoding them explicitly. Although pruning likely corrects incorrect branches early, a brief note confirming this behavior (possibly in Supplementary Information) would help readers unfamiliar with hypothesis-tree decoders.", "reviewer_2": "Summary of the Paper:\nThe manuscript introduces Gungnir, a DNA data storage codec that uses a blockchain-inspired proof-of-work approach to enhance error tolerance and reduce redundancy. The authors claim that their method can robustly correct high rates of substitutions, insertions, and deletions using configurable hash signatures and hypothesis testing, yielding high data density. Benchmarking against current state-of-the-art codecs suggests that Gungnir achieves superior recovery rates at elevated error rates, particularly in single-read and indel-rich scenarios. The framework has also been extended to address Nanopore-specific constraints and analyzed in terms of computational cost and density.\nMajor Remarks:\nTerminology (lines 44 and 413): The manuscript uses \"synthesis, degradation, and sequencing\" to describe error sources. However, \"degradation\" is a consequence of synthesis and sequencing, not a distinct process. The authors should replace \"degradation\" with \"storage\" to clarify that errors can arise during long-term DNA storage, as well as during the synthesis and sequencing steps.\n- Excessive Indel Claim (Line 81): The assertion that Gungnir is the first codec to handle excessive indel rates should be moderated. Some referenced codecs (e.g., HEDGES and DNA-Aeon) also address indel correction; therefore, the claim should reflect relative improvements, not primacy.\n- Hash Collisions (Line 285; Whole Section): The authors acknowledge that hash collisions occur under specific conditions, yet they lack a rigorous theoretical or empirical analysis of these events. They should include a statistical analysis that quantifies collision probabilities as a function of hash signature size, sequence error rate, and information density. This is critical for understanding reliability trade-offs.\n- Biomedical Constraints and Degradation (lines 474–475; entire section): The handling of edge cases in which previously corrected sequences violate biomedical constraints due to further storage-induced degradation (e.g., homopolymers introduced via mutation or substitution) requires further explanation. Add a discussion of possible mitigation strategies for such scenarios, including decoding failure risks and fallback mechanisms.\n- Resilience Against Sequence Loss (General): The current text does not address the codec's resilience against the complete loss of DNA fragments, a relevant topic for practical archival applications. This should be discussed explicitly.\nMinor Remarks:\n- Clarity and Language (Line 98): Improve the phrasing and style for clarity. Consider splitting complex sentences and refining word choice for precision.\n- Page Numbers (General): Add page numbers to the manuscript to facilitate referencing and review.\nFigure Recommendations:\n- Use color-blind-friendly palettes (such as Color Universal Design, Viridis, or simultaneous red/blue/yellow contrasts) and minimize the use of color where it is not essential for conveying data trends. Consider the following for each set of figures:\n- For bar charts and heat maps, use varying patterns, grayscale shading, or single accent colors to draw attention and avoid unnecessary complexity.\n- Where distinctions are important, such as when comparing precision and recall across codecs or error rates, use high-contrast palettes and avoid color combinations like red-green unless paired with symbols or labels.\n- For complex, multi-series line plots, limit the number of colors, and use dashed or dotted lines for differentiation.\n- Keep the background white or light. Avoid chart junk, such as gridlines and excessive borders. Make the axis labels large and clear.\n- Add direct annotations or callouts to highlight major trends or exceptional performance, rather than relying on color cues.\n- Add figure captions that precisely explain what is shown, avoiding color references when possible.\nRecommendations:\n- Review and revise terminology for clarity regarding error sources.\n- Rephrase overstatements regarding indel correction capabilities.\n- Provide a quantitative analysis of hash collision risks.\n- Improve the clarity and style of the manuscript, especially the introduction.\n- Discuss edge cases for biomedical constraints and resilience to complete fragment loss.\n- Add page numbers and ensure that figures are accessible, focused, and clear by adopting color-blind-friendly palettes and annotating important data points directly."}, "author_response": "RE1: We thank the reviewer for the insightful comments and constructive suggestions. In response, we have performed additional benchmarking to jointly evaluate recovery rate, information density, decoding time, and memory usage across a range of error rates (3%–8%). We have also included direct comparisons with HEDGES and DNA-Aeon.\nAs shown in Figure R1 and Table R1, within this practically important error-rate range, Gungnir decodes faster than DNA-Aeon. Although it is slower than HEDGES, the gap remains within the same order of magnitude. In terms of memory usage, Gungnir is comparable to DNA-Aeon but exceeds HEDGES by more than an order of magnitude, mainly because Gungnir processes up to 88 sequences in parallel. Nevertheless, within the error-tolerance regime of HEDGES (<6% error rate), the peak memory required to decode a single Gungnir sequence is slightly lower than that of HEDGES.\nRegarding computational load, Gungnir is not the most lightweight option; instead, it is designed to prioritize robust recovery and high information density. The new benchmarks clarify the practical trade-offs across the three axes highlighted by the reviewer: recovery rate, density, and computational resources. Because DNA data decoding is typically performed offline, computational load is often less critical than reliability and density. Under these conditions, Gungnir offers superior information density and uniquely high error tolerance, at a computational cost that is reasonable for its level of performance. This makes Gungnir particularly suitable for scenarios that demand either high storage density or reliable operation under high noise.\nWe have incorporated these new benchmarking results into the Results section (lines 194–210) and updated Figure 4 accordingly.\n\nRE2: We appreciate the reviewer’s important point about the practical relevance of high error-rate recovery. While it’s true that error rates in controlled laboratory settings typically range from 3 to 5%, robust performance under significantly higher error loads is crucial for addressing critical real-world challenges in DNA-based storage. This is because of the following two reasons.\nFirst, since DNA storage is currently only cost-effective for long-term archival data, we must account for the error accumulation that occurs over time due to chemical decay. For example, an error rate of 20% could correspond to a decay period of around 406 years (based on typical degradation models). Therefore, designing a storage system solely based on the error rate observed immediately after synthesis and sequencing is insufficient for ensuring long-term viability. Proactively preparing for higher aggregate error rates is a practical necessity for achieving archival resilience.\nSecond, while the average error rate across a sequencing pool may be 3–5%, the distribution of errors is highly non-uniform across reads. Empirical data from existing datasets (e.g., Srinivasavaradhan et al.) [1] demonstrate that a significant portion (~7.1%) of reads frequently exhibit error rates > 10%, and 12.0% of reads exhibit indel rates > 7%. Therefore, a codec system should consider the more challenging scenario, as relying solely on high-quality reads or waiting for sufficient depth of such reads might be inefficient.\nWe have added this clarification to the Discussion section (lines 436–446) to better contextualize the practical importance of this performance.\n\nRE3: We thank the reviewer for this valuable suggestion. To enable a direct and fair assessment of computational scalability, we conducted new benchmarking experiments against HEDGES, the most relevant baseline for indel-tolerant decoding. These experiments were performed under closely matched conditions: comparable sequence lengths (300 nt) and identical information density (0.64 bit/base). We evaluated runtime, memory consumption, and recovery performance across error rates from 3% to 8% (lines 212–222).\nAs shown in Figure R2 and Table R2, under this configuration Gungnir exhibits memory usage similar to that reported in RE1. However, its runtime is about an order of magnitude slower than HEDGES. This reflects a performance saturation effect: in this error regime, the noise level is still well below Gungnir’s performance limit, so the decoder incurs a nearly constant minimum decoding time, largely independent of the actual error rate. Importantly, for error rates above 5%, the decode success rate of HEDGES drops below 100%, so the faster runtime of HEDGES in this regime comes at the cost of reduced reliability.\nTaken together, considering the substantial gains in error tolerance that Gungnir offers, we believe this represents a reasonable and often worthwhile trade-off, particularly in applications where robustness and reliability are prioritized over minimal computational cost.\n\nRE4: We appreciate the reviewer’s insightful question regarding practical efficiency in retrieval scenarios. We agree that low latency and computational efficiency are crucial for high‑frequency data access. Gungnir-ONT is specifically designed to address this requirement by reducing the raw Nanopore error rate by 28.4%, thereby presenting a substantially cleaner signal to the decoder and improving decoding speed.\nTo quantify this trade-off, we performed additional benchmarks comparing Gungnir and Gungnir-ONT under realistic conditions, in which the input error rate for Gungnir-ONT was set 25% lower than that for standard Gungnir. The results, summarized in Figure R3 and described in the revised manuscript (lines 403–414), show that Gungnir-ONT leads to a marked reduction in decoding time with only a modest loss in error tolerance. Specifically, relative to Gungnir, Gungnir-ONT exhibits only a ~15% and ~10% reduction in error-tolerance capacity under error profiles 1 and 2, respectively, but achieves substantially faster decoding. For example, in a regime where Gungnir must handle a 20% error rate and requires more than 37 hours to decode, Gungnir-ONT effectively reduces the error rate to 15% and can recover the data in under 8 hours, which is one quarter of the original time. This shift to an easier decoding problem is achieved by pre-processing reads to lower error rates, thereby reducing overall latency for successful data access.\n\nRE5: We thank the reviewer for this insightful suggestion. We fully agree that combining Gungnir with conventional redundancy-based schemes (e.g., outer RS or fountain codes) is a natural and promising direction for building more robust, layered DNA storage architectures. In such a hybrid design, Gungnir would serve as a powerful inner code specialized for handling complex, dense indels, while an outer code would add an additional layer of redundancy to correct remaining errors or erasures. This division of labor could enhance overall robustness, and may help distribute computational load across decoding stages.\nAt the same time, this complementarity comes with a fundamental trade-off: adding an outer redundancy layer necessarily reduces net information density. In regimes where decoding is already relatively easy (e.g., low error rates), the cost in density may outweigh the benefit of additional protection. We therefore see the optimal balance between information density, multi-layer error correction capability, and computational effort as an application-dependent design choice and a valuable direction for future work. We have added a new paragraph accordingly to the Discussion section (lines 467–475).\n\nRE6: We thank the reviewer for raising this important point about representation and comparison fairness. Gungnir-Trit performs a binary-to-trinary conversion before transcoding. This step does not introduce additional redundancy; it simply changes the symbol alphabet in which coding is performed, allowing a different trade-off between information density and error-correction capability. As we now clarify in the revised Results section (lines 252–264), existing “binary-based” DNA codecs typically fall into two categories: (i) 1 bit per base (binary), which is fundamentally capped at 1 bit/base and thus has limited information density, or (ii) 2 bits per base (quaternary), which can approach 2 bits/base but generally relies on external computer error-correction codes and has limited built-in tolerance to dense indels. By contrast, Gungnir-Trit uses ternary symbols to embed strong, indel-resilient coding at the symbol level while still achieving high effective densities in practice (up to log₂3 ≈ 1.58 bits/base). The binary and ternary variants share the same underlying code structure, and users can select between binary (0.5–0.8 bits/base) and ternary (0.87–1.45 bits/base) settings depending on the error regime and desired density. Because all reported densities are measured in bits per DNA base, and the same physical alphabet (A/C/G/T) is ultimately used, we view the ternary representation as a transparent design choice within the coding strategy rather than an unfair advantage.\nRegarding alternative representations, our approach is not conceptually limited to ternary. The same coding principles could, in principle, be applied over quaternary or higher-arity alphabets, which is particularly natural in composite DNA systems where the effective alphabet size can be 8, 12, or larger. In such settings, base-4, base-6, or other q-arity encodings become attractive options. We now briefly note this in the Discussion section (lines 448–457) and view extending Gungnir to fully quaternary and composite alphabets as promising future work, while the current study focuses on binary and ternary instantiations for clarity and experimental validation.\n\nRE7: We have revised the manuscript to address this suggestion. Specifically, in the Results section, we merged the two subsections under “Analysis of the Characteristics of Decoding Mistakes” (“Distribution of Mistaken Bits” and “Error Patterns in Sequences with Decoding Mistakes”) into a more cohesive unit.\nIn the Methods section, we similarly merged related subsections under “Gungnir Transcoding”, “Biomedical Constraints-aware Transcoding”, and “Configurations for Different Information Density”. During this process, we also refined the wording and added smoother transitions so that these parts now read as more continuous narratives.\n\nRE8: We thank the reviewer for this helpful suggestion. We have revised the color schemes of the original Figure 4c and 4d (now Figure 4e and 4f) to improve readability. Specifically, we replaced the previous colors with a blue–gray gradient to represent numerical values with higher contrast, and we adjusted the font style and size to make the numerical labels and text clearer. The same modifications have been applied to Supplementary Figures 1 and 2 to ensure consistent and easily interpretable visualization across all figures.\n\nRE9: We appreciate the reviewer’s constructive suggestion regarding the generalizability and stability of the base-preference table approach. Since the table is empirically derived from a calibration dataset, it is expected to be influenced by the specific ONT chemistry and basecalling model used. Therefore, changes in chemistry or model would necessitate regenerating the table. More broadly, the concept of constructing and utilizing a base preference table is not limited to Nanopore sequencing. This strategy is, in principle, technology-agnostic and can be applied to other major sequencing platforms, such as Illumina or PacBio, each with its own unique error profile.\nIn this work, we chose Nanopore (ONT) as the primary demonstration platform due to its portability and ability to rapidly retrieve long-read data, which are appealing for DNA storage applications. By using Gungnir-ONT as a reference, we can showcase the complete workflow and the significant benefits of utilizing error profiles. We have added a paragraph to the revised manuscript (lines 416–423) to explicitly discuss this point.\n\nRE10: We appreciate the reviewer’s suggestion to clarify the biological plausibility of the extreme indel conditions that Gungnir is designed to handle. In the revised manuscript, we have added a short explanation and citation to the Introduction (lines 54–68) to address this point. Specifically, we now reference the dataset of Srinivasavaradhan et al. [1], which demonstrates that a substantial proportion of reads in practical experiments exhibit heavy error burdens: approximately 7.1% of reads have overall error rates >10%, and 12.0% of reads have indel rates >7%. These observations arise under realistic synthesis, amplification, and sequencing conditions, and illustrate that dense indels are not merely theoretical edge cases but a recurring challenge in current DNA storage pipelines.\nWe have updated the Introduction accordingly to emphasize that such heavy indel profiles are empirically observed and to motivate the need for a codec like Gungnir that can robustly correct them.\n\nRE11: We thank the reviewer for this helpful suggestion. To provide a clear and self‑contained explanation of this core mechanism, we have added a dedicated section to the Supplementary Information (lines 270–292). In this section, we describe in detail how the decoder infers fragment addresses on the fly and explain why incorrect address hypotheses are typically pruned at an early stage due to inconsistencies with the observed sequence.\n\nRE12: We thank the reviewer for this precise and helpful clarification. We agree that “degradation” is ambiguous and does not accurately denote a distinct process alongside synthesis and sequencing. As suggested, we have replaced “degradation” with “storage” throughout the manuscript (specifically, “archival storage” when referring to long-term preservation) to clearly indicate that errors can arise during the storage phase itself, in addition to those introduced during synthesis and sequencing.\n\nRE13: We thank the reviewer for this careful observation. To more accurately reflect our contribution relative to prior work, we have revised the statement to lines 85–87:\n“To the best of our knowledge, Gungnir is the first codec system that can effectively handle >10% indels using only a single sequence copy.”\nThis revision emphasizes our specific advancement in tolerable indel rate and single-copy decoding, rather than implying absolute primacy in indel correction.\n\nRE14: We thank the reviewer for this suggestion. In the revised manuscript, we have added an explicit statistical analysis of hash collisions as a function of information density and error rate (see lines 340–351). As shown in Figure R4, this analysis quantifies collision probabilities under different settings and shows that they remain low across practical regimes (e.g., <0.2% at 0.5 bit/base, and <8% even at 0.8 bit/base near the error-tolerance limit). Moreover, most collisions can be further resolved by edit distance filtering (maintaining 100% data recovery at 0.6 bit/base even with a maximum of 3.47% collisions). We hope this could address the reviewer’s concern about rigorously characterizing reliability trade-offs.\n\nRE15: We thank the reviewer for raising this important point about storage‑induced mutations and their interaction with biomedical constraints.\nIn our framework, these edge cases are inherently handled by the decoder and do not require special treatment. During decoding, any candidate sequence that violates a specified biomedical constraint (e.g., a long homopolymer introduced by a substitution or mutation during storage) is automatically classified as an invalid hypothesis and pruned from the search space. This in fact makes such sequences easier to reject, as they lie outside the admissible constraint set. Accordingly, no additional fallback mechanism is required for sequences violating biomedical constraints due to storage-induced degradation – they will simply be error-corrected by the decoder. The risk of decoding failure in such cases is fully captured in the reported error‑correction performance at the corresponding error rates. For clarity, we have added a new paragraph (lines 595–601) to discuss this in more detail.\n\nRE16: We thank the reviewer for highlighting this crucial aspect of practical archival systems. The core Gungnir codec is designed to correct errors within sequences (substitutions, insertions, and deletions) but is not by itself resilient to the complete loss of DNA fragments. As the reviewer rightly notes, robustness against fragment loss (erasures) fundamentally requires additional redundancy at the data level, typically provided by outer codes such as Reed–Solomon (RS) code or DNA fountain or through multiple-site duplications.\nWe fully agree that combining Gungnir with such redundancy-based schemes is a natural and promising approach for constructing more robust, layered DNA storage architectures. In an envisioned hybrid design, Gungnir would function as a powerful inner code specialized for correcting complex, dense indels that are particularly challenging for existing methods. An outer code would then operate on the inner decoder’s output to provide an additional layer of protection, both for correcting any remaining errors and for recovering from complete fragment loss. This division of labor can substantially improve robustness and may help distribute computational effort efficiently across decoding stages.\nWe see the systematic design and evaluation of such integrated systems as an important direction for future work. A key objective will be to identify favorable trade-offs among information density, multi-layer recovery capability, and computational cost. We have added a new paragraph in the Discussion Section (lines 467–475) about these points to the revised manuscript.\n\nRE17: We thank the reviewer for this comment. We have revised the sentence in our manuscript (lines 102–104) for clarity and precision as follows: “Encoding converts binary data fragments into DNA sequences, whereas decoding reconstructs the original information from error-prone DNA sequences.”\n\nRE18: We have added page numbers to the manuscript accordingly.\n\nRE19: We thank the reviewer for this valuable suggestion. In the revised manuscript, we have adopted the color-blind-friendly Viridis palette in Figures 4g–4j, 5a–5d, and 6e–6f, and minimized the use of color where it is not essential. In these figures, we now rely primarily on distinct marker shapes (and line styles where applicable) rather than color to convey data trends, thereby improving accessibility for color-blind readers.\n\nRE20: We thank the reviewer for this helpful suggestion. For the bar charts in Figures 4a and 4b, we now use grayscale shading to convey single-sequence peak memory. For the heat maps in Figures 4e–f, Supplementary Figure 1, and Supplementary Figure 2, we have reduced the use of color and adopted a single blue–gray gradient to avoid unnecessary complexity.\n\nRE21: We thank the reviewer for this important suggestion. As noted in our response to RE19, in all figures where we compare precision and recall across codecs or error rates, we now use the high-contrast, color-blind-friendly Viridis palette and avoid red–green combinations. We also pair colors with distinct marker shapes (and line styles where appropriate) rather than relying on color alone to convey distinctions.\n\nRE22: As noted in our responses to RE19 and RE21, we now use distinct markers in the line plots and have adopted the new, color-blind-friendly palette. In addition, in Figures 3a–3b, we have reduced the number of colors and adjusted line thickness, using bold solid lines to emphasize our method while keeping the remaining series visually distinguishable without unnecessary complexity.\n\nRE23: We thank the reviewer for this helpful suggestion. We now use a clean white background for all figures, have removed gridlines, and simplified borders to reduce visual clutter. We have also increased the size and clarity of all axis labels and figure legends to improve readability.\n\nRE24: We thank the reviewer for this valuable suggestion. In Figures 3a–b and all other line plots, we now use a combination of direct annotations (e.g., labels at key turning points or best-performing regions) and distinct line styles or markers to highlight major trends and exceptional performance, ensuring that no trend is communicated by color alone.\n\nRE25: We have revised and expanded the figure captions for all line plots. Each curve can now be unambiguously distinguished using markers and line styles in the captions, ensuring that identification does not depend on color alone.\n\nRE26: We thank the reviewer again for these comprehensive recommendations. As detailed in our responses to RE12–RE25, we have addressed all of these points: we revised and clarified terminology related to error sources, qualified previous statements on indel correction capabilities, added a quantitative analysis of hash collision risks, and improved the clarity and style of the manuscript, particularly the introduction. We also added paragraphs discussing edge cases for biomedical constraints and strategies for handling complete fragment loss, included page numbers, and revised figures by adopting color-blind-friendly palettes and adding direct annotations. We hope these revisions adequately address the reviewer’s concerns and improve the overall quality and readability of the manuscript."}, {"round": 2, "reviewer_comments": {"reviewer_1": "Overall, the authors have addressed most of my concerns and the new analysis significantly strengthen the paper. Therefore, I support its acceptance for publication.\nResolved issues:\n1.Joint consideration of recovery rate, information density, and computational resources：\nThe authors performed additional benchmarking to jointly evaluate recovery rate,\ninformation density, decoding time, and memory usage across a range of error rates (3%–8%). Under these conditions,\nGungnir offers superior information density and uniquely high error tolerance, at a computational cost that is reasonable for\nits level of performance.\n2.Practical scenarios for very high error-rate recovery:\nThe authors revised the Discussion section to clarify the practical significance of this high error-rate recovery by citing two\nmain reasons.\n3.Computational comparison with HEDGES and other codecs:\nThe authors evaluated runtime, memory consumption, and recovery performance across error rates from 3% to 8% across\nexisting codecs including HEDGES, which is very informative.\n4.Applicability to high-frequency retrieval scenarios:\nThe authors performed additional benchmarks comparing Gungnir and Gungnir-ONT under realistic conditions, in which the\ninput error rate for Gungnir-ONT was set 25% lower than that for standard Gungnir. As a result, the authors showed that\nGungnir-ONT leads to a marked reduction in decoding time with only a modest loss in error tolerance.\n5.Potential complementarity with redundancy-based systems:\nThe authors added a new paragraph in Discussion section to provide insight about how Gungnir may fit into the broader\nlandscape of DNA storage architectures, such as RS codes and fountain codes in the future.\n6.Fairness of comparisons involving Gungnir-Trit:\nConceptually, Gungnir is not restricted to ternary settings. The authors expanded the Discussion section to provide\nclarification on this.", "reviewer_2": "Thank you for including my feedback and taking extra care when articulating your thoughts. I am happy to accept this work."}, "author_response": ""}]

Decision letter