aboutsummaryrefslogtreecommitdiff
path: root/pkg/pro/chain.proto
blob: 05596849d0b0fd611a61fee5aadf599bdcfc97cc (plain)
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
58
59
60
61
62
63
syntax = "proto3";

option go_package = "../pro";

message Header {
  uint32 version = 1;
  string previous_hash = 2;
  string merkle_root = 3;
  string difficulty_target = 4;
  uint32 nonce = 5;
  uint32 timestamp = 6;
}

message TransactionInput {
  string reference_transaction_hash = 1;
  uint32 output_index = 2;
  string unlocking_script = 3;
}

message TransactionOutput {
  uint32 amount = 1;
  string locking_script = 2;
}

message Transaction {
  uint32 version = 1;
  repeated TransactionInput inputs = 2;
  repeated TransactionOutput outputs = 3;
  uint32 lock_time = 4;
}

message Block {
  Header header = 1;
  repeated Transaction transactions = 2;
}

message BlockRecord {
  Header header = 1;
  uint32 height = 2;
  uint32 number_of_transactions = 3;

  string block_file = 4;
  uint32 block_start_offset = 5;
  uint32 block_end_offset = 6;

  string undo_file = 7;
  uint32 undo_start_offset = 8;
  uint32 undo_end_offset = 9;
}

message CoinRecord {
  uint32 version = 1;
  repeated uint32 output_indexes = 3;
  repeated uint32 amounts = 4;
  repeated string locking_scripts = 5;
}

message UndoBlock {
  repeated string transaction_input_hashes = 1;
  repeated uint32 output_indexes = 2;
  repeated uint32 amounts = 3;
  repeated string locking_scripts = 4;
}