xsp
The XAP Stream Protocol frame codec — a self-describing, self-delimiting frame [version · type · stream-id · principal-DID · flags · len · payload] that carries XAP over any transport. The payload is opaque bytes and the canonical binary encoding dogfoods CX data-bin. Identity is orthogonal to transport: the principal field names a DID, while verification and authorization remain separate concerns.
xsp:encode
[$xsp:encode] -> bytes — Encode a [frame …] element into wire bytes, data-bin-encoding the payload by default or UTF-8-encoding it when binary=false.
xsp:decode
[$xsp:decode] -> element — Decode one frame at offset 0 into a [frame …] element whose consumed attr is the total frame length so a reader can advance to the next frame.
xsp:decode-all
[$xsp:decode-all] -> element — Decode a buffer of concatenated frames into a [frames …] element whose children are the parsed [frame …] elements, with any trailing partial frame as a [remainder …] child.