OSDN Git Service

Handle the abnormal exit situation
[bytom/vapor.git] / protocol / bc / bc.proto
1 syntax = "proto3";
2
3 package bc;
4
5 message Hash {
6   fixed64 v0 = 1;
7   fixed64 v1 = 2;
8   fixed64 v2 = 3;
9   fixed64 v3 = 4;
10 }
11
12 message Program {
13   uint64 vm_version = 1;
14   bytes  code       = 2;
15 }
16
17 // This message type duplicates Hash, above. One alternative is to
18 // embed a Hash inside an AssetID. But it's useful for AssetID to be
19 // plain old data (without pointers). Another alternative is use Hash
20 // in any protobuf types where an AssetID is called for, but it's
21 // preferable to have type safety.
22 message AssetID {
23   fixed64 v0 = 1;
24   fixed64 v1 = 2;
25   fixed64 v2 = 3;
26   fixed64 v3 = 4;
27 }
28
29 message AssetAmount {
30   AssetID asset_id = 1;
31   uint64  amount   = 2;
32 }
33
34 message AssetDefinition {
35   Program issuance_program = 1;
36   Hash    data             = 2;
37 }
38
39 message ValueSource {
40   Hash        ref      = 1;
41   AssetAmount value    = 2;
42   uint64      position = 3;
43 }
44
45 message ValueDestination {
46   Hash        ref      = 1;
47   AssetAmount value    = 2;
48   uint64      position = 3;
49 }
50
51 message Proof {
52         bytes sign           = 1;
53         bytes controlProgram = 2;
54   bytes address        = 3;
55 }
56
57 message BytomBlockHeader {
58   uint64            version                 = 1;
59   uint64            height                  = 2;
60   Hash              previous_block_id       = 3;
61   uint64            timestamp               = 4;
62   Hash              transactions_root       = 5;
63   Hash              transaction_status_hash = 6;
64   uint64            nonce                   = 7;
65   uint64            bits                    = 8;
66   TransactionStatus transaction_status      = 9;
67 }
68
69 message BlockHeader {
70   uint64            version                 = 1;
71   uint64            height                  = 2;
72   Hash              previous_block_id       = 3;
73   uint64            timestamp               = 4;
74   Hash              transactions_root       = 5;
75   Hash              transaction_status_hash = 6;
76   uint64            nonce                   = 7;
77   uint64            bits                    = 8;
78   TransactionStatus transaction_status      = 9;
79 }
80
81 message TxHeader {
82   uint64        version         = 1;
83   uint64        serialized_size = 2;
84   Hash          data            = 3;
85   uint64        time_range      = 4;
86   repeated Hash result_ids      = 5;
87   bool          side            = 6;
88 }
89
90 message TxVerifyResult {
91   bool status_fail = 1;
92 }
93
94 message TransactionStatus {
95   uint64                  version        = 1;
96   repeated TxVerifyResult verify_status  = 2;
97 }
98
99 message Mux {
100   repeated ValueSource      sources              = 1; // issuances, spends, and muxes
101   Program                   program              = 2;
102   repeated ValueDestination witness_destinations = 3; // outputs, retirements, and muxes
103   repeated bytes            witness_arguments    = 4;
104 }
105
106 message Coinbase {
107   ValueDestination witness_destination = 1;
108   bytes            arbitrary           = 2;
109 }
110
111 message Output {
112   ValueSource source          = 1;
113   Program     control_program = 2;
114   uint64      ordinal         = 3;
115 }
116
117 message Retirement {
118   ValueSource source   = 1;
119   uint64      ordinal  = 2;
120 }
121
122 message Issuance {
123   Hash             nonce_hash               = 1;
124   AssetAmount      value                    = 2;
125   ValueDestination witness_destination      = 3;
126   AssetDefinition  witness_asset_definition = 4;
127   repeated bytes   witness_arguments        = 5;
128   uint64           ordinal                  = 6;
129 }
130
131 message Spend {
132   Hash             spent_output_id     = 1;
133   ValueDestination witness_destination = 2;
134   repeated bytes   witness_arguments   = 3;
135   uint64           ordinal             = 4;
136 }
137
138 message Claim {
139   Hash             spent_output_id     = 1;
140   ValueDestination witness_destination = 2;
141   repeated bytes   witness_arguments   = 3;
142   uint64           ordinal             = 4;
143   repeated bytes   Peginwitness        = 5;
144 }
145
146 message Dpos {
147   Hash             spent_output_id     = 1;
148   ValueDestination witness_destination = 2;
149   repeated bytes   witness_arguments   = 3;
150   uint64           ordinal             = 4;
151   uint32           type                = 5;
152   string           from                = 6;
153   string           to                  = 7;
154   uint64           stake               = 8;
155   string           data                = 9;
156 }