Abstract
DNA storage is a promising solution to data explosion due to its high density and longevity. However, existing coding methods struggle to efficiently avoid error-prone sequences while retaining usable ones, leading to low density and high copy numbers. Here we show Siyuan Code, a DNA storage codec that achieves theoretically optimal density. Our method maps binary data to nearly all suitable low-error sequences in a one-to-one manner, using our data structure to catalog and avoid error-prone patterns. This allows operation under very strict biochemical constraints with minimal redundancy. Experiments demonstrate a storage density of 1.66 bits per nucleotide and a capacity of 41 exabytes per gram of DNA, with perfect data retrieval using only six copies per strand. Encoding and decoding speeds reach approximately 1 megabyte per second on commodity hardware, comparable to early USB flash drives. These results bring DNA storage closer to practical deployment.
Subject terms: Biotechnology, Computational biology and bioinformatics, Computer science, Applied mathematics, Software
Existing DNA storage methods struggle to avoid error-prone sequences while retaining usable ones. Here the authors develop Siyuan Code, a bijective codec that avoids high-error patterns, utilises all suitable strands, and reaches 1.66 bits/nucleotide, 41 EB/gram, and only uses 6 copies/strand.
Introduction
The information industry is producing data at an unprecedented scale owing to the widespread adoption of the Internet, cloud computing, smartphones, and the Internet of Things (IoT). Projections suggest that by 2025, the world will generate 163 zettabytes (ZB) of data, necessitating the equivalent storage capacity of about 16 billion 12-terabyte (TB) hard drives. Current storage media are facing significant challenges in accommodating zettabyte-scale data due to their limited storage density. DNA has emerged as a highly promising medium for storing zettabyte-scale data, owing to its ultra-high density1,2. In addition, DNA boasts a longevity that spans centuries and requires minimal maintenance costs3. These compelling advantages have spurred numerous research initiatives aimed at developing fundamental methodologies for data storage in DNA.
DNA storage encodes information as multiple unordered DNA sequences, each of which is made up of bases (A,T,C,G). Each sequence can have multiple molecule copies in order to ensure successful data loading. As depicted in Fig. 1A, the DNA storage process can be delineated into five steps. Initially, in the Encoding step, digital data is converted into nucleotide sequences through in silico processes. Subsequently, these nucleotide sequences are synthesized into physical DNA strands, either in vivo or in vitro, during the Synthesis step. The synthesized strands are then stored in containers in the Storage step. To recover the stored digital data, the DNA is sequenced to retrieve the nucleotide sequences in the Sequencing step. Finally, these sequences are translated back into digital data during the Decoding step.
Fig. 1. Overview illustration of Siyuan Code.

A Five stages of DNA storage and how Siyuan Code encodes binary data to DNA sequences. B Encoding stage. C The mathematical core of bijective coding.
However, practical implementation faces significant challenges. Some DNA strand patterns are prone to high error rates because the chemical properties of DNA can lead to sequence-specific error rates during synthesis and sequencing4,5. For example, homopolymers such as AAAA or TTTT are more error-prone during synthesis and sequencing processes. MESA classifies error-prone strands into three main types, namely strands with homopolymers, strands with unbalanced GC content, and strands with undesired motifs4. To deal with the error, error avoidance and/or error correction should be adopted. Intra-strand error avoidance is more important than intra-strand error correction because error-prone sequences are not worth error correction, and intra-strand error avoidance can work with inter-strand error correction. Most current methods are derived from those used in digital data storage and communication, integrating error correction codes such as the Reed-Solomon code6,7 and Fountain code8–11. Current methods12–20 attempt to circumvent these error-prone and unsuitable sequences (i.e., error-prone strands that are bad for DNA coding) either through filtering-based methods that exclude unsuitable strands after random generation, as with Fountain code15, or through manual designs12,13 that deliberately use only low-error and suitable patterns (i.e., low-error strands that are good for DNA coding; note that a low-error strand describes the objective property, while a suitable strand describes the reasonable choice in DNA coding). Filtering-based methods suffer from either endless repetition of generation and rejection caused by strict constraints or higher error rates followed by higher copy numbers and lower density caused by loose constraints. Filtering-based methods could thus be inefficient, unstable, high in strand error rates and low in density (Supplementary A.2.1). Manual designs require substantial effort to adapt to changes in synthesis and sequencing technology and often fail to utilize all suitable strands, leading to low density. Also, manual designs are often not compatible with customized patterns or artificial nucleotides (Supplementary A.1.3). Neither approach maintains all suitable sequences while avoiding all unsuitable ones, so neither fully leverages the potential density of DNA storage with optimal efficiency.
As explained above, despite the theoretical potential for high-density DNA storage, practical and achievable densities are significantly constrained by current techniques21–26. The current methods face the aforementioned challenges in error avoidance, and this limits DNA storage from realizing its full potential.
We contend that the challenge of DNA storage encoding is fundamentally a constrained channel coding problem within the DNA storage context, which necessitates an information-theoretic approach27. Constrained channel coding refers to the scenario where the channel exhibits lower error rates under specific patterns, thus motivating the design of codes that primarily utilize strands free from error-prone patterns.
We are not satisfied with classical constrained channel coding approaches, as they typically evolve into manually designed DNA storage coding when applied to this domain13,28. They often employ the segmented approach, where each segment enumerates an encoding set. This can lead to constraints that are either overly strict or overly lenient at the boundaries between segments and the segmented enumeration is slow. Such approaches are highly manual and often overly conservative in design, ensuring only that output DNA sequences satisfy constraints without guaranteeing the potential to utilize all constraint-compliant sequences. Inspired by enumerative coding in data compression in information theory29, we seek to establish a one-to-one mapping between all usable DNA sequences in the channel and binary data, thereby ensuring no compliant strand is overlooked. However, the prohibitive complexity of direct enumerative coding makes it impractical. To retain its advantages while overcoming this limitation, we adopt a counting-based encoding approach in place of enumeration.
To address this challenge, we re-evaluate the foundational principles of data storage and propose Siyuan Code, an innovative open-source encoding method designed for DNA-based data storage. Siyuan Code diverges from traditional manually designed or filtering-based methods. Instead, it assigns a unique sequence number to each suitable nucleotide sequence with an acceptable error rate, effectively mapping digital data one-to-one to a specific DNA sequence within a user-defined range, as shown in Fig. 2A. By keeping all suitable sequences and excluding all unsuitable ones, the method inherently achieves theoretically optimal information density through its one-to-one property. To circumvent the impracticality of enumerating and storing all feasible sequences, we employ our Trie automaton to identify unsuitable patterns and utilize dynamic programming to streamline our counting-based mathematical construction in encoding and decoding processes. In terms of time complexity, our linear time algorithm ensures that the number of plus/minus/comparison computations in one strand is proportional to strand length in our computation. As a result, changing the strand length or the changing the constraints hardly affect the coding speed of our algorithm, as shown in Fig. 3B, C.
Fig. 2. Simplified conceptual illustration for the core principle of Siyuan Code.

A Siyuan Code Core Algorithm is a bijective mapping between the set of suitable DNA sequences and the set of binary data. The components are Trie Automaton, DP counting, and counting-based enumeration-less bijective enumerative coding. B Siyuan Code employs Siyuan Code Core Algorithm with error correction and index plugins to deal with file-to-DNA coding. Icons are in the Public Domain.
Fig. 3. In silico experiments. FC: Fountain Code; RC: Rotation Code; SYC: Siyuan Code; YYC: Yin-yang Code. The number after the code name is the DNA strand length, and the “-dup” suffix indicates duplication (copy number = 5), i.e., replication is employed during sequencing; thus, SYC-150-dup stands for the Siyuan Code with 150 DNA strand length and duplication.

