Skip to content

Commit

Permalink
Merge pull request #145 from xmtp/np/pull-beta-into-main
Browse files Browse the repository at this point in the history
Bring Beta back into Main
  • Loading branch information
nplasterer authored Feb 12, 2024
2 parents 41bf2c1 + 080f7af commit 59ab892
Show file tree
Hide file tree
Showing 10 changed files with 1,473 additions and 385 deletions.
1 change: 1 addition & 0 deletions dev/ts/generate
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ docker run --rm -i -v${PWD}:/code xmtp/protoc \
message_contents/ciphertext.proto \
message_contents/public_key.proto \
message_contents/contact.proto \
message_contents/frames.proto \
message_contents/invitation.proto \
message_contents/private_key.proto \
message_contents/content.proto \
Expand Down
981 changes: 640 additions & 341 deletions go/keystore_api/v1/keystore.pb.go

Large diffs are not rendered by default.

110 changes: 66 additions & 44 deletions go/message_contents/message.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions proto/keystore_api/v1/keystore.proto
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ message EncryptResponse {
// Wrapper object for success response
message Success {
xmtp.message_contents.Ciphertext encrypted = 1;
bytes sender_hmac = 2;
}

oneof response {
Expand Down Expand Up @@ -293,3 +294,22 @@ message TopicMap {
}
map<string, TopicData> topics = 1;
}

// Used to get a mapping of conversation topics to their HMAC keys
message GetConversationHmacKeysRequest {
repeated string topics = 1;
}

// A mapping of topics to their HMAC keys
message GetConversationHmacKeysResponse {
// HmacKeyData wraps the HMAC key and the number of 30 day periods since epoch
message HmacKeyData {
int32 thirty_day_periods_since_epoch = 1;
bytes hmac_key = 2;
}
// HmacKeys represents multiple HmacKeyData objects
message HmacKeys {
repeated HmacKeyData values = 1;
}
map<string, HmacKeys> hmac_keys = 1;
}
37 changes: 37 additions & 0 deletions proto/message_contents/frames.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// Signature is a generic structure for public key signatures.
syntax = "proto3";

package xmtp.message_contents;

import "message_contents/public_key.proto";
import "message_contents/signature.proto";

option go_package = "github.com/xmtp/proto/v3/go/message_contents";
option java_package = "org.xmtp.proto.message.contents";

// The message that will be signed by the Client and returned inside the
// `action_body` field of the FrameAction message
message FrameActionBody {
// The URL of the frame that was clicked
// May be different from `post_url`
string frame_url = 1;
// The 1-indexed button that was clicked
int32 button_index = 2;
// Timestamp of the click in milliseconds since the epoch
uint64 timestamp = 3;
// A unique identifier for the conversation, not tied to anything on the
// network. Will not match the topic or conversation_id
string opaque_conversation_identifier = 4;
}

// The outer payload that will be sent as the `messageBytes` in the
// `trusted_data` part of the Frames message
message FrameAction {
Signature signature = 1;
// The SignedPublicKeyBundle of the signer, used to link the XMTP signature
// with a blockchain account through a chain of signatures.
SignedPublicKeyBundle signed_public_key_bundle = 2;
// Serialized FrameActionBody message, so that the signature verification can
// happen on a byte-perfect representation of the message
bytes action_body = 3;
}
4 changes: 4 additions & 0 deletions proto/message_contents/message.proto
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ message MessageV2 {
bytes header_bytes = 1; // encapsulates encoded MessageHeaderV2
// Ciphertext.payload MUST contain encrypted SignedContent
Ciphertext ciphertext = 2;
// HMAC of the message ciphertext, with the HMAC key derived from the topic key
optional bytes sender_hmac = 3;
// Flag indicating whether the message should be pushed from a notification server
optional bool should_push = 4;
}

// Versioned Message
Expand Down
Loading

0 comments on commit 59ab892

Please sign in to comment.