mirror of
https://github.com/logos-messaging/chat_proto.git
synced 2026-02-17 19:43:14 +00:00
feat: add protobuf definitions
This commit is contained in:
parent
c883557b8b
commit
4d1c32a5e2
28
protos/conversations/group_v1.proto
Normal file
28
protos/conversations/group_v1.proto
Normal file
@ -0,0 +1,28 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package wap.convos.group_v1;
|
||||
|
||||
import "base.proto";
|
||||
import "common_frames.proto";
|
||||
|
||||
|
||||
|
||||
message ConversationInvite_GroupV1 {
|
||||
repeated string participants = 1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
message GroupV1Frame {
|
||||
// SDS like information: Message ID and channel_id extracted for utility
|
||||
string message_id = 2;
|
||||
string channel_id = 3; // Channel_id is associated with a set of participants
|
||||
// This conflicts with conversation based encryption,
|
||||
// need to ensure the derived sender is a valid participant
|
||||
base.ReliabilityInfo reliability_info = 10;
|
||||
|
||||
oneof frame_type {
|
||||
common_frames.ContentFrame content = 100;
|
||||
// ...
|
||||
}
|
||||
}
|
||||
26
protos/encryption.proto
Normal file
26
protos/encryption.proto
Normal file
@ -0,0 +1,26 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package wap.encryption;
|
||||
|
||||
|
||||
// TODO: This also encompasses plaintexts, is there a better name?
|
||||
// Alternatives: ???
|
||||
message EncryptedPayload {
|
||||
|
||||
oneof encryption {
|
||||
encryption.Plaintext plaintext = 1;
|
||||
encryption.Doubleratchet doubleratchet = 2;
|
||||
}
|
||||
}
|
||||
|
||||
message Plaintext {
|
||||
bytes payload=1;
|
||||
}
|
||||
|
||||
message Doubleratchet {
|
||||
bytes dh = 1; // 32 byte array
|
||||
uint32 msgNum = 2;
|
||||
uint32 prevChainLen = 3;
|
||||
bytes ciphertext = 4;
|
||||
string aux = 5;
|
||||
}
|
||||
16
protos/envelope.proto
Normal file
16
protos/envelope.proto
Normal file
@ -0,0 +1,16 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package wap.envelope;
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Payload Framing Messages
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
message WapEnvelopeV1 {
|
||||
|
||||
string conversation_hint = 1;
|
||||
uint64 salt = 2;
|
||||
|
||||
bytes payload = 5;
|
||||
}
|
||||
17
protos/inbox.proto
Normal file
17
protos/inbox.proto
Normal file
@ -0,0 +1,17 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package wap.inbox;
|
||||
|
||||
import "invite.proto";
|
||||
|
||||
message Note{
|
||||
string text = 1;
|
||||
}
|
||||
|
||||
message InboxV1Frame {
|
||||
string recipient = 1;
|
||||
oneof frame_type {
|
||||
invite.InvitePrivateV1 invite_private_v1 = 10;
|
||||
Note note = 11;
|
||||
}
|
||||
}
|
||||
14
protos/invite.proto
Normal file
14
protos/invite.proto
Normal file
@ -0,0 +1,14 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package wap.invite;
|
||||
|
||||
import "encryption.proto";
|
||||
|
||||
message InvitePrivateV1 {
|
||||
bytes initiator = 1;
|
||||
bytes initiator_ephemeral = 2;
|
||||
bytes participant = 3;
|
||||
int32 participant_ephemeral_id= 4;
|
||||
string discriminator = 5;
|
||||
encryption.EncryptedPayload initial_message = 6;
|
||||
}
|
||||
19
protos/private_v1.proto
Normal file
19
protos/private_v1.proto
Normal file
@ -0,0 +1,19 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package wap.convos.private_v1;
|
||||
|
||||
|
||||
message Placeholder {
|
||||
uint32 counter = 1;
|
||||
}
|
||||
|
||||
message PrivateV1Frame {
|
||||
string conversation_id = 1;
|
||||
bytes sender = 2;
|
||||
int64 timestamp = 3; // Sender reported timestamp
|
||||
oneof frame_type {
|
||||
bytes content = 10;
|
||||
Placeholder placeholder = 11;
|
||||
// ....
|
||||
}
|
||||
}
|
||||
23
protos/reliability.proto
Normal file
23
protos/reliability.proto
Normal file
@ -0,0 +1,23 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package wap.reliability;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// SDS Payloads
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
message HistoryEntry {
|
||||
string message_id = 1; // Unique identifier of the SDS message, as defined in `Message`
|
||||
bytes retrieval_hint = 2; // Optional information to help remote parties retrieve this SDS
|
||||
// message; For example, A Waku deterministic message hash or routing payload hash
|
||||
}
|
||||
|
||||
message ReliablePayload {
|
||||
string message_id = 2;
|
||||
string channel_id = 3;
|
||||
int32 lamport_timestamp = 10;
|
||||
repeated HistoryEntry causal_history = 11;
|
||||
bytes bloom_filter = 12;
|
||||
// Optional field causes errors in nim protobuf generation. Removing for now as optional is implied anways.
|
||||
bytes content = 20;
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user