About LODE
LODE is a deterministic binary serialization language used at the core of the StackNet project.
What is LODE?
LODE defines typed schemas that compile source objects into Vein — a compact binary wire format with cryptographic fingerprinting built in. Every LODE-encoded payload is reproducible, hashable, and verifiable without ambiguity.
The language is designed for systems where trust in data integrity is non-negotiable: distributed registries, peer-to-peer networks, and inference pipelines where payloads must be verified at every hop.
Design Principles
Determinism over flexibility. There is exactly one valid binary encoding for any given source object. No optional whitespace, no alternate encodings, no ambiguity.
Verification as a first-class operation. Fingerprinting and verification are not add-ons. They are core language operations with the same status as encoding and decoding.
Forward compatibility. Schemas evolve. A consumer built against v1 must be able to read a v2 payload without crashing. Unknown fields are skipped, never rejected.
Minimal surface area. Four types, five operations, one wire format. LODE intentionally does not support nested structures, unions, enums, or computed fields.
The Name
LODE refers to a rich source or vein of something valuable — fitting for a language whose binary format is called Vein. A lode is the origin; the vein is what carries it.
Core Components
| Component | Purpose |
|---|---|
| Schema | JSON definition of structure — field names, types, IDs |
| Encoder | Compiles source objects into Vein binary (compile) |
| Decoder | Reads Vein binary back into objects (decode) |
| Fingerprint | Deterministic SHA-256 hash via canonicalization |
| Verify | End-to-end integrity check: decode + fingerprint + compare |
| lodec | CLI compiler with compile, decode, fingerprint, verify, diff |
Use in StackNet
LODE is the encoding format for model layer distribution in the StackNet registry. Each node serves model layer definitions as Vein binaries with fingerprint headers, enabling clients to cache and verify layer data without trusting any single node.
The prompt contract system extends this trust model to inference requests — every request is wrapped in a contract that establishes a token budget and validates affordability before execution.
Technical Details
- Runtime: Bun
- Dependencies: Zero (uses only Web APIs and Bun built-ins)
- Package:
@stacknet/lode - Binary:
lodec - Wire format: Vein — 4-byte header + typed fields, big-endian
- Hash: SHA-256 over canonicalized JSON
- Types:
string,bool,string[],map<string,string> - Field IDs: 1–255 (single byte)
License
LODE is part of the StackNet project.