← Back to Writing
NOV 08, 2026  ·  11 MIN READ  ·  SERIES: CRYPTOGRAPHIC & FINTECH GUARDKITS

RFC 4506 Binary Stellar XDR Proofs & Cross-Chunk SSE Secret Leak Guards

Two seemingly unrelated bugs share the exact same root cause: trusting unverified framing boundaries. One lives in cryptographic blockchain indexers; the other lives in streaming AI proxies.

1. Browser/Node Parity for Stellar Ledger Ancestry in Rust/Wasm

While merging Externalize-Labs/externalize#39 (commit a927da3), the challenge was exposing cryptographic proveAncestor verification via wasm-bindgen while keeping exact certified_seq boundary checks identical to the native Rust CLI.

Every Stellar LedgerHeader XDR frame must strictly validate 4-byte RFC 4506 padding, RFC 5528 record marks, and unbroken FIPS 180-4 SHA-256 previous_ledger_hash links — rejecting forged headers deterministically in under a millisecond. The standalone Rust library lives in soroban-xdr-proof-kit.

2. Stopping Split-Packet Secret Leaks in Streaming LLM Proxies

In Server-Sent Events (SSE) proxies, per-chunk regex guardrails fail silently whenever an API secret splits across two TCP frames — Chunk 1 ends with sk-proj-abc and Chunk 2 begins with 1234567890.... Reassembling complete W3C SSE events before DLP inspection closes this gap cleanly:

python // sse_frame_assembler.py (py-stream-and-billing-guard)
class SSEFrameAssembler:
    def __init__(self) -> None:
        self._buf = ""

    def feed(self, chunk: str) -> list[str]:
        self._buf += chunk.replace("\r\n", "\n")
        frames: list[str] = []
        while "\n\n" in self._buf:
            frame, self._buf = self._buf.split("\n\n", 1)
            frames.append(frame)
        return frames

3. Zero-Decimal Billing Math Without IEEE-754 Drift

In financial paths (such as multi-currency Stripe billing in BasedHardware/omi#23591), never divide minor units by 100.0 blindly: ISO-4217 defines 0-decimal (JPY), 2-decimal (USD), and 3-decimal (KWD) currencies. Integer divmod formatting eliminates both floating-point drift and 100× overcharging bugs.

PRODUCTION ENGINEERING SERVICES

Need a Custom MCP Server, Agent-Ready Python CLI, or Payment Security Audit?

I deliver deterministic TypeScript/Python MCP servers, --json + Undo/Redo CLI harnesses, and webhook/contract audits with automated unit tests and a 30-day warranty.