diff --git a/protos/conversations/group_v1.proto b/protos/conversations/group_v1.proto new file mode 100644 index 0000000..fde7013 --- /dev/null +++ b/protos/conversations/group_v1.proto @@ -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; + // ... + } +} diff --git a/protos/encryption.proto b/protos/encryption.proto new file mode 100644 index 0000000..cda0fb0 --- /dev/null +++ b/protos/encryption.proto @@ -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; +} diff --git a/protos/envelope.proto b/protos/envelope.proto new file mode 100644 index 0000000..6a961d4 --- /dev/null +++ b/protos/envelope.proto @@ -0,0 +1,16 @@ +syntax = "proto3"; + +package wap.envelope; + + +/////////////////////////////////////////////////////////////////////////////// +// Payload Framing Messages +/////////////////////////////////////////////////////////////////////////////// + +message WapEnvelopeV1 { + + string conversation_hint = 1; + uint64 salt = 2; + + bytes payload = 5; +} diff --git a/protos/inbox.proto b/protos/inbox.proto new file mode 100644 index 0000000..438b977 --- /dev/null +++ b/protos/inbox.proto @@ -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; + } +} diff --git a/protos/invite.proto b/protos/invite.proto new file mode 100644 index 0000000..da9f560 --- /dev/null +++ b/protos/invite.proto @@ -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; +} diff --git a/protos/private_v1.proto b/protos/private_v1.proto new file mode 100644 index 0000000..7dd69ff --- /dev/null +++ b/protos/private_v1.proto @@ -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; + // .... + } +} diff --git a/protos/reliability.proto b/protos/reliability.proto new file mode 100644 index 0000000..f71f9b2 --- /dev/null +++ b/protos/reliability.proto @@ -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; + }