diff --git a/proto/identity/associations/association.proto b/proto/identity/associations/association.proto index 12becb26..e59a136e 100644 --- a/proto/identity/associations/association.proto +++ b/proto/identity/associations/association.proto @@ -16,6 +16,12 @@ message MemberIdentifier { } } +// single member that optionally indicates the member that added them +message Member { + MemberIdentifier identifier = 1; + optional MemberIdentifier added_by_entity = 2; +} + // The first entry of any XID log. The XID must be deterministically derivable // from the address and nonce. // The recovery address defaults to the initial associated_address unless @@ -72,3 +78,23 @@ message IdentityUpdate { uint64 client_timestamp_ns = 2; string inbox_id = 3; } + +// Map of members belonging to an inbox_id +message MemberMap { + MemberIdentifier key = 1; + Member value = 2; +} + +// A final association state resulting from multiple `IdentityUpdates` +message AssociationState { + string inbox_id = 1; + repeated MemberMap members = 2; + string recovery_address = 3; + repeated bytes seen_signatures = 4; +} + +/// state diff between two final AssociationStates +message AssociationStateDiff { + repeated MemberIdentifier new_members = 1; + repeated MemberIdentifier removed_members = 2; +} diff --git a/proto/mls_validation/v1/service.proto b/proto/mls_validation/v1/service.proto index 7cff4d27..5a0482bd 100644 --- a/proto/mls_validation/v1/service.proto +++ b/proto/mls_validation/v1/service.proto @@ -2,6 +2,8 @@ syntax = "proto3"; package xmtp.mls_validation.v1; +import "identity/associations/association.proto"; + option go_package = "github.com/xmtp/proto/v3/go/mls_validation/v1"; // RPCs for the new MLS API @@ -11,6 +13,9 @@ service ValidationApi { // Validates and parses a group message and returns relevant details rpc ValidateGroupMessages(ValidateGroupMessagesRequest) returns (ValidateGroupMessagesResponse) {} + + // Gets the final association state for a batch of identity updates + rpc GetAssociationState(GetAssociationStateRequest) returns (GetAssociationStateResponse) {} } // Contains a batch of serialized Key Packages @@ -59,3 +64,17 @@ message ValidateGroupMessagesResponse { repeated ValidationResponse responses = 1; } + +// Request to get a final association state for identity updates +message GetAssociationStateRequest { + // List of identity updates + repeated xmtp.identity.associations.IdentityUpdate old_updates = 1; + repeated xmtp.identity.associations.IdentityUpdate new_updates = 2; +} + +// Response to GetAssociationStateRequest, containing the final association state +// for an InboxID +message GetAssociationStateResponse { + xmtp.identity.associations.AssociationState association_state = 1; + xmtp.identity.associations.AssociationStateDiff state_diff = 2; +}