Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add referencing_message_id to EncodedContent #65

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions proto/message_contents/content.proto
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ message EncodedContent {
optional Compression compression = 5;
// encoded content itself
bytes content = 4;
// optional ID of a message that this message is referencing
optional string referencing_message_id = 6;
Copy link

@michaelx11 michaelx11 Mar 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall feels okay to me, but admittedly without thinking too hard about any far-reaching consequences. If referencing_message_id is the sha256 digest of the referenced message envelope, this seems pretty safe. It's effectively a handle to aid in looking up the referenced message which should be very difficult to predict or forge (envelope contents include randomly generated salt, etc).

For tactical use seems totally fine.

Copy link

@michaelx11 michaelx11 Mar 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For my sake, might be good to reiterate in comment what the message id is e.g. "sha256 of envelope message as unencoded bytes"

added question: which proto field is being fed into sha256 to get the id again?

}

// SignedContent attaches a signature to EncodedContent.
Expand Down