refactor protos

This commit is contained in:
Jazz Turner-Baggs 2025-07-03 14:04:13 -07:00
parent 1fb7f61407
commit 247323fd6c
No known key found for this signature in database
5 changed files with 61 additions and 68 deletions

View File

@ -1,68 +0,0 @@
syntax = "proto3";
package umbra.base;
import "encryption.proto";
import "invite.proto";
///////////////////////////////////////////////////////////////////////////////
// Protocol Frames
///////////////////////////////////////////////////////////////////////////////
message InboxV1Frame {
string recipient = 1;
// string conversation_type = 2;
oneof frame_type {
invite.InvitePrivateV1 invite_private_v1 = 10;
}
}
///////////////////////////////////////////////////////////////////////////////
// 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 ReliableBytes {
string message_id = 2;
string channel_id = 3;
int32 lamport_timestamp = 10;
repeated HistoryEntry causal_history = 11;
bytes bloom_filter = 12;
bytes content = 20;
}
///////////////////////////////////////////////////////////////////////////////
// Encryption
///////////////////////////////////////////////////////////////////////////////
// TODO: This also encompasses plaintexts, is there a better name?
// Alternatives: ???
message EncryptedBytes {
oneof encryption {
encryption.Plaintext plaintext = 1;
encryption.Ecies ecies = 2;
}
}
///////////////////////////////////////////////////////////////////////////////
// Payload Framing Messages
///////////////////////////////////////////////////////////////////////////////
message UmbraEnvelopeV1 {
string conversation_hint = 1;
uint64 salt = 2;
bytes payload = 5;
}

View File

@ -3,6 +3,16 @@ syntax = "proto3";
package umbra.encryption;
// TODO: This also encompasses plaintexts, is there a better name?
// Alternatives: ???
message EncryptedPayload {
oneof encryption {
encryption.Plaintext plaintext = 1;
encryption.Ecies ecies = 2;
}
}
message Plaintext {
bytes payload=1;
}

View File

@ -0,0 +1,16 @@
syntax = "proto3";
package umbra.envelope;
///////////////////////////////////////////////////////////////////////////////
// Payload Framing Messages
///////////////////////////////////////////////////////////////////////////////
message UmbraEnvelopeV1 {
string conversation_hint = 1;
uint64 salt = 2;
bytes payload = 5;
}

12
proto/umbra/inbox.proto Normal file
View File

@ -0,0 +1,12 @@
syntax = "proto3";
package umbra.inbox;
import "invite.proto";
message InboxV1Frame {
string recipient = 1;
oneof frame_type {
invite.InvitePrivateV1 invite_private_v1 = 10;
}
}

View File

@ -0,0 +1,23 @@
syntax = "proto3";
package umbra.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;
}