Skip to Content
DocsKeywordsMagic Bytes & Constants

Magic Bytes & Constants

Magic Bytes

Every Vein binary starts with the magic bytes 0x4C, 0x44 — the ASCII characters "LD" (short for Lode Data).

Offset 0: 0x4C ('L') Offset 1: 0x44 ('D')

The decoder validates these bytes before attempting to parse. If they don’t match, it throws:

Invalid magic: expected 0x4C44 ("LD"), got 0x<actual>

Header Constants

ConstantValueDescription
MAGIC[0]0x4CFirst magic byte ('L')
MAGIC[1]0x44Second magic byte ('D')
HEADER_SIZE4Total header size: magic(2) + version(1) + count(1)
FIELD_HEADER_SIZE4Per-field header: field_id(1) + type_tag(1) + length(2)

MIME Type

application/x-vein

Used as the Content-Type when serving Vein binaries over HTTP.

Fingerprint Header

X-Lode-Fingerprint: <64-char hex SHA-256>

Custom HTTP header for transmitting the fingerprint alongside a Vein binary response.

Token Limit Constants

Used in prompt contracts:

ConstantValueDescription
DEFAULT_TOKEN_LIMIT1,000,000Default token budget per request
MAX_TOKEN_LIMIT10,000,000Hard ceiling for any request

File Extensions

ExtensionDescription
.lodeLODE schema file (JSON)
.veinCompiled Vein binary
.jsonSource data (input to compile)
Last updated on