Skip to content

feat: Add payer reports #256

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

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions proto/xmtpv4/envelopes/envelopes.proto
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package xmtp.xmtpv4.envelopes;
import "identity/associations/association.proto";
import "identity/associations/signature.proto";
import "mls/api/v1/mls.proto";
import "xmtpv4/envelopes/payer_report.proto";

option go_package = "github.com/xmtp/proto/v3/go/xmtpv4/envelopes";

Expand All @@ -30,6 +31,8 @@ message ClientEnvelope {
xmtp.mls.api.v1.WelcomeMessageInput welcome_message = 3;
xmtp.mls.api.v1.UploadKeyPackageRequest upload_key_package = 4;
xmtp.identity.associations.IdentityUpdate identity_update = 5;
PayerReport payer_report = 6;
PayerReportAttestation payer_report_attestation = 7;
}
}

Expand Down
34 changes: 34 additions & 0 deletions proto/xmtpv4/envelopes/payer_report.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// Message API for XMTP V4
syntax = "proto3";

package xmtp.xmtpv4.envelopes;

import "identity/associations/signature.proto";

option go_package = "github.com/xmtp/proto/v3/go/xmtpv4/envelopes";

// A report of the payers and nodes that sent messages in a given range of messages
message PayerReport {
// The originator this report is referring to
uint32 originator_node_id = 1;
// The sequence_id that the report starts at [exclusive]
uint64 start_sequence_id = 2;
// The sequence_id that the report ends at [inclusive]
uint64 end_sequence_id = 3;
// The merkle root of the payer balance diff tree
bytes payers_merkle_root = 4;
// The number of payers in the given range
uint32 payers_leaf_count = 5;
// The hash of the sorted list of node IDs in the report
bytes nodes_hash = 6;
// The number of nodes in the report
uint32 nodes_count = 7;
}

// An attestation of a payer report
message PayerReportAttestation {
// The ID of the report, determined by hashing the report contents
bytes report_id = 1;
// The signature of the attester
xmtp.identity.associations.RecoverableEcdsaSignature signature = 2;
}
Loading