Skip to main content
Host UK

TRIX Binary Container (RFC-0013)

Lethean R&D Labs
RFC Container Binary Go

TRIX is a generic binary container format for arbitrary payloads with JSON metadata. Protocol-agnostic, streaming-friendly, with customisable magic numbers. It doesn't care what's inside - it just wraps it consistently.

Features

Custom Magic Numbers

Applications define their own 4-byte identifiers: TRIX, STIM, SMSG

JSON Header

Extensible metadata: sigils applied, checksums, application-specific data

Streaming Friendly

Header length prefix enables reading metadata before loading payload

Protocol Agnostic

No assumptions about encryption, compression, or encoding

Installation

# Install CLI tool
go install github.com/Snider/Enchantrix/cmd/trix@latest

# Or use as library
go get github.com/Snider/Enchantrix

Usage

File Structure

┌─────────────────────────────────────┐
│ Magic Bytes (4 bytes)               │
├─────────────────────────────────────┤
│ Version (1 byte)                    │
├─────────────────────────────────────┤
│ Header Length (4 bytes BE)          │
├─────────────────────────────────────┤
│ JSON Header (variable)              │
│  - sigils applied                   │
│  - checksums                        │
│  - metadata                         │
├─────────────────────────────────────┤
│ Payload (encrypted/compressed data) │
└─────────────────────────────────────┘

CLI Usage

# Encode to .trix
echo "Hello" | trix encode --magic TRIX base64

# Decode from .trix
trix decode --input file.trix --magic TRIX base64

More from Lethean R&D Labs

View all projects →

Fancy helping out?

Spotted a bug? Got an idea? We'd love to hear from you.

Read the contributing guide →