← All posts

RoadID Persistence & PS-SHA∞ Technical Analysis

Grok · 2026-03-29 · blackroad.io

RoadID Persistence & PS-SHA∞ Technical Analysis


Source: Grok (xAI) analysis, 2026-03-29

RoadID persistence in BlackRoad OS relies on a custom append-only journaled memory system secured by PS-SHA∞ (Persistent Secure SHA), which functions as a lightweight hash-chain for tamper-evident, cryptographically verifiable state. This mechanism powers the "never forgets unless you tell it to" behavior, enabling sovereign, portable AI identities that accumulate context indefinitely while remaining exportable as JSON.

Core Implementation Details

1. Journal-Based Append-Only Storage

  • Each agent (or RoadID-linked identity) maintains its own journal file at .blackroad/memory/{agent_id}.journal

  • The journal uses JSON Lines format (one JSON object per line) for efficient streaming, appending, and recovery

  • Every memory write creates a commit containing:

  • - Timestamp (ts)
    - Key-value pair (the actual data/context)
    - Cryptographic digest generated via ps_sha()
  • Writes are flushed to disk immediately (_flush()) for durability, while an in-memory cache (_store) provides fast reads

  • Restore() replays the entire journal from disk to reconstruct state on startup or migration — ensuring persistence across restarts, node moves, or exports
  • This design resembles lightweight event sourcing or audit logs (similar in spirit to blockchain ledgers or Git's object model, but far simpler and local-first).

    2. PS-SHA∞: The Recursive "Hash Ladder"

    The cryptographic backbone is a custom function that applies SHA-256 iteratively (a "hash ladder") rather than a single hash or full linked chain of previous digests:

    ``python
    import hashlib
    import json
    import time
    from pathlib import Path
    from typing import Any, Optional

    JOURNAL_DIR = Path(".blackroad/memory")
    JOURNAL_DIR.mkdir(parents=True, exist_ok=True)

    def ps_sha(data: str, depth: int = 3) -> str:
    """Recursive hash ladder for memory integrity."""
    h = data
    for _ in range(depth):
    h = hashlib.sha256(h.encode()).hexdigest()
    return h
    `

  • How it works: Start with raw data (or serialized commit), then repeatedly hash the output depth times (default 3). This produces a fixed-size digest that is computationally expensive to reverse-engineer or tamper with.

  • Purpose: Creates a tamper-evident digest for each commit. Multiple iterations strengthen resistance to certain preimage or collision attacks in this context.

  • Chain Aspect: While not a strict Merkle tree or classic blockchain (where each block explicitly includes the prior hash), the append-only nature + per-commit digests creates an implicit chain. Verifying the full journal involves replaying and re-computing digests to confirm integrity ("chain active" status mentioned on dashboards).

  • In related agent descriptions (e.g., Lucidia QI), it's called a "PS-SHA append-only memory chain" where "every thought is hashed, linked, and permanent," with full-text indexed recall on top.
  • 3. Integration with RoadID and Agents

  • RoadID acts as the overarching portable identity that references or owns this memory journal

  • CECE (and other fleet agents like Cecilia, Lucidia, etc.) tie into the same system: interactions generate commits, building relationships and trust via cryptographic proofs

  • Memory feeds RAG-style retrieval, embeddings, and FTS5 search for coherent recall across RoadChat, Search, Tutor, and multi-agent workflows

  • Export/Import: The journal exports as JSON, allowing full RoadID migration to any compatible node without loss of history

  • Verification: On import or restore, the system re-computes PS-SHA digests to validate the chain
  • 4. Broader Architectural Context

  • Trinary Logic Substrate: BlackRoad OS pairs the memory system with conceptual trinary logic (1/0/-1) and paraconsistent reasoning (handling contradictions without explosion). A simple equilibrium mechanism (Z := yx - w; minimize |Z| for adaptation) is mentioned in architecture notes.

  • Edge-First Execution: Runs on the Raspberry Pi + Hailo fleet with Ollama for inference. Journals are lightweight and local (SQLite/KV layers also referenced).

  • Self-Healing Mesh: Ensures journals and identities remain accessible across nodes.

  • Related repos: blackroad-agents (CeCe dynamic planner), blackroad-os-roadchain` (chain-focused implementation), agent OS cores.
  • Strengths and Sovereign Advantages

  • Tamper Resistance & Auditability: PS-SHA digests + append-only journals provide cryptographic proofs for every interaction, supporting verifiable provenance without external blockchains

  • Portability: JSON export makes RoadID truly "travels everywhere" while keeping data owned by the user

  • Efficiency: Journal replay and in-memory caching suit modest edge hardware; no heavy consensus needed since it's single-user or small-mesh sovereign

  • Privacy: Everything stays local; no mandatory external training data feeds
  • Limitations (as a Young Project)

  • Public details are high-level or demo-oriented. Depth on collision resistance, exact linking between commits, pruning/"forget" mechanics, or scaling to very large journals is not extensively documented publicly.

  • PS-SHA∞ is a custom construction — effective for integrity in a trusted local environment but not a formally standardized primitive like full Merkle trees or BLS signatures.

  • Implementation evolves rapidly under solo-founder development.
  • Summary

    RoadID persistence combines simple append-only journaling with iterative SHA-256 hashing for a practical, sovereign "memory blockchain-lite" that prioritizes user control, portability, and verifiability on edge hardware. It directly supports BlackRoad's goal of accumulative, owned AI identities without cloud silos.


    Part of BlackRoad OS — sovereign AI on your hardware.