3
3
syntax = "proto3" ;
4
4
package cusf.mainchain.v1 ;
5
5
6
+ import "google/protobuf/wrappers.proto" ;
7
+
6
8
enum AddressType {
7
9
ADDRESS_TYPE_UNSPECIFIED = 0 ;
8
10
ADDRESS_TYPE_DEFAULT = 1 ;
@@ -61,6 +63,13 @@ message BlockInfo {
61
63
optional bytes bmm_commitment = 3 ;
62
64
}
63
65
66
+ enum AckBundlesTag {
67
+ ACK_BUNDLES_TAG_UNSPECIFIED = 0 ;
68
+ ACK_BUNDLES_TAG_REPEAT_PREVIOUS = 1 ;
69
+ ACK_BUNDLES_TAG_LEADING_BY_50 = 2 ;
70
+ ACK_BUNDLES_TAG_UPVOTES = 3 ;
71
+ }
72
+
64
73
service MainchainService {
65
74
rpc BroadcastWithdrawalBundle (BroadcastWithdrawalBundleRequest )
66
75
returns (BroadcastWithdrawalBundleResponse );
@@ -80,25 +89,30 @@ service MainchainService {
80
89
returns (GetBmmHStarCommitmentsResponse );
81
90
rpc GetChainInfo (GetChainInfoRequest ) returns (GetChainInfoResponse );
82
91
rpc GetChainTip (GetChainTipRequest ) returns (GetChainTipResponse );
92
+ rpc GetCoinbasePSBT (GetCoinbasePSBTRequest ) returns (GetCoinbasePSBTResponse );
93
+ rpc GetCtip (GetCtipRequest ) returns (GetCtipResponse );
94
+ rpc GetSidechainProposals (GetSidechainProposalsRequest )
95
+ returns (GetSidechainProposalsResponse );
96
+ rpc GetSidechains (GetSidechainsRequest ) returns (GetSidechainsResponse );
83
97
rpc GetTwoWayPegData (GetTwoWayPegDataRequest )
84
98
returns (GetTwoWayPegDataResponse );
85
99
rpc SubscribeEvents (SubscribeEventsRequest )
86
100
returns (stream SubscribeEventsResponse );
87
101
}
88
102
89
103
message BroadcastWithdrawalBundleRequest {
90
- uint32 sidechain_id = 1 ;
91
- bytes transaction = 2 ;
104
+ google.protobuf.UInt32Value sidechain_id = 1 ;
105
+ google.protobuf.BytesValue transaction = 2 ;
92
106
}
93
107
message BroadcastWithdrawalBundleResponse {
94
108
}
95
109
96
110
message CreateBmmCriticalDataTransactionRequest {
97
- uint32 sidechain_id = 1 ;
98
- uint64 value_sats = 2 ;
99
- uint32 height = 3 ;
100
- bytes critical_hash = 4 ;
101
- bytes prev_bytes = 5 ;
111
+ google.protobuf.UInt32Value sidechain_id = 1 ;
112
+ google.protobuf.UInt64Value value_sats = 2 ;
113
+ google.protobuf.UInt32Value height = 3 ;
114
+ google.protobuf.BytesValue critical_hash = 4 ;
115
+ google.protobuf.BytesValue prev_bytes = 5 ;
102
116
}
103
117
message CreateBmmCriticalDataTransactionResponse {
104
118
bytes txid = 1 ;
@@ -123,30 +137,30 @@ message CreateNewAddressResponse {
123
137
}
124
138
125
139
message GenerateBlocksRequest {
126
- uint32 blocks = 1 ;
140
+ google.protobuf.UInt32Value blocks = 1 ;
127
141
}
128
142
message GenerateBlocksResponse {
129
143
}
130
144
131
145
message GetBlockHeaderInfoRequest {
132
- bytes block_hash = 1 ;
146
+ google.protobuf.BytesValue block_hash = 1 ;
133
147
}
134
148
message GetBlockHeaderInfoResponse {
135
149
BlockHeaderInfo header_info = 1 ;
136
150
}
137
151
138
152
message GetBlockInfoRequest {
139
- bytes block_hash = 1 ;
140
- uint32 sidechain_id = 2 ;
153
+ google.protobuf.BytesValue block_hash = 1 ;
154
+ google.protobuf.UInt32Value sidechain_id = 2 ;
141
155
}
142
156
message GetBlockInfoResponse {
143
157
BlockHeaderInfo header_info = 1 ;
144
158
BlockInfo block_info = 2 ;
145
159
}
146
160
147
161
message GetBmmHStarCommitmentsRequest {
148
- bytes block_hash = 1 ;
149
- uint32 sidechain_id = 2 ;
162
+ google.protobuf.BytesValue block_hash = 1 ;
163
+ google.protobuf.UInt32Value sidechain_id = 2 ;
150
164
}
151
165
message GetBmmHStarCommitmentsResponse {
152
166
message BlockNotFoundError {
@@ -173,10 +187,78 @@ message GetChainTipResponse {
173
187
BlockHeaderInfo block_header_info = 1 ;
174
188
}
175
189
190
+ message GetCoinbasePSBTRequest {
191
+ message ProposeSidechain {
192
+ google.protobuf.UInt32Value sidechain_number = 1 ;
193
+ google.protobuf.BytesValue data = 2 ;
194
+ }
195
+ message AckSidechain {
196
+ google.protobuf.UInt32Value sidechain_number = 1 ;
197
+ google.protobuf.BytesValue data_hash = 2 ;
198
+ }
199
+ message ProposeBundle {
200
+ google.protobuf.UInt32Value sidechain_number = 1 ;
201
+ google.protobuf.BytesValue bundle_txid = 2 ;
202
+ }
203
+ message AckBundles {
204
+ AckBundlesTag tag = 1 ;
205
+ repeated uint32 upvotes = 2 ;
206
+ }
207
+
208
+
209
+ repeated ProposeSidechain propose_sidechains = 1 ;
210
+ repeated AckSidechain ack_sidechains = 2 ;
211
+ repeated ProposeBundle propose_bundles = 3 ;
212
+ AckBundles ack_bundles = 4 ;
213
+ }
214
+ message GetCoinbasePSBTResponse {
215
+ bytes psbt = 1 ;
216
+ }
217
+
218
+ message GetCtipRequest {
219
+ google.protobuf.UInt32Value sidechain_number = 1 ;
220
+ }
221
+ message GetCtipResponse {
222
+ message Ctip {
223
+ bytes txid = 1 ;
224
+ uint32 vout = 2 ;
225
+ uint64 value = 3 ;
226
+ uint64 sequence_number = 4 ;
227
+ }
228
+ optional Ctip ctip = 1 ;
229
+ }
230
+
231
+ message GetSidechainProposalsRequest {
232
+ }
233
+ message GetSidechainProposalsResponse {
234
+ message SidechainProposal {
235
+ uint32 sidechain_number = 1 ;
236
+ bytes data = 2 ;
237
+ bytes data_hash = 3 ;
238
+ uint32 vote_count = 4 ;
239
+ uint32 proposal_height = 5 ;
240
+ uint32 proposal_age = 6 ;
241
+ }
242
+ repeated SidechainProposal sidechain_proposals = 1 ;
243
+ }
244
+
245
+ message GetSidechainsRequest {
246
+ }
247
+ message GetSidechainsResponse {
248
+ message SidechainInfo {
249
+ uint32 sidechain_number = 1 ;
250
+ bytes data = 2 ;
251
+ uint32 vote_count = 3 ;
252
+ uint32 proposal_height = 4 ;
253
+ uint32 activation_height = 5 ;
254
+ }
255
+ repeated SidechainInfo sidechains = 1 ;
256
+ }
257
+
176
258
message GetTwoWayPegDataRequest {
177
- uint32 sidechain_id = 1 ;
259
+ google.protobuf.UInt32Value sidechain_id = 1 ;
178
260
optional bytes start_block_hash = 2 ;
179
- bytes end_block_hash = 3 ;
261
+ google.protobuf.BytesValue end_block_hash = 3 ;
180
262
}
181
263
message GetTwoWayPegDataResponse {
182
264
message ResponseItem {
@@ -187,7 +269,7 @@ message GetTwoWayPegDataResponse {
187
269
}
188
270
189
271
message SubscribeEventsRequest {
190
- uint32 sidechain_id = 1 ;
272
+ google.protobuf.UInt32Value sidechain_id = 1 ;
191
273
}
192
274
message SubscribeEventsResponse {
193
275
message Event {
0 commit comments