A The relations between system error rate and the density for different coding methods. The bottom-right corner denotes the highest density with the least error rates. B The encoding/decoding time with different DNA strand lengths when 4-Homopolymer is forbidden. C The encoding/decoding time with different lengths of forbidden homopolymer with DNA strand length 200. D The single-strand error rates of different methods. E The failure rate when encoding small files (Wikipedia’s self-introduction). The curves are the system failure rate with different random seeds under different number of rounds. In each curve, the rounds are the multiple tries with the same random seeds. All panels in this figure can be reproduced using the simulation code. The Docker environment is available on Code Ocean.
Our Trie automaton data structure is inspired by the classic trie tree data structure30,31 and the Aho-Corasick algorithm32. Dynamic Programming (DP) serves as a versatile and widely applicable classic computational method31. Siyuan Code employs our Trie automaton—inspired by the Aho-Corasick algorithm—to achieve a practical whole-strand bijective mapping for DNA storage. This approach enables theoretically optimal density, a capability that previous encoding methods could not attain.
Unlike filtering-based methods, which face a dilemma between loose constraints (high error rates) and strict constraints (endless retries), Siyuan Code operates deterministically and can adopt arbitrarily strict constraints without breakdown. Stricter constraints yield lower single-strand error rates and reliable operation with very low copy numbers. These combined advantages are key to realizing the substantially high storage density reported for Siyuan Code.
Through computational in silico simulations and chemical in-vitro experiments with text and image files, Siyuan Code delivers information density and storage capacity at competitive levels: 1.66 bits per nucleotide (bits/nt) and 41 exabytes per gram (EByte/g), respectively, with an encoding and decoding speed of ~ 1 megabytes per second (MB/s). This performance is 63 × faster and 192 × denser than the Fountain Code and 435 × faster and 18 × denser than the Yin-yang Code. This encoding and decoding speed is at the level of the full speed USB1.1 flash drive (1.5 MB/s = 12 Mbps). This speed matches the range of early practical storage devices, yet we achieve it on commodity hardware. When compared to the often cited but highly idealized theoretical limit of 455 EByte/g proposed by Church et al.33, the storage capacity of our method is notable because it approaches a comparable order of magnitude. Their calculation assumes 2 bits per nucleotide with zero overhead for indexing, error correction, or redundancy—conditions that are practically unattainable, making their limit a loose upper bound.
Siyuan Code offers several additional benefits: (1) it allows for the easy customization of patterns to reflect the nuances of various synthesis, storage, and sequencing technologies; (2) it supports the integration of artificial nucleotides, such as 5-methylcytosine and 5-hydroxymethylcytosine, alongside the canonical nucleotides A, C, G, and T; (3) as a deterministic algorithm, it runs stably regardless of data types with no risk of unsuccessful encoding or decoding caused by post-filtering; (4) it provides the flexibility to incorporate diverse encoding and error-correction techniques as interchangeable sub-modules, akin to building with Lego; and (5) it is open source. With the advantages above, Siyuan Code could potentially be the starting work of a series of works on whole-strand one-to-one codings.
Positioning and contributions
This work achieves a full-chain contribution, from foundational component innovation to complete system validation, which is concretely manifested across the following four layers:
(1) Component Innovation of Siyuan Code Based on Classical Ideas: To address the specific constraints of DNA storage, we conduct targeted improvement and theoretical substantiation of classical ideas. The first core component is our Trie automaton as a data structure. Building upon the idea of the Aho-Corasick algorithm32, innovations such as the press edge ensure strictly non-amortized time complexity for state transitions, accompanied by theoretical proofs for its construction method and properties. The second core component, based on this automaton, uses the idea of dynamic programming31 to solve the “suitable DNA strand” counting problem, serving as the DP component. The third core component builds upon the DNA counting solved by the aforementioned DP, utilizing the idea of enumerative coding29 to construct an encoder/decoder component that performs encoding and decoding based on DNA counts.
(2) Construction of the Core Algorithm: Based on the three components above, we propose and deeply integrate dynamic programming counting and bijective encoding into the Trie automaton, designing and implementing a deterministic bijective encoding core that approaches the theoretical limit under complex constraints. This forms the algorithmic heart of the entire system.
(3) Engineering Realization of a Complete Codec System: To equip the core algorithm with error-correction and practical functionality, we construct a complete system layer, as shown in Fig. 2B. This integrates components such as intra-strand error correction, index addressing, and inter-strand error-correction schemes as pluggable modules, thereby engineering the theoretical bijective encoding into a robust and practical codec capable of processing arbitrary files and resisting biochemical errors.
(4) Systematic Validation and Performance Benchmarking: We validate the method’s scalability and theoretical performance through in-silico experiments. Furthermore, via rigorous third-party in-vitro experiments under real biochemical conditions, we verify all key claims of the system: achieving perfect data recovery with a low copy number and high physical storage density.
In summary, the contribution of this work lies in proposing a complete DNA storage coding system—innovated and optimized across its underlying data structures and ideas, core algorithm, system implementation, and experimental validation—thereby establishing a solid theoretical and experimental benchmark for its efficiency, reliability, and high density.
We consider the second layer, the construction of the core algorithm (as shown in Fig. 2A), to be the most critical focus. This core algorithm can be viewed as both the integration and engineering application of the first-layer sub-components, and as the theoretical foundation for the third layer.
Detailed theoretical analyses of components are provided in Supplementary B (together with the comparisons with the classic Aho-Corasick algorithm). Furthermore, given the high degree of integration between our first-layer components and classical ideas, we provide additional clarification regarding the specific boundaries between these classical ideas and our innovations in Supplementary E.16.
Results
A general overview of Siyuan Code
Siyuan Code constructs a codebook by assigning non-negative integers to DNA sequences that exhibit low error rates, effectively creating a high-density encoding scheme. The codebook deliberately excludes sequences with high-error-rate motifs, such as homopolymers longer than two nucleotides, GC content outside the 40--60% range, and other subsequences known to increase error rates, including problematic primers or structural features.
To encode binary data, the data is segmented into blocks, each of which is translated into a decimal number that corresponds to a binary string. This decimal number is then used as an index to retrieve a specific DNA sequence from the codebook, with the X-th sequence representing the binary string of the integer X. Decoding involves locating the DNA sequence within the codebook to find its index, which is then converted back into a binary string.
However, this direct approach is impractical owing to the exponential growth of suitable sequences with increasing sequence length, a challenge illustrated in Supplementary Fig. 13 and Supplementary Fig. 19. Maintaining an exhaustive codebook and performing lookups within it would be prohibitively time-consuming and space-intensive. To mitigate this, we must devise more efficient methods for codebook management and sequence retrieval, as shown in Fig. 2A.
To overcome the challenge posed by the vast number of suitable sequences, Siyuan Code employs a Trie structure to efficiently catalog all patterns unsuitable for DNA storage. These patterns, which do not increase exponentially with sequence length, significantly reduce the required storage space compared to storing suitable sequences directly. As shown in Fig. 1C, Siyuan Code enhances the Trie by transforming it into a Trie automaton. This structure, coupled with dynamic programming techniques, substantially accelerates the encoding and decoding processes. This advanced Trie automaton dynamically computes values that facilitate the quick determination of suitable sequences, thereby streamlining the traversal through the Trie structure during the counting-based construction with Dynamic Programming in the encoding and decoding phases. The algorithm is detailed in section 4 with its formal proof in Supplementary B.
As shown in Table 1, coding potential differs from net information density. Coding potential represents an extremely high information density under special settings that disregard error correction and real-world feasibility. For example, Fountain Code removes all redundancy and the index (random seed) when calculating coding potential. As a result, coding potential represents only a theoretical maximum without feasibility requirements. With the density given by coding of previous works, the system does not need to work with error correction. Our 2.0 coding potential is in the setting that we input nothing to the Trie and make zero limitation to the strands, and at the same time we remove the index and error correction and believe the accuracy of DNA synthesis and DNA sequencing. With our extreme setting, our method can simply degenerate into quaternary conversion. Our coding potential setting is very close to the settings of the previous coding potentials. Also, we think that coding potential is too tricky and urge not to use this scoring criterion to evaluate the density of codings. We will show the superiority of our method with other criteria.
Table 1.
Comparison among popular methods
| NGDIS33 (Church et al.) | PHCLMIS12 (Goldman et al.) | RCPDIS ECC13 (Grass et al.) | Fountain Code15 (Erlich et al.) | Yin-yang Code16 (Ping et al.) | Aeon Code38 (Welzel et al.) | DNAFormer 28 (Bar-Lev et al.) | Siyuan Code (This work) | |
|---|---|---|---|---|---|---|---|---|
| Error correction strategy | No | Repetition | RS | Fountain | RS | Fountain+CRC | RS+DL | RS |
| Robustness against excessive errors | Yes | Yes | Yes | No | Yes | Yes | Yes | Yes |
| Coding potential (bits ⋅ nt−1) | 1 | 1.58 | 1.78 | 1.98 | 1.95 | N/A | N/A | 2 |
| Net information density (bits ⋅ nt−1) | 0.83 | 0.33 | 1.14 | 1.57 | N/A | 1.15 | 1.6 | 1.66 |
| Physical density achieved (In vitro) (EBytes ⋅ g−1) | 0.00128 | 0.00225 | 0.025 | 0.214 | 2.25 | Not Given | Not Given | 41 |
| GC content (%) of sequences | 2.5–100 | 22.5–82.5 | 12.5–100 | 40–60 | 40–60 | 40–60 | 45–55 | 42.9 – 57.6 |
| Maximum homopolymer length (nt) | 3 | 1 | 3 | 4 | 4 | 3 | 4 | 2 |
| Customized maximized homopolymer length (nt) | ≥1 | = 1 | ≥3 | ≥4 | ≥4 | ≥3 | =4 | ≥1 |
As shown in Fig. 1, net information density differs from actual physical density. Net information density accounts for errors and includes important components such as the index or random seed to ensure real-world feasibility. However, this density scoring criterion can still be manipulated. A sufficiently large copy number for each strand can decrease any strand error to nearly zero. We do not exploit such manipulation and instead provide a solution with a very low copy number for each strand. With this low copy number, our method remains effective. We acknowledge that net information density can be somewhat misleading. For fair comparison, both copy number and strand length must be controlled. Only simulation can converge all the previous methods with the same setting in copy number and strand length. We will show the superiority of our method with the consideration of copy number, by comparing in-silico net information density and in-vitro physical density (reported results). The copy number is important when decreasing the physical density and a high physical density can save the increasingly precious and costly space in the potential large scale and very long term storage.
Here, we distinguish between in-vitro density and in vivo density. In-vitro density refers to the actual density of dried DNA powder. It is the data size divided by the powder weight. If each strand has multiple copies, the average copy number of the strands influences the powder weight. In-vitro density excludes the weight of the container because the increase in information amount does not depend on the number of containers, and the amortized weight of the container converges to nearly zero percent as the data amount increases. Theoretically, more than 3100 different DNA strands with index can be stored in one huge container. The index length can be decided according to the amount of information to store. In vivo density does not represent actual density for several reasons. First, multiple cells exist and each cell contains at least one copy of the data. A single living cell would not be sufficiently robust owing to programmed cell death34. However, in vivo density counts the data only once. Second, cells used for in vivo density calculations cannot be dried into powder, and the weight of water and other cellular components is not negligible35. Additionally, a cell such as E. coli can store only a limited amount of information36, and the cost of cells cannot be amortized. This weight is not counted in in vivo density calculations. Third, only approximately 5--10% of the DNA can be edited while keeping the cell alive37, and plasmid capacity is much lower than chromosome capacity. The weight of non-editable base pairs is not counted in in vivo density.
To roughly estimate the limits of the in vivo physical density, we do the following calculation. A E.coli cell has about 4.6 million base pairs36. Even if all the bases are used for storage, causing troubles in cell survival, a cell can only store less than 1.09 MB data (). To get a theoretical bound for in vivo storage, the immoderate coding without error correction or detection in vivo presents exactly 2 bits with one base pair. The weight of a living cell (10−12g for E.coli35) results in an actual density of less than 0.9 EByte per gram, which is impractical because there is no extra copy of the cell. It is a rough estimation of the theoretical upper bound of the in vivo storage and the actual upper bound should be much lower. If 10% of the base pairs are used in coding to keep the cell alive37, the theoretical upper bound of the in vivo storage density drops to 0.09 EByte per gram. This upper bound is far smaller than the given so-called in vivo density.
In silico experiments
We evaluate Siyuan Code with in-silico experiments and compare it to prior work, including Fountain Code15, Rotation Code12, and Yin-yang Code16. Recent suboptimal works are not taken into comparison. For example, Aeon Code38 has a lower density than the previous state-of-the-art method Yin-yang Code16 in information density, as shown in Table 1. Detailed descriptions and theoretical comparisons of these works are given in Supplementary A. To compare different coding methods, we use the input data from the Fountain Code paper, consisting of a zip bomb, a Kolibri OS image, a pioneer SVG picture, a book of Shannon, and a small video named the arrival of a train. The total data size is 2,145,290 bytes (2.04 MB). Siyuan Code is implemented in Python 3.8 and evaluated with a 2.6GHz six-core i7-10750H (Windows 10 WSL2). Note that the actual running time may vary depending on hardware specifications; however, all performance comparisons were conducted on the same hardware platform. The in-silico experiments are conducted via a custom simulator, DNASim (Supplementary C), which calculates the overall error rate of encoding systems with error corrections. DNASim utilizes MESA4 to estimate the error rate of a single input DNA sequence with given parameters. DNASim implements a random DNA error simulator to compare the density of the methods at the same error rate and the error rate at the same density.
We emphasize that the central reported results—the physical density of 41 EB/g and the perfect-retrieval copy number of 6—are obtained from in-vitro experiments, not from simulation. The simulator is used primarily for comparative analysis and design guidance, and all simulation-derived results are explicitly labeled as such throughout the manuscript.
It is possible to achieve unreasonably high density when error rate is not considered and successful decoding is disregarded. Therefore, we compared density under different system error rates to avoid unreasonable exploitation of the evaluation criteria. The system error rate is the probability that the system can not perfectly retrieve the information. As system error rates are key factors affecting the density, we compare the storage density of Siyuan Code to prior methods under different system error rates. Figure 3A shows curves depicting the relationship between net information density and system error rates. The x-axis quantifies the net information density, defined as the ratio of the number of bits effectively stored to the total number of nucleotides used, including those allocated for error correction and indexing purposes. The y-axis represents the system error rate.
For each encoding method, we adjusted the level of redundancy applied during data encoding to generate a curve demonstrating the interplay between net information density and system error rates. As expected, introducing more redundancy diminishes the error rate but at the expense of storage density. This inverse relationship is evident as higher net information density correlates with increased system error rate. Notably, Siyuan Code (SYC-150-dup) outperforms other methods (FC-150-dup and YYC-150-dup) by achieving the highest net information density while maintaining the lowest system error rate, striking a better balance between data storage density and reliability.
To deepen our understanding of the performance characteristics of Siyuan Code, we conducted evaluations varying the copy number (duplication). In practice, to enhance the reliability of DNA storage, each sequence is typically synthesized several times or amplified into multiple copies through Polymerase Chain Reaction (PCR). This copy number redundancy allows each unique DNA strand to be sequenced multiple times (achieving a larger sequencing depth), facilitating the accurate reconstruction of the original DNA sequence with the aid of error detection codes embedded within the strands. In Fig. 3A, the curves labeled with “-dup” represent scenarios where this replication technique is employed to augment net density. The results indicate that Siyuan Code with a strand length of 150 nucleotides and duplication (denoted as SYC-150-dup) surpasses the performance of Siyuan Code with the same strand length but without duplication (denoted as SYC-150). Both configurations of Siyuan Code significantly outperform prior encoding methods by a considerable margin. Furthermore, in the case of SYC-150-dup, 1.66 bits/nt in Table 1 is sufficient for perfect information retrieval.
Strand length is also a critical factor influencing storage density. Our observations reveal that as the strand length is extended from 50 to 200 nucleotides (SYC-50 to SYC-200), there is a corresponding increase in storage density at comparable system error rates. This trend can be attributed to the fact that the overhead associated with fixed-length indexing and checksums constitutes a larger proportion of the total sequence in shorter strands. Consequently, longer strands, which dilute this overhead across more nucleotides, benefit from improved storage density.
Computational efficiency: Post-filtering methods face inefficiency caused by numerous rejection and retry loops under strict constraints when attempting to achieve low error rates with small copy numbers. Otherwise, post-filtering methods with loose constraints would increase either the logical redundancy or the copy number redundancy to gain successful decoding and both would lose high storage capacity. Figure 3B, C demonstrates the computational efficiency of Siyuan Code and other DNA encoding methods. We used the aforementioned 2.04 MB file from the Fountain code paper as the input and evaluated the performance of encoding and decoding. In Fig. 3B, we run different encoding methods with various strand lengths under the condition that 4-homopolymers are forbidden and show the running time. Siyuan Code outperforms its counterparts significantly, being 63 × and 79 × faster than the Fountain code with a 4-homopolymer restriction in encoding and decoding, respectively. Compared to Yin-yang code with the same restriction, Siyuan Code is 435 × and 106 × faster in encoding and decoding, respectively. For very long strands, see Supplementary E.11.
Notably, as strand length increases, there is a noticeable upward trend in running time for Fountain Code. Filtering methods such as Fountain code suffer from the need to reject numerous unsuitable strands, leading to a rapid increase in running time with longer strand lengths. This occurs because the number of unsuitable strands rises exponentially as length increases. Assuming that every k bases have a probability e of containing an unsuitable substrand, a strand of length n would have a cumulative probability of at least to encounter such a substrand. This results in an exponentially decreasing likelihood of avoiding unsuitable substrands in the strand as n grows. Consequently, an exponentially large number of strands can lead to reject-and-retry cycles, leading to prohibitively long running time. As synthesis technology keeps advancing to allow for longer strands, filter-based methods struggle to keep pace due to their inability to efficiently process the increased strand length.
Figure 3C presents the running times for various encoding methods with different homopolymer constraints at a fixed strand length of 200 nucleotides. The x-axis represents the length of the forbidden homopolymer sequence, and the y-axis shows the running time. The figure demonstrates that encoding time increases as constraints become tighter. Fountain and Yin-yang codes fail to function when 3-homopolymers are forbidden. These filtering-based methods are particularly challenged by these stringent conditions, as they must reject a high number of unsuitable strands. The rate of unsuitable sequences accumulates along the length of the strand, leading to a compounded growth in errors that can severely compromise reliability.
Single-strand error rate: The high efficiency independent of constraint stringency enables Siyuan Code to adopt strict constraints and achieve a low single-strand error rate. Single strand error rate can again increase the average amount of information stored per strand, as shown in Supplementary E.1. Figure 3D illustrates the single-strand error rates associated with various encoding methods. The single-strand error rate measures the likelihood of a strand being inaccurately decoded back into its original binary form. In this evaluation, we employed the default settings for each encoding method, which means that the system error rates were not intentionally equalized for comparison. The Fountain and Yin-yang encoding methods exhibit single-strand error rates exceeding 60%, suggesting that significant redundancy is required to achieve system error rates that are within an acceptable range. In contrast, Siyuan Code demonstrates its intrinsic advantage by leveraging an understanding of DNA’s constraints, achieving the lowest single-strand error rate of just 2.2%. This indicates that, even with a copy number of one, Siyuan Code maintains a high likelihood of accurate strand decoding. When the copy number is increased to five, as indicated by the curves suffixed with “-dup”, the single-strand error rate for Siyuan Code approaches zero. Meanwhile, the error rates for Fountain and Yin-yang codes decrease to 33.5% and 36.9%, respectively, showcasing the benefits of increased copy number and sequencing depth in reducing error rates.
In contrast to filtering-based encoding methods such as Fountain Code, Determinism and stability: Siyuan Code produces consistent outputs for identical inputs. This determinism benefits both debugging and result replication. Furthermore, determinism enables Siyuan Code to work with any positive integer as the maximum homopolymer length, not only the value of 2 shown in Table 1. Fountain Code, and other filtering-based methods, depend on a random seed and a pseudo-random number generator (PRNG) to transform information into DNA sequences. Either loss of the seed or changes in the PRNG can break the connection between the sequencing output and the original file, causing failures of decoding.
In addition to determinism, Siyuan Code can be stably applied to small inputs under strong constraints. Owing to randomness and filtering, existing filtering-based methods fail to produce correct strands for small files and sometimes enter infinite loops. As shown in Fig. 3E, when encoding the first paragraph (see the text file in the git repository) of Wikipedia’s self-introduction page (https://en.wikipedia.org/wiki/Wikipedia) with a 4-homopolymer forbidden, the Yin-yang code has approximately a 23% chance of failing to find a pair of suitable blocks to form a suitable sequence. In other words, all strands that Yin-yang code generates fail to satisfy the constraints, causing the algorithm to become stuck in an infinite loop. This failure rate escalates to 100% when the restriction is tightened to forbid 3-homopolymers, rendering the encoding of nearly any file incorrect under such stringent constraints. In contrast, Siyuan Code operates successfully under these challenging conditions, demonstrating superior stability with both small inputs and stringent constraints.
In vitro experiments
To assess the practical performance of Siyuan Code, we conducted a real-world test using a diverse set of data, including the logo of our university, a “Hello World” C++ program, a textual introduction to the university, and an Atari game video. This file collection was compressed into a 30KB file using 7-zip39,40 and then encoded with Siyuan Code. After synthesizing the DNA strands, we sequenced them and applied Siyuan Code to decode the data. The result was a complete and accurate reconstruction of the original compressed file, with all components intact and error-free.
Experiment parameters and setup
In synthesis, each DNA strand is 170 nt in length, including the 18-nt forward primer and the 18-nt reverse primer. The forward primer is chosen as “CTCGTAGACTGCGTACCA”, and the reverse primer is chosen as “GACGATGAGTCCTGAGTA”41. Figure 4D illustrates that the internal 134 nucleotides encode 32 bytes of data, including 27 bytes for file data, two bytes for indexing, and a three-byte checksum, which is the first 24 bits of the file data’s SHA-1 results. The transformation of these 134 nucleotides and 32 bytes is decided by Siyuan Code, where the maximal allowed homopolymer length is two, and the allowed GC percentage is 20–80%. The GC percentage is controlled by the law of large numbers by excluding all five-nucleotide subsequences whose GC content falls outside 20%–80%. Undesired motifs, including primers and subsequences (adjacent substrings of a DNA strand) known to have high error rates4, are also excluded from the Siyuan Code codebook. We chose Reed-Solomon Code for error correction across strands, and the parameter is k = 58 and n = 63, i.e., five parity sequences are generated for every 58 sequences in an error correction group. The parameters listed above should be kept by the file owner to recover the data.
Fig. 4. In vitro experiments and sequence design.

A The physical density of all the methods in comparison. B The statistics of edit distance from the input strands to the closest sequenced strands. C The error rate, the redundancy rate needed and the redundancy rate of each group during error correction after sequencing. Group: the group refers to the Reed-Solomon data block. Error rate: the ratio of errored strands in each group. Redundancy rate: the actual redundancy given in each group. Redundancy rate needed: the minimal proportion of extra strands needed in decoding correctly. D The sequence design of oligo generated by Siyuan Code, YYC and Fountain code. Each rectangle represents a DNA strand. For all panels in this figure, the data pertaining to our work can be reproduced using the provided test code and sequencing data. Panel D is a schematic illustration and does not involve experimental data, though its proportions are accurate.
The DNA strands were synthesized using chemical chips24,25,42, with each sequence replicated into six physical copies during synthesis. The strands were then dried and stored without PCR (Polymerase Chain Reaction). To prepare for sequencing, we amplified the DNA strands through PCR to facilitate multiple sequencing iterations. On average, each strand underwent approximately 510.8 sequencing passes. Subsequently, the resulting sequences were merged using a paired-end read merger43 and repaired through error detection and correction algorithms.
Evaluation of physical density
About 95.3% of the sequences are measured correctly in the sequencing, and all sequences are recovered with the error correction. The physical information density can be estimated as follows. The average molecular weight of a base is 308.95 g/mol. As expected, the molecular weight of a strand is 79 + 308.95 × 170 = 52600.5 g/mol. The weight of the strands is about 1253 × 6 × 52600.5/(6.022 × 1023) = 6.5668 × 10−16 g. The information of the strands is 31127 bytes. The size before compression is 86808 bytes. The density is 31127/(6.5668 × 10−16) = 47.4 × 1018 bytes/g ≈ 41 EByte/g. Considering the compression, the density is 86808/(6.5668 × 10−16) = 132.2 × 1018 bytes/g ≈ 115 EByte/g.
Note that the 41 EByte/g is the real-world wet lab density. If we ignore the copy number 6 and consider the compression as a part of the code, the density can then become an eye-catching presentation with the 688 EByte/g. To avoid misunderstanding and avoid unfairness, we describe the different densities of our method in the Supplementary E.10.
Figure 4A displays a comparative analysis of physical density across various storage methods, with the horizontal axis representing the methods and the vertical axis indicating the physical density. The comparison visually illustrates that Siyuan Code achieves a significantly higher density than previous state-of-the-art methods by one to two orders of magnitude. The concrete numbers can be seen in Table 1.
Comparison of sequence designs
Figure 4D contrasts the sequence designs of oligonucleotides. To encode the same 32 bytes of information within a single strand, Siyuan Code requires only 189 nucleotides (nt), whereas Yin-yang Code (YYC) and Fountain Code (FC) both require 200 nt. This highlights a substantial difference between previous methods and Siyuan Code. The latter does not prescribe a fixed strand length for each segment but instead specifies the volume of information to be stored per strand.Moreover, Siyuan Code is compatible with more cost-effective synthesis lengths, such as 170 nt in vitro (see section 2.3).
For reference, we calculate the density of Yin-yang Code exclusive of fixed overhead. The in-vitro physical information density of Yin-yang Code stands at 2.25 exabytes per gram (EByte/g). Within each 200 nt strand, there is a 16 nt Reed-Solomon (RS) error-correcting code, a 16 nt index, and two primers, each 20 nt long. Excluding the two indexes, the density of Yin-yang Code increases to EByte/g. When further removing the error-correcting code and primers, the density escalates to EByte/g. This analysis reveals that the enhanced density of Siyuan Code is not solely due to reduced redundancy. It also benefits from a lower error rate and consequently a reduced average copy number per oligonucleotide sequence.
Error analysis
The evaluated data of Siyuan Code in the vitro experiments is organized into twenty error correction groups. Each group comprises 58 data strands and five parity strands, resulting in an approximate redundancy rate of 8%.
Figure 4C presents the error rate, required redundancy rate, and actual redundancy rate for these groups. The error rate is determined by the proportion of strands that cannot be accurately read after employing the paired-end read merger technique. The required redundancy rate is the ratio of the minimal number of additional strands needed for group recovery with inter-strand error correction to the total number of data strands. The redundancy rate, which is not less than the maximal redundancy rate needed among the groups, is the actual redundancy rate in vitro experiments. The distribution of the required redundancy rate resembles a normal distribution, ensuring that redundancy is utilized efficiently and not excessively. The experiment results show that each group’s actual redundancy rate is no less than the required redundancy rate, indicating that Siyuan Code can successfully decode all groups.
Figure 4B illustrates the distribution of edit distances between correctly synthesized strands and their closest sequenced counterparts. The horizontal axis represents edit distance, and the vertical axis shows the number of strands at each distance. Edit distances less than 5 typically result from sequencing errors, whereas distances greater than 15 indicate strand loss. Notably, our method achieves a molecule copy number as low as 6, significantly lower than previous efforts. The missing strands are likely due to limited sequencing depth and copy number, and we observe a decrease in the error rate with increased sequencing depth and copy number.
Discussion
Siyuan Code proposes a method for converting digital data into DNA sequences. While the basic idea is straightforward, Siyuan Code addresses the fundamental challenges of excessive memory and computation requirements. Siyuan Code provides several advantages over existing solutions. First, Siyuan Code establishes a one-to-one mapping from suitable strands to binary data through the codebook, enabling convergence to the theoretical optimal density of DNA storage. Actually, the in-vitro results demonstrate that Siyuan Code achieves a physical density of 41 exabytes per gram (EByte/g). This can be contextualized against the often-cited but highly idealized theoretical limit of 455 EByte/g (Church et al.33), which assumes 2 bits per nucleotide with zero overhead and thus represents a loose upper bound for an essentially unattainable scenario. Second, the encoding and decoding procedures of Siyuan Code are deterministic and efficient. In contrast to previous methods such as Fountain Code and Yin-yang Code, which depend on randomness and reject-and-retry cycles and suffer from random encoding and decoding failures, Siyuan Code operates without randomness or unbounded reject-and-retry cycles. The experiment shows Siyuan Code runs at the speed of the same level as full speed USB1.1 flash drive. Third, this efficiency enables Siyuan Code to adopt strict constraints that enhance single-strand accuracy. With higher accuracy, the copy number can be substantially reduced. The reduction in copy number can increase the physical density. Siyuan Code can perfectly retrieve all the data with a small copy number, which means that it is more robust with larger copy numbers. Fourth, Siyuan Code is a highly customizable approach that permits modification of its one-to-one mapping through user-defined rules. This versatility allows Siyuan Code to be fine-tuned for enhanced precision and to adapt to various conditions, including emerging synthesis or sequencing technologies and the incorporation of artificial nucleotides.
Siyuan Code also has certain limitations. First, control over global GC content in Siyuan Code is subject to the law of large numbers, meaning that while GC content may approach 50% on average, there is a small but non-zero probability of deviation from this ideal. The deviation probability is so small (as proved in Supplementary B.1.3 and shown by the experimental result in Supplementary Fig. 4) that it could be ignored to some extent and Siyuan Code works well with sufficient redundancy. To avoid ambiguity, we would like to clarify: only the global GC content, which tends to approach 1/2 as strand length increases, is governed by the law of large numbers. In contrast, the local GC content is actively constrained by Siyuan Code (as explained in Supplementary B.1.2). Alternatively, we recommend filtering strands after generation with Siyuan Code, which is more efficient than previous methods. This efficiency arises because rejecting sequences based solely on global GC content, which naturally tends toward , is statistically inexpensive, whereas other constraints (e.g., local motifs, homopolymers) do not resolve automatically and would otherwise require far more costly filtering. Crucially, Siyuan Code avoids the need to generate an exponentially large pool of unsuitable strands, making the process feasible within polynomial time even for long strands and stringent constraints. In contrast, earlier post-filtering techniques struggle with efficiency due to the vast number of unsuitable strands that need to be randomly generated and then discarded (as explained in Supplementary E.8). Second, Siyuan Code does not account for inter-strand chemical reactions. However, this limitation is not expected to significantly impact sequencing results, as such reactions are unlikely to interfere with the process. Also, it can be solved with minor revision of Siyuan Code in dynamic data structure. Finally, the example application of Siyuan Code is based on the error pattern described by MESA4 and therefore depends on the accuracy of that error model. However, other error models and simulators can be applied, and Siyuan Code is not inherently limited to a single error profile.
We admit that our testcases are not very large, but it is large enough to show the property and the advantage of Siyuan Code. The discussion of data scale can be found in Supplementary E.5.
We plan to explore the application of Siyuan Code encoding in in vivo settings, as well as its adaptation to emerging sequencing technologies such as Nanopore, in future work. However, these aspects will not be elaborated in the current paper, as its primary focus and core contribution lie in validating the advantages of Siyuan Code encoding through in vitro methods.
Methods
Basic Ideas and the Strawman
We argue that DNA storage encoding is, at its core, a constrained channel coding problem, demanding an information-theoretic solution. Constrained channel coding arises when a channel demonstrates reduced error rates under specific sequence patterns, thereby guiding code design toward strands that avoid error-prone motifs27.
Instead of developing an approach to transform binary strings into DNA sequences via complex encoding rules, we enumerate all DNA sequences suitable for DNA storage and build a one-to-one mapping between binary strings and these suitable sequences. By looking up the mapping, we can easily transform between binary strings and DNA sequences. This is inspired by enumerative coding in data compression in information theory29.
Figure 5 shows an illustration of the approach. Specifically, with a given length M, we enumerate all 4M possible DNA sequences of length M and filter suitable sequences. Supposing we get Q suitable sequences, we map each of them to the number from 0 to Q-1 (both inclusive). Consequently, we get a one-to-one mapping of DNA sequences of length M and the numbers from 0 to Q-1. We use these numbers to present N = ⌊log2Q⌋ binary bits. Note that since we build the mapping for an integer number of binary bits, not all Q states are used in the current method. A variation of the method can first transform binary data to Q-ary strings to fully utilize these Q states. As a result, we can get a DNA sequence of length M to present a binary string of length N.
Fig. 5. The basic idea and its improvements with the data structure.

A The strawman and the basic idea is that some suitable strands are picked from all the strands, and then mapped one-to-one to the integers from 1 to 2N. B When deriving the Fail Edge (the F function) of vertex v, the parent vertex is taken into consideration. Walk through the F edge from the parent vertex until the edge has a c child. Then the c child is the Fail of v. With the help of or Pc, O(1) time is needed to derive Fail Edge. The blue point is the vertex v. The red points are the relevant points. C When deriving the Press Edge (the Pc function) of vertex v, if V has the c child, the Pc of the vertex is the c child of vertex v. D When driving the Press Edge (the Pc function) of vertex v, if v does not have the c child, walk through Fail Edge until it has a c child. The Pc of v is the c child. With the help of F and Pc, the Press Edge can be efficiently derived. E The example of PC value calculation. The number of suitable strands starting from vertex v can be the sum of the numbers from all its immediate successors. F The principle of encoding and decoding. When the next DNA base from vertex v is unknown, calculate the numbers of its successors and see which successor contains the kth suitable strand.
The one-to-one mapping method is more straightforward than existing DNA coding methods. However, to reduce the offcut percentage in the mapping and satisfy DNA storage requirements, M must be sufficiently large. This requirement introduces several critical issues that hinder its use in storage applications. First, the number of permutations increases exponentially with M, and filtering suitable sequences from numerous candidates could require significant time. Second, storing the one-to-one mapping requires substantial storage space. Third, encoding and decoding methods require direct and inverse lookups in the mapping, which consume substantial time when the mapping is large. We thus propose Siyuan Code based on the one-to-one mapping method with several optimized designs to solve these issues.
Siyuan Code method
Siyuan Code Core Algorithm (Fig. 2a) originates from the one-to-one mapping concept and is optimized by the observation that although the number of suitable sequences can be large, the patterns of unsuitable sequences are simple and easy to represent and store. Siyuan Code leverages a Trie31 structure to store all patterns of unsuitable sequences, with which the one-to-one mapping of binary strings and suitable sequences can be derived via computation.
Patterns of unsuitable sequences
As stated previously, a suitable sequence must satisfy three rules.
No homopolymer longer than K;
GC content percentage between and ;
No undesired motifs in the sequence.
Accordingly, an unsuitable sequence should contain at least one subsequence matching one of the following patterns:
K + 1 repeated nucleotides, e.g., “AAAA” and “TTTT”;
Sequences of a given length (e.g., five) with GC content percentage less than GCmin or larger than GCmax (e.g., 20% and 80%);
Undesired motifs.
Most patterns are straightforward. For GC content percentage, we limit the pattern sequence length to five and relax the acceptable GC content percentage range to 20% to 80%. As shown and proved in Supplementary B.1.3, the method largely excludes permutations that cause high error rates due to extreme GC rates in sequences. For permutations not filtered by the pattern, the errors can be corrected via our error-correcting algorithm, as our experiments show in section 2.
Although the number of unsuitable sequence patterns is much smaller than that of suitable sequences, an efficient data structure is still required to store all patterns. As shown in Fig. 1C, Siyuan Code stores all unsuitable patterns in a Trie30 structure, where each pattern is represented by a path from the root to one of the annotated nodes. For example, in Fig. 1C, TTATA is an unsuitable subsequence stored in the Trie. The subsequence is presented by the node indicated by the path T, T, A, T, A, successively from the root. As an optimization, for two unsuitable sequences, A and B, if A is a prefix of B, we can remove B from the storage since all sequences containing B always contain A. Avoiding the existence of A will also eliminate the appearance of B in DNA sequences.
Automaton and dynamic programming
We build a Trie Automaton from the Trie to facilitate encoding and decoding. Specifically, in addition to the edges in the original Trie (tree edges), we calculate and add two additional edge types for each node, namely press edges and fail edges. We leave the automaton construction and proof in the appendix and emphasize its high efficiency in the appendix since the proof and analysis are exactly based on traditional methods.
With press edges and fail edges, we further facilitate encoding and decoding using dynamic programming. We define Path(v) as the sequence represented by the path from the root node to node v. We define childc(v) as the child node of v by following the edge (i.e., nucleotide) c. We define F(v) to be the node so that Path(F(v)) is the longest suffix of Path(v) in the tree. F(v) is the same as the traditional “fail link” or “suffix link” of the AC Algorithm32.
| 1 |
is defined to be the shortest sequence of F acting on the node v until it has child c. If such a sequence does not exist, return .
| 2 |
For any nucleotide c (i.e., c ∈ {ATCG}), we define Pc(v) to be the node that Path(Pc(v)) is the longest suffix of Path(v) + c in Trie. Pc(v) can be calculated with:
| 3 |
With fail edgeF( ⋅ ) and press edgePc( ⋅ ), we further calculate an auxiliary array for each node. Specifically, for each node v, Siyuan Code calculates PC(v, t), the number of paths of length t starting from node v without visiting any unsuitable node. An unsuitable node is a leaf of a Trie tree, which presents an unsuitable subsequence stored in the Trie. An unsuitable endpoint is a node that visits an unsuitable node pressing the right side primer from the end point node.
By dynamic programming and the Trie automation, we can calculate PC(v, r) for all nodes in the Trie and all 0 ≤ r ≤ m:
| 4 |
The first two cases are intuitive; the last case is based on an observation that a suitable path of length r > 0 from v can be seen as the combination of two parts: an edge following the nucleotide c and a path of length r − 1 from Pc(v). Thus, the number of suitable paths of length r > 0 from v can be obtained by enumerating the first edge (nucleotide c) and summing the number of suitable paths of length r − 1. Note that it does not matter whether Pc(v) is an suitable node, because PC(Pc(v), r − 1) = 0 if Pc(v) is unsuitable. A small revision to PC shown in the appendix can be taken in order to take the primer into consideration and the idea is the conditional counting of PC under the condition that the reverse primer is added to the sequence.
Encoding
In Siyuan Code, encoding transforms any binary input to DNA sequences using Trie Automaton and dynamic programming array (the path count array, i.e., PC(v, r)).
The core procedure in encoding is to find the K + 1th lexicographical smallest suitable sequence of length L. Let Enc(v, k, l) be the k + 1th smallest suitable path of length l from v.
| 5 |
where i, c ∈ {ATCG} and c is the largest nucleotide such that Pc(v) is a suitable node and ∑i<cPC(Pi(v), l − 1)≤k. The calculation is not difficult. At node v, we enumerate the next nucleotide in the sequence in lexicographical order. For a nucleotide i, there are PC(Pi(v), l − 1) suitable paths of length l − 1. In other words, there are PC(Pi(v), l − 1) suitable sequences of length l, starting with i from the node v. If the PC(Pi(v), l − 1) is larger than k, then i is the right nucleotide to pick; otherwise, we subtract PC(Pi(v), l − 1) from k and try the next nucleotide. The output of the encoder should be Enc(root, K, L) if there is no primer. A small revision to the process shown in the appendix can be taken in order to take the primer into consideration and the idea is the conditional counting finding the K + 1th under the condition that the forward primer and the reverse primer are added to the sequence.
Decoding
Decoding is the reverse process of encoding. Given a nucleotide sequence, it counts the number of suitable sequences lexicographically smaller than that sequence. Let Dec(v, s, l) be number of suitable sequences lexicographical smaller than the sequence s = (c1, c2, ⋯ , cl), ci ∈ {ATCG} from v.
| 6 |
where i ∈ {ATCG} and . The calculation is straightforward. At node v, all suitable sequences of length l that are smaller than s consist of two categories: those starting with c1 and those starting with i where i < c1. The number of sequences starting with c1 is calculated by where is the subsequence after the first c1. The number of sequences starting with nucleotide smaller than c1 is calculated by summing for i≤c1. The output of the decoder is Dec(root, S, L), where S is the given sequence and L is its length if there is no primer. A small revision to the process shown in the appendix can be taken in order to take the primer into consideration and the idea is the conditional counting under the condition that the forward primer and the reverse primer are added to the sequence.
Chunking and Redundancy
Before encoding, Siyuan Code treats the binary message as a binary sequence, which is first divided into chunks for DNA synthesis. To preserve the order of chunks, each chunk is attached with an index sequence indicating the chunk order, as shown in Fig. 2B.
In our in-silico experiments, each slice consists of 256-bit data, 16-bit index, and 8-bit SHA checksum. In our in-vitro experiments, each slice consists of 216-bit data, 16-bit index, and 24-bit SHA checksum. Although the encoding of Siyuan Code already excludes strands with high error rates during synthesis, storage and sequencing, errors might still occur with a non-zero probability. Thus, Siyuan Code leverages intra-slice error detection and inter-slice error correction to tolerate accidental errors. Note that the parameters above can be user-defined, so the index can be longer for larger files.
As shown in Supplementary Fig. 9, 8-bit checksum value is appended to each slice. The checksum covers both data and index so that any error in the slice will cause checksum failures. The intra-slice error detection helps the sequencing with more depth, and is used as a sign of whether the data in the slice can be considered corrupted for inter-slice error correction.
As errors in different slices can be considered independent, we adopt erasure code for inter-slice error correction. Taking Reed-Solomon code as an example, 12 redundant slices are added for every 100 slices. Note that only the data part is protected by the erasure code, and redundant slices has their own checksum covering their index and the parity data.
The complete procedures of encoding and decoding
As shown in Fig. 2B, the encoding procedure:
Data is cut into chunks;
Redundancy slices are added to support inter-slice error correction;
The index is inserted into slices to preserve slice orders;
Checksum is calculated for intra-slice error detection;
Each binary sequence is translated to DNA sequences.
The decoding procedure is basically the opposite:
Select strands and decode them into binary slices. Note that multiple duplicates of slices are kept to decrease the error rate;
Remove binary slices with the checksum failures;
Sort strands using the index;
Recover missing or corrupted slices using inter-slice error correction;
Get the stored data by concatenating the data part in order.
Statistics & reproducibility
No statistical method was used to predetermine sample size. No data were excluded from the analyses. The experiments were not randomized. The investigators were not blinded to allocation during experiments and outcome assessment. The core coding scheme presented in this work is a deterministic algorithm whose theoretical properties are established analytically. The in-vitro experiments (DNA synthesis, storage, and sequencing conducted by GenScript) serve as experimental validation of the coding scheme’s practical feasibility. All results are reproducible using the publicly available code and data (see Code Availability and Data Availability).
Reporting summary
Further information on research design is available in the Nature Portfolio Reporting Summary linked to this article.
Supplementary information
Source data
Acknowledgements
This work was supported by the National Key R&D Program of China (2023YFC2705504), and Shanghai Key Laboratory of Scalable Computing and Systems, Shanghai Jiao Tong University. This work was partially supported by SJTU Kunpeng&Ascend Center of Excellence. We appreciate Fei Wang for discussions on the basic knowledge of DNA synthesis and sequencing.
Author contributions
J.L. designed Siyuan Code (including the mapping algorithm). J.L. wrote the code of the software program of Siyuan Code. J.L. conducted simulation and data analysis. J.L. conducted the sequencing data analysis. J.L. drafted the manuscript. J.L. contacted GenScript for DNA synthesis and sequencing service. J.L. conducted the theoretical proof. M.D. contributed to the literature review in the early stage of this work. H.G. supervised the study, named the algorithm Siyuan Code, reviewed the manuscript, and provided revision suggestions. Z.Q. read the manuscript and provided revision suggestions. All authors read and approved the final manuscript.
Peer review
Peer review information
Nature Communications thanks the anonymous, reviewers for their contribution to the peer review of this work. A peer review file is available.
Funding
This work was partially supported by SJTU Kunpeng&Ascend Center of Excellence (to H.G.).
Data availability
The experiments are conducted and verified by a third-party organization (GenScript). The sequenced results (fastq) by GenScript with the stored files are publicly available at: https://github.com/DNASiyuanCode/SiyuanCodeSequencing and https://gitea.sjtu-edu.top/SiyuanCode/SiyuanCodeSequencing. The sequencing data have also been deposited in Zenodo https://doi.org/10.5281/zenodo.2135705944. The data and code can also be accessed via the Code Ocean capsule. Source data are provided with this paper.
Code availability
The Python implementation of Siyuan Code is publicly available at: https://github.com/DNASiyuanCode/SiyuanCode and https://gitea.sjtu-edu.top/SiyuanCode/SiyuanCode. The code has also been deposited in Code Ocean https://doi.org/10.24433/CO.4952245.v145.
Competing interests
The authors declare no competing interests.
Footnotes
Publisher’s note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Supplementary information
The online version contains supplementary material available at https://doi.org/10.1038/s41467-026-77024-y.
References
- 1.Wallace, M. Molecular cybernetics: The next step?. Kybernetes7, 265–268 (1978). [Google Scholar]
- 2.Extance, A. How DNA could store all the world’s data. Nature537 22–24 https://www.nature.com/articles/537022a (2016). [DOI] [PubMed]
- 3.Bancroft, C., Bowler, T., Bloom, B. & Clelland, C. T. Long-term storage of information in DNA. Science293, 1763–1765 (2001). [DOI] [PubMed] [Google Scholar]
- 4.Schwarz, M. et al. Mesa: automated assessment of synthetic dna fragments and simulation of dna synthesis, storage, sequencing and pcr errors. Bioinformatics36, 3322–3326 (2020). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 5.Ross, M. G. et al. Characterizing and measuring bias in sequence data. Genome Biol.14, 1–20 (2013). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 6.Reed, I. S. & Solomon, G. Polynomial codes over certain finite fields. J. Soc. Ind. Appl. Math.8, 300–304 (1960). [Google Scholar]
- 7.Demir, U. & Aktas, O. Raptor versus reed solomon forward error correction codes. In 2006 International Symposium on Computer Networks, 264–269 (IEEE, 2006).
- 8.Luby, M. Lt codes. In The 43rd Annual IEEE Symposium on Foundations of Computer Science, 2002. Proceedings, 271–271 (IEEE Computer Society, 2002).
- 9.Byers, J. W., Luby, M. & Mitzenmacher, M. A digital fountain approach to asynchronous reliable multicast. IEEE J. Sel. Areas Commun.20, 1528–1540 (2002). [Google Scholar]
- 10.MacKay, D. J. Fountain codes. IEE Proc. -Commun.152, 1062–1068 (2005). [Google Scholar]
- 11.Shokrollahi, A. Raptor codes. IEEE Trans. Inf. theory52, 2551–2567 (2006). [Google Scholar]
- 12.Goldman, N. et al. Towards practical, high-capacity, low-maintenance information storage in synthesized DNA. Nature494, 77–80 (2013). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 13.Grass, R. N., Heckel, R., Puddu, M., Paunescu, D. & Stark, W. J. Robust chemical preservation of digital information on dna in silica with error-correcting codes. Angew. Chem. Int. Ed.54, 2552–2555 (2015). [DOI] [PubMed] [Google Scholar]
- 14.Bornholt, J. et al. A dna-based archival storage system. In Proceedings of the Twenty-First International Conference on Architectural Support for Programming Languages and Operating Systems, 637–649 (2016). [DOI] [PMC free article] [PubMed]
- 15.Erlich, Y. & Zielinski, D. Dna fountain enables a robust and efficient storage architecture. Science355, 950–954 (2017). [DOI] [PubMed] [Google Scholar]
- 16.Ping, Z. et al. Towards practical and robust dna-based data archiving using the yin–yang codec system. Nat. Comput. Sci.2, 234–242 (2022). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 17.Buterez, D. Scaling up dna digital data storage by efficiently predicting dna hybridisation using deep learning. Sci. Rep.11, 20517 (2021). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 18.Blawat, M. et al. Forward error correction for DNA data storage. Procedia Comput. Sci.80, 1011–1022 (2016). [Google Scholar]
- 19.Yazdi, S. H. T. et al. Dna-based storage: Trends and methods. IEEE Trans. Mol., Biol. Multi-Scale Commun.1, 230–248 (2015). [Google Scholar]
- 20.Tabatabaei Yazdi, S., Yuan, Y., Ma, J., Zhao, H. & Milenkovic, O. A rewritable, random-access DNA-based storage system. Sci. Rep.5, 1–10 (2015). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 21.Schwartz, J. J., Lee, C. & Shendure, J. Accurate gene synthesis with tag-directed retrieval of sequence-verified dna molecules. Nat. methods9, 913–915 (2012). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 22.Erlich, Y. et al. Dna sudoku-harnessing high-throughput sequencing for multiplexed specimen analysis. Genome Res.19, 1243–1253 (2009). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 23.Kosuri, S. & Church, G. M. Large-scale de novo DNA synthesis: Technologies and applications. Nat. methods11, 499–507 (2014). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 24.Kosuri, S. et al. Scalable gene synthesis by selective amplification of dna pools from high-fidelity microchips. Nat. Biotechnol.28, 1295–1299 (2010). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 25.Eroshenko, N., Kosuri, S., Marblestone, A. H., Conway, N. & Church, G. M. Gene assembly from chip-synthesized oligonucleotides. Curr. Protoc. Chem. Biol.4, 1–17 (2012). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 26.Sampson, J., Jacobs, K., Yeager, M., Chanock, S. & Chatterjee, N. Efficient study design for next generation sequencing. Genet. Epidemiol.35, 269–277 (2011). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 27.Gallager, R.Information Theory and Reliable Communication. 10.1007/978-3-7091-2945-6 (Springer, Vienna, 1972). [DOI]
- 28.Bar-Lev, D., Orr, I., Sabary, O., Etzion, T. & Yaakobi, E. Scalable and robust DNA-based storage via coding theory and deep learning. Nat. Mach. Intell.7, 639–649 (2025). [Google Scholar]
- 29.Cover, T. M. & Thomas, J. A. Elements of Information Theory, 2nd edn (Wiley-Interscience, New York, 2006).
- 30.Fredkin, E. Trie memory. Commun. ACM3, 490–499 (1960). [Google Scholar]
- 31.Leiserson, C. E., Rivest, R. L., Cormen, T. H. & Stein, C.Introduction to algorithms, vol. 3 (MIT Press Cambridge, MA, USA, 1994).
- 32.Aho, A. V. & Corasick, M. J. Efficient string matching: An aid to bibliographic search. Commun. ACM18, 333–340 (1975). [Google Scholar]
- 33.Church, G. M., Gao, Y. & Kosuri, S. Next-generation digital information storage in dna. Science337, 1628–1628 (2012). [DOI] [PubMed] [Google Scholar]
- 34.Sat, B. et al. Programmed Cell Death in Escherichia coli: Some Antibiotics Can Trigger mazEFLethality. J. Bacteriol. 10.1128/jb.183.6.2041-2045.2001. Publisher: American Society for Microbiology (2001). [DOI] [PMC free article] [PubMed]
- 35.Moran, U., Phillips, R. & Milo, R. SnapShot: Key numbers in biology. Cell141, 1262–1262.e1 (2010). [DOI] [PubMed] [Google Scholar]
- 36.Blattner, F. R. et al. The complete genome sequence of Escherichia coli K-12. Science. 10.1126/science.277.5331.1453 (1997). [DOI] [PubMed]
- 37.Fredens, J. et al. Total synthesis of Escherichia coli with a recoded genome. Nature569, 514–518 (2019). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 38.Welzel, M. et al. DNA-Aeon provides flexible arithmetic coding for constraint adherence and error correction in DNA storage. Nat. Commun.14, 628 (2023). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 39.Lempel, A. & Ziv, J. Compression of two-dimensional data. IEEE Trans. Inf. theory32, 2–8 (1986). [Google Scholar]
- 40.Gasieniec, L., Karpinski, M., Plandowski, W. & Rytter, W. Efficient algorithms for lempel-ziv encoding. In Algorithm Theory-SWAT’96: 5th Scandinavian Workshop on Algorithm Theory Reykjavík, Iceland, July 3–5, 1996 Proceedings 5, 392–403 (Springer, 1996).
- 41.Wen, D. & Zhang, C. Universal multiplex PCR: A novel method of simultaneous amplification of multiple dna fragments. Plant Methods8, 1–9 (2012). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 42.LeProust, E. M. et al. Synthesis of high-quality libraries of long (150mer) oligonucleotides by a novel depurination controlled process. Nucleic Acids Res.38, 2522–2540 (2010). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 43.Zhang, J., Kobert, K., Flouri, T. & Stamatakis, A. Pear: A fast and accurate illumina paired-end read merger. Bioinformatics30, 614–620 (2014). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 44.Li, J., Dong, M., Qi, Z. & Guan, H. Siyuancodesequencing—sequencing data for towards density-optimal dna storage with practical bijective coding. https://zenodo.org/records/21357059. 10.5281/zenodo.21357059 (2026). [DOI] [PMC free article] [PubMed]
- 45.Li, J., Dong, M., Qi, Z. & Guan, H. Siyuan code—towards density-optimal dna storage with practical bijective coding. Code Ocean. https://codeocean.com/capsule/4952245/tree/v1. 10.24433/CO.4952245.v1 (2026). [DOI] [PMC free article] [PubMed]
Associated Data
This section collects any data citations, data availability statements, or supplementary materials included in this article.
Supplementary Materials
Data Availability Statement
The experiments are conducted and verified by a third-party organization (GenScript). The sequenced results (fastq) by GenScript with the stored files are publicly available at: https://github.com/DNASiyuanCode/SiyuanCodeSequencing and https://gitea.sjtu-edu.top/SiyuanCode/SiyuanCodeSequencing. The sequencing data have also been deposited in Zenodo https://doi.org/10.5281/zenodo.2135705944. The data and code can also be accessed via the Code Ocean capsule. Source data are provided with this paper.
The Python implementation of Siyuan Code is publicly available at: https://github.com/DNASiyuanCode/SiyuanCode and https://gitea.sjtu-edu.top/SiyuanCode/SiyuanCode. The code has also been deposited in Code Ocean https://doi.org/10.24433/CO.4952245.v145.
