Skip to content

The footer is the last 96 bytes of a SEAM data file, at size - 96. It is the entry point for readers: it holds the file id, the position of the bloom and index frames, entry counts and timestamp bounds.

The footer is the one section that is not a frame. It is 64 bytes of plaintext followed by a 32-byte seal trailer, sealed with the AAD whose section byte is 0x03 (see AAD per object). The footer is encrypted, so its magic is visible only after authentication.

Offset Size Type Meaning
0 4 ascii magic "STC1"
4 2 u16 LE version, which holds the footer revision (1 to 5)
6 1 u8 layer: 1 hot/row, 2 columnar, 3 cold
7 1 u8 flags, see Footer flags
8 8 u64 LE file_id, must equal the id in the file name
16 8 u64 LE bloom_off
24 4 u32 LE bloom_len, the sealed frame length
28 8 u64 LE index_off
36 4 u32 LE index_len
40 8 u64 LE entries
48 8 u64 LE min_ts
56 8 u64 LE max_ts
Footer plaintext, 64 bytes, followed by the 32-byte seal trailer
  1. magic4 B"STC1"
  2. version2 B
  3. layer1 B
  4. flags1 B
  5. file_id8 B
  6. bloom_off8 B
  7. bloom_len4 B
  8. index_off8 B
  9. index_len4 B
  10. entries8 B
  11. min_ts8 B
  12. max_ts8 B
  13. trailer32 Bseal trailer
Flag Value Meaning
STATS 0x01 a stats frame exists
BLOOM_SKIP 0x02 the bloom has a skip tail
BLOOM_RANGES 0x04 the bloom has a ranged tail
BLOCK_COUNTS 0x08 stats carry per-block version codes

Details are on Footer flags.

The version field holds the footer’s revision. Only these flag combinations are legal (parse_footer, sst.rs:1501). STATS is optional in revisions 1 to 4 and required in revision 5.

Revision Name Legal flags Writer chooses it when Written by SEAM 1
1 plain no SKIP, no RANGES, no COUNTS none of the below no, read-only
2 bloom skip SKIP set, no RANGES, no COUNTS skip tags present no, read-only
3 codec no RANGES, no COUNTS (SKIP free) an LZ4 frame was written no, read-only
4 ranged bloom SKIP and RANGES set, no COUNTS at least one key was left out by a bloom-off prefix (SPEC V729) no, read-only
5 block counts STATS and COUNTS set; RANGES implies SKIP the file has a stats frame (default for every new file) yes

How a writer decides is on Choosing a footer revision.

  • version greater than 5 is NewerFormat("sst footer").
  • A magic mismatch or version 0 is Corrupt.
  • The file id must match.
  • bloom_off + bloom_len must be at most size - 96.
  • index_off + index_len must be at most size - 96.
  • index_off must be at least bloom_off.

Footer revisions 4 and 5 were introduced without a store-format bump (SPEC V729, V737), because the footer describes its own revision. Their files are readable by any build that knows them, and older builds fail with NewerFormat("sst footer"). Current builds write revision 5 for every file; revision 4 is read-only. See Compatibility rules.