OSDN Git Service

remove the timerange check
[bytom/bytom.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   Hash    initial_block_id = 1;
36   Program issuance_program = 2;
37   Hash    data             = 3;
38 }
39
40 message ValueSource {
41   Hash        ref      = 1;
42   AssetAmount value    = 2;
43   uint64      position = 3;
44 }
45
46 message ValueDestination {
47   Hash        ref      = 1;
48   AssetAmount value    = 2;
49   uint64      position = 3;
50 }
51
52 message BlockHeader {
53   uint64 version                   = 1;
54   uint64 height                    = 2;
55   Hash   previous_block_id         = 3;
56   uint64 timestamp_ms              = 4;
57   Hash   transactions_root         = 5;
58   Hash   assets_root               = 6;
59   uint64 nonce                     = 7;
60   uint64 bits                      = 8;
61 }
62
63 message TxHeader {
64   uint64        version     = 1;
65   repeated Hash result_ids  = 2;
66   Hash          data        = 3;
67   uint64        min_time_ms = 4;
68   uint64        max_time_ms = 5;
69   Hash          ext_hash    = 6;
70 }
71
72 message Mux {
73   repeated ValueSource      sources              = 1; // issuances, spends, and muxes
74   Program                   program              = 2;
75   Hash                      ext_hash             = 3;
76   repeated ValueDestination witness_destinations = 4; // outputs, retirements, and muxes
77   repeated bytes            witness_arguments    = 5;
78 }
79
80 message Nonce {
81   Program        program             = 1;
82   Hash           ext_hash            = 2;
83   repeated bytes witness_arguments   = 3;
84   Hash           witness_anchored_id = 4;
85 }
86
87 message Coinbase {
88   Program        program             = 1;
89   Hash           block_id            = 2;
90   Hash           ext_hash            = 3;
91   repeated bytes witness_arguments   = 4;
92 }
93
94 message Output {
95   ValueSource source          = 1;
96   Program     control_program = 2;
97   Hash        data            = 3;
98   Hash        ext_hash        = 4;
99   uint64      ordinal         = 5;
100 }
101
102 message Retirement {
103   ValueSource source   = 1;
104   Hash        data     = 2;
105   Hash        ext_hash = 3;
106   uint64      ordinal  = 4;
107 }
108
109 message TimeRange {
110   uint64    min_time_ms = 1;
111   uint64    max_time_ms = 2;
112   Hash      ext_hash    = 3;
113 }
114
115 message Issuance {
116   Hash             anchor_id                = 1;
117   AssetAmount      value                    = 2;
118   Hash             data                     = 3;
119   Hash             ext_hash                 = 4;
120   ValueDestination witness_destination      = 5;
121   AssetDefinition  witness_asset_definition = 6;
122   repeated bytes   witness_arguments        = 7;
123   Hash             witness_anchored_id      = 8;
124   uint64           ordinal                  = 9;
125 }
126
127 message Spend {
128   Hash             spent_output_id     = 1;
129   Hash             data                = 2;
130   Hash             ext_hash            = 3;
131   ValueDestination witness_destination = 4;
132   repeated bytes   witness_arguments   = 5;
133   Hash             witness_anchored_id = 6;
134   uint64           ordinal             = 7;
135 }