Lace / spec

Lace-010 ยท Records

Tags: record, stored-format

Purpose

Distributed data needs identity that follows the bytes, plus enough structure to make those bytes indexable, versioned, and attributable after they arrive from another source. Lace records provide that unit: canonical bytes with stable hashes, optional coordinates and headers, and optional verifier signatures. Stored records have three content forms: Blob record for bytes, Plex record for coordinate-bearing record versions, and Seal record for a verifier signature over a Plex record.

This document is for record implementors and higher-layer implementors that consume record facts. After reading it, an implementor should be able to parse, validate, store, hash, sign, and index the current H3 record forms.

Defines

Blob records, Plex records, Seal records, header rules, TAI, coordinate header validation, thin format, trailer-hash transport form, and examples.

Every stored record starts with a markline

๐Ÿ–ง: <hash-text>

<hash-text> is T.<b64a>.H3, where T is B, P, or S. The B64A payload is the BLAKE3-256 digest of the canonical payload after the markline LF.

Implementations MUST verify that the markline type matches the record type and that the digest matches the canonical payload.

Shared header rules keep bytes canonical

Header syntax is <Name>: <value>.

Implementations MUST enforce these rules:

Blob records carry raw bytes

๐Ÿ–ง: B.<digest>.H3
Data-Length: <len>

<data>

The Blob record canonical payload is Data-Length, a blank line, and exactly <len> data bytes.

Blob record rules:

Blob data is opaque and may contain any bytes.

Plex records attach coordinates and headers to a Blob record

๐Ÿ–ง: P.<digest>.H3
Group: <group>
App: <app>
Name: <name>
TAI: <tai>
[Extra headers]*
๐Ÿ–ง: B.<digest>.H3
Data-Length: <len>

<data>

The Plex record canonical payload is all Plex headers followed by the full embedded Blob record.

Plex record rules:

A Plex record is a coordinate-bearing record version. It can produce claims only when a policy or profile explicitly allows unsigned Plex-record claims.

Seal records sign a Plex record

๐Ÿ–ง: S.<digest>.H3
Signed-By: <verifier>
Signature: <signature>
๐Ÿ–ง: P.<digest>.H3
Group: <group>
App: <app>
Name: <name>
TAI: <tai>
[Extra headers]*
๐Ÿ–ง: B.<digest>.H3
Data-Length: <len>

<data>

The Seal record canonical payload is Signed-By, Signature, and the full embedded Plex record.

Seal record rules:

A Seal record proves that its verifier signed one record version. It does not by itself prove that the record is authorized or selected by any policy.

TAI gives record versions a sortable time

TAI format is seconds:subseconds: 10 decimal seconds digits, :, then 9 decimal nanosecond digits.

The seconds field counts SI seconds on the TAI time scale from epoch 1970-01-01T00:00:00 TAI. Implementations MUST NOT reinterpret TAI as local time or UTC text. TAI is version-ordering data; it is not proof that a signer observed that time.

Implementations MUST reject any other TAI shape.

Coordinate headers define an indexed record coordinate

Group, App, and Name are coordinate fields used for indexing and selection; they are not record identity. Many records may share the same coordinate. The record hash is the durable identity.

Group is a root-to-leaf path.

Group rules:

App rules:

Name rules:

Extra headers are sorted after required headers

Extra headers MUST be sorted by header name using bytewise ascending order. Same-name extra headers MUST be consecutive and MUST preserve user-defined order.

A Plex record MUST contain at most 512 extra headers.

Reserved extra header names are: Data-Length, Group, App, Name, TAI, Signed-By, Signature, ๐Ÿ–ง, and โ‹ฏ๐Ÿ–ง.

A Plex record extra header whose name is +Link or ends with +Link is a record-link header. Record-link headers are ordinary extra headers: they are sorted, hash-significant, and subject to all extra header rules.

A well-formed record-link header value is:

<link-data> <target-hash>

Rules:

Malformed record-link headers do not invalidate a record unless they violate ordinary header rules. They remain ordinary extra headers. Layers that index record-link headers MUST ignore malformed values. A target hash whose record format is unsupported by the local store MAY be indexed as a link target, but it MUST NOT become Have unless received bytes validate under a supported record definition.

Examples:

+Link: evidence S.EXAMPLE_SEAL_HASH.H3
Chunk+Link: 0..33554432 B.EXAMPLE_BLOB_HASH.H3

Thin format stores references to known inner records

Thin Plex records store the Plex markline, Plex record headers, and embedded Blob markline. Thin Seal records store the Seal markline, Signed-By, Signature, and embedded Plex markline.

Thin records are storage and transfer shortcuts. Implementations MUST reconstruct full record bytes before hash verification.

Trailer-hash format supports streaming output

Trailer-hash format is a transport form for bytes whose final hash is known only after payload has been written.

Open marker:

โ‹ฏ๐Ÿ–ง: <type>[ <coordinate>]

Close marker:

โ‹ฏ๐Ÿ–ง: <hash>

Rules:

Examples

Hash strings are symbolic; real records use BLAKE3 digests of the canonical payload bytes.

Blob record:

๐Ÿ–ง: B.EXAMPLE_BLOB_HASH.H3
Data-Length: 11

hello room7

Plex record:

๐Ÿ–ง: P.EXAMPLE_PLEX_HASH.H3
Group: eu/lab
App: chat
Name: room-7/123
TAI: 1640995200:000000000
Content-Type: text/plain
๐Ÿ–ง: B.EXAMPLE_BLOB_HASH.H3
Data-Length: 11

hello room7

Seal record:

๐Ÿ–ง: S.EXAMPLE_SEAL_HASH.H3
Signed-By: V.EXAMPLE_VERIFIER.H3
Signature: EXAMPLE_SIGNATURE
๐Ÿ–ง: P.EXAMPLE_PLEX_HASH.H3
Group: eu/lab
App: chat
Name: room-7/123
TAI: 1640995200:000000000
Content-Type: text/plain
๐Ÿ–ง: B.EXAMPLE_BLOB_HASH.H3
Data-Length: 11

hello room7

Common rejection examples

Implementations reject records with CRLF line endings, non-NFC header text, Data-Length: 01, missing required Plex record headers, invalid Group paths such as /eu, eu/, eu//lab, eu/./lab, or eu/lab#x, extra headers out of order, mismatched markline digest, invalid Seal-record signature, or thin record whose inner hash cannot be reconstructed.