Binary Encoding for the Message Relay Interface
Open Protocol Labs (info@opl.dev)
Authors: David Case (dcase@opl.dev)
Abstract
An alternative wire format for the BRC-33 message relay interface: the same requests and responses as DAG-CBOR instead of JSON, with the message body and identity keys as byte strings.
Motivation
Text encoding makes binary data larger, and the growth compounds when a text-encoded payload itself carries binary encoded as text.
Specification
The endpoints, authentication and semantics are those of BRC-33. A request with Content-Type: application/cbor is answered in CBOR; a JSON request is answered in JSON. Each JSON object becomes a DAG-CBOR map with the same keys.
POST /sendMessage
{ message: { recipient: bstr(33), messageBox: tstr, body: bstr } }
{ status: tstr, messageId: tstr }
POST /listMessages
{ messageBox: tstr }
{ status: tstr, messages: [ { messageId: tstr, body: bstr, sender: bstr(33) } ] }
POST /acknowledgeMessage
{ messageIds: [ tstr ] }
{ status: tstr }
recipient and sender are 33-byte compressed identity keys. body is opaque bytes, delivered as submitted.
References
Last updated
Was this helpful?

