# Strata

### What Strata is

Strata is a deterministic binary data format with canonical encoding.\
Every value has exactly one valid binary representation; identical logical values must produce identical bytes across all implementations.

It is a protocol and specification for representing structured data in a way that is reproducible across implementations, platforms, and time.&#x20;

***

### Why it exists

Most data formats allow multiple representations of the same logical value.

* JSON objects can order keys differently.
* Protocol Buffers permit field reordering.
* MessagePack supports multiple integer encodings.

These formats prioritize flexibility, evolution, and developer convenience over byte-level determinism.

This flexibility is a liability when correctness depends on exact bytes: content addressing, cryptographic hashing, digital signatures, and distributed consensus.

Strata eliminates representational ambiguity by design.\
If two values are logically equal, their encodings are byte-identical.

***

### Core guarantees

\
**Canonical encoding.** \
Every value has exactly one valid binary representation.\
\
**Stable hashing.** \
Hashes are computed over canonical encoded bytes. The encoding *is* the canonical form.\
\
**Cross-language determinism.** \
Independent implementations in different languages produce identical bytes for identical input.\
\
**Strict validation.** \
Non-canonical encodings are rejected during canonical encoding, not silently accepted.

***

### Explicit non-goals

Strata Core Binary (.scb) is intentionally not optimized for the following:

* Human readability.
* Compression ratio.
* Schema evolution.

It does not support optional fields, default values, backward-compatible changes, or floating-point numbers.

These constraints are deliberate. \
Flexibility in representation introduces ambiguity.  \
Strata chooses precision over convenience.

Strata Text (.st) exists as a human-readable authoring format that compiles into canonical Strata Core Binary.

***

### Value model

Strata supports a minimal, fixed set of value types, each with an unambiguous binary representation:

**null** <mark style="color:$info;">- absence of value</mark>\
**bool** <mark style="color:$info;">- true or false</mark>\
**int** <mark style="color:$info;">- signed 64-bit integers</mark>\
**bytes** <mark style="color:$info;">- arbitrary byte sequences</mark>\
**string** <mark style="color:$info;">- UTF-8 text</mark>\
**list** <mark style="color:$info;">- ordered sequences</mark>\
**map** <mark style="color:$info;">- key-value pairs with string keys, sorted by UTF-8 byte order</mark>

There are no floats, no optional types, and no undefined behavior.

***

### Stability & Versioning

Strata is versioned. \
Once a version is finalized, its encoding rules are frozen.&#x20;

There are no deprecations, no migrations, and no silent changes within a version line.

Code written against a finalized Strata version will produce identical bytes and hashes for the lifetime of that version line.\
This is a requirement, not a goal.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://strata.emagjby.com/home.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
