PeerServ Message Relay Interface
Last updated
Was this helpful?
Last updated
Was this helpful?
Ty Everett (ty@projectbabbage.com)
This document introduces a message box architecture and relay interface to enable data exchange between two parties using a authenticated server. This system allows for message exchange and forwarding between parties who might be offline or unable to establish a direct peer-to-peer connection. While the use of a server as a go-between for peer-to-peer exchange is not novel, this system offers enough flexibility to support federation, removing the need for a single central server.
The Bitcoin whitepaper reveals that no existing mechanism allows payment exchange over a communication channel. Bitcoin addresses this issue by introducing a distributed timestamp server. However, obstacles such as NAT traversal issues and slow CGA adoption hinder the creation of channels for peer-to-peer general message exchange. The current internet infrastructure is not conducive to reliable peer-to-peer message exchange, lacking a proper mechanism for such exchanges between peers. This standard proposes a solution built on a authenticated server, which enables a simple message box architecture and relay system for peers who may not always be online.
The system involves a sender, a recipient, and a server. The server enforces authentication and identifies all parties (senders and recipients) based on their identity keys. The server offers several interfaces to facilitate message delivery, receipt, and acknowledgment between the sender and recipient through various message boxes.
The server operates over HTTPS at an internet domain name and enforces authentication for all requests. It implements the following three endpoints:
/sendMessage
Send a message to a recipient's message box.
message
object
Message object containing all relevant information
message.recipient
string
The recipient's public key
message.messageBox
string
The name of the recipient's message box
message.body
string
The content of the message
Example Request:
status
string
The status of the message sending operation
Example Response:
/listMessages
List messages from the specified message box.
messageBox
string
The name of the message box to retrieve messages from
Example Request:
status
string
The status of the message listing operation
messages
array
Array of message objects
messages[].messageId
integer
Unique identifier for the message
messages[].body
string
The content of the message
messages[].sender
string
The sender's public key
Example Response:
/acknowledgeMessage
Acknowledge that a message has been received. After acknowledgment, the server deletes a message.
messageIds
array
Array of message IDs to acknowledge
Example Request:
status
string
The status of the message acknowledgment operation
This messaging system is not intended for long-term storage, but only for transport of messages. It should not be used, for example, to maintain a reliable list of all messages in a messaging application, only to facilitate the delivery of those messages to recipients. Once a recipient receives a message, they should generally store or act upon it in some way and then acknowledge it, removing it from the server.
We leave it to higher-level protocols and systems to implement appropriate digital signature schemes and message authenticity checks for their relevant use-cases. Notably, all senders and all recipients use authentication to communicate with the server. The messages exchanged between the parties over the server could form a second-layer channel, between the two users themselves.
and define the mechanism by which multiple servers can discover and route messages to one another, making use of an overlay network. When properly implemented, this enables two parties to exchange messages with one another even when not using the same server.
We leave open the possibility for monetization by future specifications via when server operators relay or synchronize messages. When implemented, acts as a drop-in replacement for and the server operators decide on a price. Participants choose which servers they are willing to pay to interact with.
The message relay architecture has been implemented in the , created by the Babbage Team.