forked from hyperledger-iroha/iroha-dco
-
Notifications
You must be signed in to change notification settings - Fork 0
/
api.proto
58 lines (42 loc) · 1.1 KB
/
api.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
syntax = "proto3";
package iroha.proto;
import "primitive.proto";
import "actions.proto";
// may be reused in transaction or block
message Header{
uint32 created_ts = 1;
repeated Signature sig = 2;
bytes hash = 3;
};
message Transaction {
// HEADER
// concat all serialized actions:
// python: actions_str = "".join([x.SerializeAsString() for x in actions])
// hash = sha3_256(meta->SerializeasString() + actions_str)
Header header = 1;
message Meta {
bytes creator_pubkey = 1;
// used to prevent replay attacks.
uint64_t tx_counter = 2;
}
// META
Meta meta = 3;
// BODY
repeated Command actions = 4;
}
message Block {
// HEADER
// hash inside header is calculated as =>
// hash = sha3_256(meta->SerializeasString())
Header header = 1;
message Meta {
uint16_t tx_n = 1;
uint64_t height = 2;
bytes merkle_root = 3;
uint64_t created_ts = 4;
}
// META
Meta meta = 2;
// BODY
repeated Transaction transactions = 3;
}