OSDN Git Service

init for remove issue (#63)
[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 ValueSource {
35   Hash        ref      = 1;
36   AssetAmount value    = 2;
37   uint64      position = 3;
38 }
39
40 message ValueDestination {
41   Hash        ref      = 1;
42   AssetAmount value    = 2;
43   uint64      position = 3;
44 }
45
46 message BlockHeader {
47   uint64            version                 = 1;
48   uint64            height                  = 2;
49   Hash              previous_block_id       = 3;
50   uint64            timestamp               = 4;
51   Hash              transactions_root       = 5;
52   Hash              transaction_status_hash = 6;
53   TransactionStatus transaction_status      = 7;
54   repeated bytes    witness_arguments       = 8;
55 }
56
57 message TxHeader {
58   uint64        version         = 1;
59   uint64        serialized_size = 2;
60   uint64        time_range      = 3;
61   repeated Hash result_ids      = 4;
62 }
63
64 message TxVerifyResult {
65   bool status_fail = 1;
66 }
67
68 message TransactionStatus {
69   uint64                  version        = 1;
70   repeated TxVerifyResult verify_status  = 2;
71 }
72
73 message Mux {
74   repeated ValueSource      sources              = 1; // issuances, spends, and muxes
75   Program                   program              = 2;
76   repeated ValueDestination witness_destinations = 3; // outputs, retirements, and muxes
77   repeated bytes            witness_arguments    = 4;
78 }
79
80 message Coinbase {
81   ValueDestination witness_destination = 1;
82   bytes            arbitrary           = 2;
83 }
84
85 message IntraChainOutput {
86   ValueSource source          = 1;
87   Program     control_program = 2;
88   uint64      ordinal         = 3;
89 }
90
91 message CrossChainOutput {
92   ValueSource source          = 1;
93   Program     control_program = 2;
94   uint64      ordinal         = 3;
95 }
96
97 message VoteOutput {
98   ValueSource source          = 1;
99   Program     control_program = 2;
100   uint64      ordinal         = 3;
101   bytes       vote            = 4;
102 }
103
104 message Retirement {
105   ValueSource source   = 1;
106   uint64      ordinal  = 2;
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 }