Bifaci Protocol
Project runtime frame contract over CBOR encoding
Frame Contract
Bifaci is a Latin term meaning "two-face" or "two-sided", pronounced BYE-FAH-CHEE.
Protocol version is 2. Frames are CBOR maps keyed by integers. Common keys include version, type, id, seq, payload, cap, stream metadata, and checksum fields.
Wire framing: 4-byte big-endian length prefix, then CBOR payload bytes.
Frame Types
Supported frame types include Hello, Req, Chunk, End, Log, Err, Heartbeat, StreamStart, StreamEnd, RelayNotify, RelayState.
Legacy single-response Res frame type is removed.
Lifecycle
- HELLO negotiates limits.
- REQ starts a request flow.
- STREAM_START + CHUNK + STREAM_END carry stream payloads.
- END closes the request flow.
- ERR reports protocol/runtime failures.
Identity and Integrity
Identity is mandatory at manifest level via CAP_IDENTITY. Relay switch performs nonce-based identity verification across the relay chain.
Chunk payload checksums are supported via per-chunk checksum fields.