Conversation
|
|
||
| The following mappings connect PRIVATE1 concepts to SDS fields: | ||
|
|
||
| - `sender_id`: !TODO: This requires PRIVATE1 to be identity aware |
There was a problem hiding this comment.
Unsure exactly what the best course of action is here. Recent changes to SDS requires an sender_id be attached the the SdsMessage.
This then brings in a concept of identity to this specification. Its definitely possible to introduce Identity concepts in order to pass them through to SDS, however it seems like a lot of added complexity
| - **[DOUBLERATCHET]** "The Double Ratchet Algorithm", Signal, 2016. | ||
| https://signal.org/docs/specifications/doubleratchet/ | ||
|
|
||
| - **[SDS]** "Scalable Data Sync Specification", vac, 2024. |
There was a problem hiding this comment.
All of these github references from vacp2p and waku-org are broken.
osmaczko
left a comment
There was a problem hiding this comment.
Looks good overall. The reasoning behind the Content -> Segmentation -> Reliability -> Encryption layering makes sense.
Please remember to address the TODOs before merging.
| ```mermaid | ||
| flowchart LR | ||
| Content:::plain--> PrivateV1 --> Payload:::plain | ||
| classDef plain fill:none,stroke:transparent; | ||
| ``` |
There was a problem hiding this comment.
| ```mermaid | |
| flowchart LR | |
| Content:::plain--> PrivateV1 --> Payload:::plain | |
| classDef plain fill:none,stroke:transparent; | |
| ``` | |
| ```mermaid | |
| flowchart LR | |
| Content:::plain --> PrivateV1 | |
| PrivateV1 --> F1[Frame 1] --> P1[Payload 1]:::plain | |
| PrivateV1 -.-> F2[Frame 2] -.-> P2[Payload 2]:::plain | |
| PrivateV1 -.-> FN[Frame N] -.-> PN[Payload N]:::plain | |
| classDef plain fill:none,stroke:transparent; |
There was a problem hiding this comment.
I generally like these changes, but looking to understand more to see if there is more optimizations to be made.
I see two changes here.
- An explicit reference to Frames
- An specific update the the cardinality of messages.
I can see # 2 being an improvement as it explicitly refers to segmentation being a responsibility of the protocol.
At a high level does adding Frames increase understanding at a 40,000ft view?
There was a problem hiding this comment.
At a high level does adding Frames increase understanding at a 40,000ft view?
Don’t have a strong opinion here. Including frames makes it clear at first glance that segmentation happens in the chat protocol rather than in the delivery service.
| Implementation specifics: | ||
| - Error correction is not used, as reliable delivery is already provided by lower layers. | ||
| - `segmentSize` = `max_seg_size` | ||
| - All payloads regardless of size are wrapped in a segmentation message. |
There was a problem hiding this comment.
This contradicts segmentation specs:
Messages whose payload size is ≤ segmentSize are sent unmodified.
There was a problem hiding this comment.
Great point.
I specifically have suggested a change in that PR.
Sending the message unmodified violates the functional requirement of "deterministic decoding".
To decode those messages one would first attempt to decode as a Segmentation message, and then on failure, assume its a different type.
I'd prefer to spend the extra 4 bytes and make it explicit.
There was a problem hiding this comment.
I'd prefer to spend the extra 4 bytes and make it explicit.
Totally agree 👍
This PR adds a specification which describes a conversation protocol for pairwise communication called PRIVATE1.
It covers payload generation and operation after a key has been agreed upon by both parties.
Notes
This may eventually be simplified and use Reliable Channels but its explicit in how it utilizes SDS + segmentation and the reasons for doing so.