-
Notifications
You must be signed in to change notification settings - Fork 0
/
message.proto
35 lines (30 loc) · 1.03 KB
/
message.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
syntax = "proto2";
package dephy.message;
enum W3bstreamPayloadEncoding {
WPE_UTF8 = 0;
WPE_UTF8_JSON = 1;
WPE_HEX = 2;
WPE_BASE64 = 3;
}
message W3bstreamOptions {
required string topic = 1;
required string token = 2;
required W3bstreamPayloadEncoding encoding = 3; // How the payload being sent to W3bstream
}
message RawMessage {
required uint64 timestamp = 1;
required bytes from_address = 2; // ethereum address in bytes form
required bytes to_address = 3; // ethereum address in bytes form
required bool encrypted = 4; // Whether the payload is encrypted, the key should be negotiated by secp256k1.ecdh
required bytes payload = 5;
optional bytes iv = 6; // 16 bytes length IV for AES-256-CBC
required int32 kind = 7;
optional W3bstreamOptions w3b = 8;
}
message SignedMessage {
required bytes raw = 1;
required bytes hash = 2;
required uint64 nonce = 3; // Must greater than previous message
required bytes signature = 4;
optional bytes last_edge_addr = 5;
}