Skip to content

Commit 77c4a07

Browse files
authored
feat: Add payer reports (#256)
* feat: Add payer reports * Add missing import * Sort imports * Rename fields * Simplify report structure
1 parent 82c2d85 commit 77c4a07

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

proto/xmtpv4/envelopes/envelopes.proto

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ package xmtp.xmtpv4.envelopes;
66
import "identity/associations/association.proto";
77
import "identity/associations/signature.proto";
88
import "mls/api/v1/mls.proto";
9+
import "xmtpv4/envelopes/payer_report.proto";
910

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

@@ -30,6 +31,8 @@ message ClientEnvelope {
3031
xmtp.mls.api.v1.WelcomeMessageInput welcome_message = 3;
3132
xmtp.mls.api.v1.UploadKeyPackageRequest upload_key_package = 4;
3233
xmtp.identity.associations.IdentityUpdate identity_update = 5;
34+
PayerReport payer_report = 6;
35+
PayerReportAttestation payer_report_attestation = 7;
3336
}
3437
}
3538

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// Message API for XMTP V4
2+
syntax = "proto3";
3+
4+
package xmtp.xmtpv4.envelopes;
5+
6+
import "identity/associations/signature.proto";
7+
8+
option go_package = "github.com/xmtp/proto/v3/go/xmtpv4/envelopes";
9+
10+
// A report of the payers and nodes that sent messages in a given range of messages
11+
message PayerReport {
12+
// The originator this report is referring to
13+
uint32 originator_node_id = 1;
14+
// The sequence_id that the report starts at [exclusive]
15+
uint64 start_sequence_id = 2;
16+
// The sequence_id that the report ends at [inclusive]
17+
uint64 end_sequence_id = 3;
18+
// The merkle root of the payer balance diff tree
19+
bytes payers_merkle_root = 4;
20+
// The node IDs that are active in the network at the time of the report
21+
repeated uint32 active_node_ids = 5;
22+
}
23+
24+
// An attestation of a payer report
25+
message PayerReportAttestation {
26+
// The ID of the report, determined by hashing the report contents
27+
bytes report_id = 1;
28+
// The signature of the attester
29+
xmtp.identity.associations.RecoverableEcdsaSignature signature = 2;
30+
}

0 commit comments

Comments
 (0)