> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xdnalabs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Writing

> How digital data is translated into DNA molecules using combinatorial assembly  scalable, cost-efficient, and structured for in-place compute.

Writing digital data into DNA requires translating bits into molecular form. Instead of synthesizing one long strand per data sequence, xDNA Labs uses a combinatorial assembly method that is significantly more scalable and efficient.

## From Data to Codewords

Information is divided into symbols. Each symbol is mapped to a fixed-length **codeword** a bit string designed with uniform properties such as a constant number of ones and zeros. This ensures:

* Simplified error handling
* High signal-to-noise ratios during retrieval
* Consistent density across the archive

## Combinatorial Identifiers

Rather than creating each codeword base-by-base, xDNA constructs molecules called **identifiers**. An identifier is built by assembling prefabricated DNA components layer by layer.

<CardGroup cols={2}>
  <Card title="Layer-by-layer assembly" icon="layer-group">
    Each layer contains multiple possible DNA components. One component is
    chosen from each layer and ligated together the result is a unique sequence
    that encodes a specific part of the dataset.
  </Card>

  <Card title="Exponential address space" icon="infinity">
    With only a few hundred components divided into layers, it is possible to
    assemble trillions of distinct identifiers exponential expansion with
    simple, cost-effective chemistry.
  </Card>
</CardGroup>

## Trie-like Structure

The identifiers naturally form a **trie** a tree-like data structure where each path from root to leaf corresponds to a sequence of components that encodes a codeword. This organization makes it possible to later traverse and query the archive using biochemical operations rather than digital scanning.

<Note>
  The trie structure is what makes in-DNA compute possible. It turns the archive
  into an associative memory that can be searched and filtered chemically,
  without reading the full dataset.
</Note>

## Writing Process

<Steps>
  <Step title="Preprocess & encode">
    Digital data is preprocessed and mapped into codewords.
  </Step>

  <Step title="Assign identifiers">
    Each bit in a codeword is assigned to a unique identifier within the
    combinatorial address space.
  </Step>

  <Step title="Assemble molecules">
    Identifiers are assembled from DNA components using chemical ligation in
    parallel reactions.
  </Step>

  <Step title="Archive the library">
    The resulting DNA library contains millions of identifiers, each
    representing a portion of the dataset stable, inert, and ready for storage
    or computation.
  </Step>
</Steps>
