chat_proto/specs/inbox.md

123 lines
3.1 KiB
Markdown
Raw Normal View History

2025-06-27 18:55:26 -07:00
---
title: INBOX
2025-07-03 22:28:36 -07:00
name: Inbound message queues
2025-06-27 18:55:26 -07:00
category: Standards Track
status: raw
tags: chat
editor: Jazz Alyxzander<jazz@status.im>
contributors:
---
2025-07-03 22:28:36 -07:00
# Abstract
2025-06-27 18:55:26 -07:00
2025-07-03 22:28:36 -07:00
# Background / Rationale / Motivation
Clients must be able to receive frames before conversations can be initialized. While its possible to coordinate a content topic out of band, that becomes limiting factor to growth.
2025-06-27 18:55:26 -07:00
2025-07-03 22:28:36 -07:00
# Theory / Semantics
2025-06-27 18:55:26 -07:00
2025-07-03 22:28:36 -07:00
Inboxes are inbound only conversation types, which allow a client to receive messages from contacts.
2025-06-27 18:55:26 -07:00
An inbox does not have a defined set of participants, and is used to receive messages when there does not exist and established channel between contacts.
2025-07-03 22:28:36 -07:00
An inbox does not have an inherent keypair or identity associated with it - it's an agreed upon location to recieve messages.
2025-06-27 18:55:26 -07:00
2025-07-03 22:28:36 -07:00
## Creation
2025-06-27 18:55:26 -07:00
2025-07-03 22:28:36 -07:00
Inboxes do not need to be "created", and there is no required initialization.
2025-06-27 18:55:26 -07:00
2025-07-03 22:28:36 -07:00
## Content Topic
2025-06-27 18:55:26 -07:00
2025-07-03 22:28:36 -07:00
// TODO: Inbox Topics will be defined in ContactBundles, allowing for dynamic topic usage
All clients must listen for messages posted with the content topic `/inbox/<inbox_address>`
2025-06-27 18:55:26 -07:00
2025-07-03 22:28:36 -07:00
## Accepted types
2025-06-27 18:55:26 -07:00
2025-07-03 22:28:36 -07:00
## Encryption
2025-06-27 18:55:26 -07:00
2025-07-03 22:28:36 -07:00
All Frames sent to the Inbox MUST be encrypted to maintain message confidentiality.
2025-06-27 18:55:26 -07:00
2025-07-03 22:28:36 -07:00
This protocol uses a [KN noise handshake](https://noiseexplorer.com/patterns/KN/) to secure inbound messages.
2025-06-27 18:55:26 -07:00
2025-07-03 22:28:36 -07:00
Recipients S,E is sent out of band. Messages sent in this manner do not benefit from sender authentication. Contents need to be validated prior to being trusted.
2025-06-27 18:55:26 -07:00
2025-07-03 22:28:36 -07:00
## Framing
2025-06-27 18:55:26 -07:00
2025-07-03 22:28:36 -07:00
[TODO: Is there benefit to using SDS in this case? If all messages are invites and communication occurs else where, is this just wasting bytes?]
```mermaid
flowchart TD
UmbraEnvelopeV1 <--> EncryptedPayload
EncryptedPayload <--> D{En/Decrypt}
D <--> ReliableBytes
ReliableBytes --> InboxV1Frame
2025-06-27 18:55:26 -07:00
2025-07-03 22:28:36 -07:00
```
2025-06-27 18:55:26 -07:00
2025-07-03 22:28:36 -07:00
### EncryptedBytes
2025-06-27 18:55:26 -07:00
2025-07-03 22:28:36 -07:00
The EncryptedBytes message is a self-describing wrapper for all encrypted payloads. As the protocol grows it will include potentially different encryption mechanisms. This message type makes no assumptions about the encryption used an allows new conversation types to use the same messaging framework.
2025-06-27 18:55:26 -07:00
## Wire Format Specification / Syntax
The wire format is specified using protocol buffers v3.
```mermaid
2025-07-03 22:28:36 -07:00
message InboxV1Frame {
string recipient = 1;
oneof frame_type {
... supported invite types
}
}
2025-06-27 18:55:26 -07:00
message EncryptedBytes {
oneof encryption {
bytes encrypted_bytes=1;
Plaintext plaintext = 2;
Ecies ecies = 3;
}
message Ecies {
bytes encrypted_bytes=1;
bytes ephemeral_pubkey = 2;
bytes tag = 3;
}
message Plaintext {
bytes payload=1;
}
}
```
## Implementation Suggestions (optional)
An optional *implementation suggestions* section may provide suggestions on how to approach implementation details, and,
if available, point to existing implementations for reference.
## (Further Optional Sections)
## Security/Privacy Considerations
## Copyright
Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/).
## References
A list of references.