OSDN Git Service

init delete the pow related (#55)
[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 BlockHeader {
52   uint64            version                 = 1;
53   uint64            height                  = 2;
54   Hash              previous_block_id       = 3;
55   uint64            timestamp               = 4;
56   Hash              transactions_root       = 5;
57   Hash              transaction_status_hash = 6;
58   TransactionStatus transaction_status      = 7;
59 }
60
61 message TxHeader {
62   uint64        version         = 1;
63   uint64        serialized_size = 2;
64   uint64        time_range      = 3;
65   repeated Hash result_ids      = 4;
66 }
67
68 message TxVerifyResult {
69   bool status_fail = 1;
70 }
71
72 message TransactionStatus {
73   uint64                  version        = 1;
74   repeated TxVerifyResult verify_status  = 2;
75 }
76
77 message Mux {
78   repeated ValueSource      sources              = 1; // issuances, spends, and muxes
79   Program                   program              = 2;
80   repeated ValueDestination witness_destinations = 3; // outputs, retirements, and muxes
81   repeated bytes            witness_arguments    = 4;
82 }
83
84 message Coinbase {
85   ValueDestination witness_destination = 1;
86   bytes            arbitrary           = 2;
87 }
88
89 message Output {
90   ValueSource source          = 1;
91   Program     control_program = 2;
92   uint64      ordinal         = 3;
93 }
94
95 message Retirement {
96   ValueSource source   = 1;
97   uint64      ordinal  = 2;
98 }
99
100 message Issuance {
101   Hash             nonce_hash               = 1;
102   AssetAmount      value                    = 2;
103   ValueDestination witness_destination      = 3;
104   AssetDefinition  witness_asset_definition = 4;
105   repeated bytes   witness_arguments        = 5;
106   uint64           ordinal                  = 6;
107 }
108
109 message Spend {
110   Hash             spent_output_id     = 1;
111   ValueDestination witness_destination = 2;
112   repeated bytes   witness_arguments   = 3;
113   uint64           ordinal             = 4;
114 }