# STAR — STreaming ARchives

STAR serializes key-value data pairs into a flat stream, with header metadata. Application profiles can define additional data validations and restrictions.

## Introduction

The STAR format (STreaming ARchive) stores sequences of key-value data pairs. The format is simple and flexible: a single required `$type` key in the header metadata lets applications associate additional data restrictions and validations for their own use-cases.

Compared to CAR (\[[car](#ref-car)\]): STAR is not content addressed and has no format-level CIDs (\[[cid](#ref-cid)\]), contains data pairs instead of individual blocks, and makes the order of pairs explicitly significant. STAR can losslessly encode any CAR with less than one byte per block overhead, see Application Profiles below for an example.

## Format

A STAR file begins with four magic bytes, followed by a length-prefixed metadata map with a `$type` key, and then zero or more data pairs. Each pair consists of two length-prefixed byte sequences, "key" and "value". The key's length prefix is shifted up by 1, and the entire archive is terminated by a null byte.

```
|------ header ------| |-------- data pairs --------| | end |
[ magic | len | meta ] [ len+1 | key | len | val ] *  [ NUL ]
```

### Magic

The magic bytes are `0x2A 0x6C 0x01 0x00`: ascii `***l**` ("star lite"), a fixed version **1**, and a null byte to make four. STAR's magic bytes are always distinct from the first bytes of a CAR (\[[car](#ref-car)\]) file.

### Length-prefixing

Length prefixes in STAR are encoded as unsigned variable-length integers (\[[varint](#ref-varint)\]). The integer usually specifies the number of following bytes to read, not including the integer itself. Length prefixes must not contain superfluous trailing `0x00` bytes: the only number that can end in `0x00` is `0`.

Length prefixes for data pair keys shifted up by 1 as described in **Data pairs**.

### Metadata

The header metadata must be a DRISL-encoded (\[[drisl](#ref-drisl)\]) map with the exact size of its length prefix. The map's only reserved and required key is `"$type"`, whose value must be a string. The meaning of `$type` is described below under Application Profiles. Arbitrary DRISL metadata can be included at other keys in the map.

### Data pairs

Each data pair is a length-prefixed key of bytes followed by a length-prefixed value of bytes. Exactly one key and one value must be present in each data pair. Duplicate keys and empty keys and values are permitted. Pairs are ordered: serializers and parsers must emit data pairs in the exact order they are provided/encoded.

Key length prefixes are shifted up by 1 to disambiguate the archive's terminating null byte (0) from the empty key (length = 0). That is, the serialized length prefix of a key with `length = N` is a varint with value `N + 1`.

### Terminating null byte

The archive must be terminated by a NULL byte (`0x00`) after the end of the final data pair, or after the header metadata if no data pairs are present. Exactly one terminating null byte is required, and it must be the final byte of the entire archive.

## Additional considerations

Any parser error must be treated as fatal for the entire archive.

There are no data-pair-level integrity checks in STAR: See Application Profiles below for common approaches to assuring archive integrity.

STAR encoding is deterministic where data pair contents and ordering is deterministic. Note that many common LEB128-style varint parsers are not compliant with STAR's \[[varint](#ref-varint)\] restrictions, for example by accepting superfluous trailing `0x00` bytes without error. Non-strict varint parsing can lead to [security issues](https://www.inkandswitch.com/tangents/bijou64/#:~:text=So%20What) where deterministic archive encoding is depended upon.

Like CAR (\[[car](#ref-car)\]), no format-level size limits are defined for header metadata or data-pair keys and values. However, parsers may impose reasonable maximums and are encouraged to provide configurable lower limits.

## Application profiles

TODO

## Not stable yet!

STAR is a new format, and while it has applications [headed for production _soon_,](github.com/bluesky-social/proposals/pull/114) be prepared for breaking spec changes while its DASL [maturity](/governance.html) remains _Hot New Stuff_. Additional backgound, resources, and open questions:

-   [STAR-lite](https://tangled.org/microcosm.blue/star/tree/main/v0-star/star-lite), an earlier version of this format specifically for atproto public data repository exports. It is not part of the atproto specs but is actively used on the network, to be superseded by STAR.
    
-   [Initial public STAR feedback](https://bsky.app/profile/bad-example.com/post/3mwc5n4f4gk24) of the first attempt to adapt STAR-lite for atproto spaces, leading to its current flexible shape.
    
-   [Proposal for STAR](https://tangled.org/dasl.ing/dasl.ing/issues/21), tangled issue introducing STAR to DASL.
    
-   [Presentation slides](https://docs.google.com/presentation/d/14awrvqCJCn_FZPF0gW-9ybc2kWdPfO2RDYCet0vOWWU/) introducing STAR at the October 2026 CID Congress.
    
-   [Interop test vectors](https://tangled.org/microcosm.blue/star/tree/interop/interop) for implementors.
    
-   _Soon: a link to a summary of questions still to be settled, when that exists._
    

## Appendix: Media Type

The media type for STAR is `application/vnd.dasl.star`.

The conventional file extension for STAR is `.star`.

## References

<dfn id="ref-car">\[car\]</dfn>

Robin Berjon & Juan Caballero. [CAR — Content-Addressable aRchives](https://dasl.ing/car.html). 2026-11-02. URL: [https://dasl.ing/car.html](https://dasl.ing/car.html)

<dfn id="ref-cid">\[cid\]</dfn>

Robin Berjon & Juan Caballero. [CID — Content Identifiers](https://dasl.ing/cid.html). 2026-11-02. URL: [https://dasl.ing/cid.html](https://dasl.ing/cid.html)

<dfn id="ref-drisl">\[drisl\]</dfn>

Robin Berjon & Juan Caballero. [DRISL — Deterministic Representation for Interoperable Structures & Links](https://dasl.ing/drisl.html). 2026-11-02. URL: [https://dasl.ing/drisl.html](https://dasl.ing/drisl.html)

<dfn id="ref-varint">\[varint\]</dfn>

[unsigned varint](https://github.com/multiformats/unsigned-varint). URL: [https://github.com/multiformats/unsigned-varint](https://github.com/multiformats/unsigned-varint)