2. Open-STRM Specification SPEC v1.0

2.1 Specification Overview

Open-STRM is the open interoperability specification that serves as the communication standard for the RelayStream ecosystem. It does not define how underlying networks manage consensus or raw bytes. Instead, it defines a standard JSON representation for media identity, metadata, storage references, processing history, playback manifests, and access rules.

2.2 Open-STRM Schema Specification
Field Name Type Required Description
asset_id String Yes Unique global identifier formatted as relaystream.media.<id>.
title String Yes Human-readable title of the media asset.
owner String Yes Wallet address or DID establishing ownership.
metadata Object Yes Key-value pairs describing runtime, type, language, and custom attributes.
storage Array<String> Yes Active storage providers preserving the media (e.g., "Storj", "Filecoin", "Sia").
playback Object Yes Playback manifest information (e.g., HLS/DASH manifest routes).
verification Object Yes Integrity verification status, signature hashes, and validation state.
2.3 Reference Open-STRM Payload
OPEN-STRM PAYLOAD SCHEME JSON
{
  "asset_id": "relaystream.media.001",
  "title": "Example Media Asset",
  "owner": "0x71C7656EC7ab88b098defB751B7401B5f6d8976F",
  "metadata": {
    "type": "video",
    "runtime": "42m",
    "language": "en",
    "resolution": "1080p",
    "codec": "h264"
  },
  "storage": [
    "Storj",
    "Sia",
    "Filecoin"
  ],
  "playback": {
    "manifest": "https://gateway.relaystream.online/manifests/index.m3u8",
    "protocol": "HLS"
  },
  "verification": {
    "status": "verified",
    "signature": "0x3f...8a",
    "checksum": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
  }
}
2.4 Parsing and Validating Open-STRM Payload
VALIDATION ENGINE SCRIPT TypeScript
import { OpenSTRMRecord, validateRecord } from '@relaystream/strm-validator';

const rawPayload = `{
  "asset_id": "relaystream.media.001",
  "title": "Example Media Asset",
  "owner": "0x71C7656EC7ab88b098defB751B7401B5f6d8976F",
  "metadata": { "type": "video", "runtime": "42m", "language": "en" },
  "storage": ["Storj", "Sia", "Filecoin"],
  "playback": { "manifest": "index.m3u8" },
  "verification": { "status": "verified" }
}`;

try {
  const record: OpenSTRMRecord = JSON.parse(rawPayload);
  const isValid = validateRecord(record);
  
  if (isValid) {
    console.log(`Validated STRM Record: ${record.asset_id}`);
    console.log(`Storage Providers: ${record.storage.join(', ')}`);
  }
} catch (error) {
  console.error('Invalid Open-STRM payload structure:', error);
}