@@ -11,10 +11,20 @@ message BlockHeaderInfo {
11
11
bytes work = 4 ;
12
12
}
13
13
14
+ message OutPoint {
15
+ bytes txid = 1 ;
16
+ uint32 vout = 2 ;
17
+ }
18
+
19
+ message Output {
20
+ bytes address = 2 ;
21
+ uint64 value_sats = 3 ;
22
+ }
23
+
14
24
message Deposit {
15
25
uint64 sequence_number = 1 ;
16
- bytes address = 2 ;
17
- uint64 value = 3 ;
26
+ OutPoint outpoint = 2 ;
27
+ Output output = 3 ;
18
28
}
19
29
20
30
enum WithdrawalBundleEventType {
@@ -28,22 +38,56 @@ message WithdrawalBundleEvent {
28
38
WithdrawalBundleEventType withdrawal_bundle_event_type = 2 ;
29
39
}
30
40
41
+ // Specific to an individual sidechain slot
31
42
message BlockInfo {
32
43
repeated Deposit deposits = 1 ;
33
44
optional WithdrawalBundleEvent withdrawal_bundle_event = 2 ;
34
- repeated bytes bmm_hashes = 3 ;
45
+ optional bytes bmm_commitment = 3 ;
35
46
}
36
47
37
48
service Mainchain {
49
+ rpc BroadcastWithdrawalBundle (BroadcastWithdrawalBundleRequest )
50
+ returns (BroadcastWithdrawalBundleResponse );
51
+ rpc CreateBmmCriticalDataTransaction (CreateBmmCriticalDataTransactionRequest )
52
+ returns (CreateBmmCriticalDataTransactionResponse );
53
+ // Regtest only
54
+ rpc GenerateBlocks (GenerateBlocksRequest )
55
+ returns (GenerateBlocksResponse );
38
56
rpc GetBlockHeaderInfo (GetBlockHeaderInfoRequest )
39
57
returns (GetBlockHeaderInfoResponse );
40
58
rpc GetBlockInfo (GetBlockInfoRequest ) returns (GetBlockInfoResponse );
41
59
rpc GetBmmHStarCommitments (GetBmmHStarCommitmentsRequest )
42
60
returns (GetBmmHStarCommitmentsResponse );
43
61
rpc GetChainTip (GetChainTipRequest ) returns (GetChainTipResponse );
62
+ rpc GetTwoWayPegData (GetTwoWayPegDataRequest )
63
+ returns (GetTwoWayPegDataResponse );
44
64
rpc SubscribeEvents (SubscribeEventsRequest ) returns (stream EventResponse );
45
65
}
46
66
67
+ message BroadcastWithdrawalBundleRequest {
68
+ uint32 sidechain_id = 1 ;
69
+ bytes transaction = 2 ;
70
+ }
71
+ message BroadcastWithdrawalBundleResponse {
72
+ }
73
+
74
+ message CreateBmmCriticalDataTransactionRequest {
75
+ uint32 sidechain_id = 1 ;
76
+ uint64 value_sats = 2 ;
77
+ uint32 height = 3 ;
78
+ bytes critical_hash = 4 ;
79
+ bytes prev_bytes = 5 ;
80
+ }
81
+ message CreateBmmCriticalDataTransactionResponse {
82
+ bytes txid = 1 ;
83
+ }
84
+
85
+ message GenerateBlocksRequest {
86
+ uint32 blocks = 1 ;
87
+ }
88
+ message GenerateBlocksResponse {
89
+ }
90
+
47
91
message GetBlockHeaderInfoRequest {
48
92
bytes block_hash = 1 ;
49
93
}
@@ -53,6 +97,7 @@ message GetBlockHeaderInfoResponse {
53
97
54
98
message GetBlockInfoRequest {
55
99
bytes block_hash = 1 ;
100
+ uint32 sidechain_id = 2 ;
56
101
}
57
102
message GetBlockInfoResponse {
58
103
BlockHeaderInfo header_info = 1 ;
@@ -64,7 +109,16 @@ message GetBmmHStarCommitmentsRequest {
64
109
uint32 sidechain_id = 2 ;
65
110
}
66
111
message GetBmmHStarCommitmentsResponse {
67
- repeated bytes commitments = 1 ;
112
+ message BlockNotFoundError {
113
+ bytes block_hash = 1 ;
114
+ }
115
+ message Commitments {
116
+ repeated bytes commitments = 1 ;
117
+ }
118
+ oneof result {
119
+ BlockNotFoundError block_not_found = 1 ;
120
+ Commitments commitments = 2 ;
121
+ }
68
122
}
69
123
70
124
message GetChainTipRequest {
@@ -73,7 +127,21 @@ message GetChainTipResponse {
73
127
BlockHeaderInfo block_header_info = 1 ;
74
128
}
75
129
130
+ message GetTwoWayPegDataRequest {
131
+ uint32 sidechain_id = 1 ;
132
+ optional bytes start_block_hash = 2 ;
133
+ bytes end_block_hash = 3 ;
134
+ }
135
+ message GetTwoWayPegDataResponse {
136
+ message ResponseItem {
137
+ BlockHeaderInfo block_header_info = 1 ;
138
+ BlockInfo block_info = 2 ;
139
+ }
140
+ repeated ResponseItem blocks = 1 ;
141
+ }
142
+
76
143
message SubscribeEventsRequest {
144
+ uint32 sidechain_id = 1 ;
77
145
}
78
146
message EventResponse {
79
147
message Event {
0 commit comments