-
Notifications
You must be signed in to change notification settings - Fork 3
/
cli.txt
276 lines (251 loc) · 14.3 KB
/
cli.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
BRIDGE CLI:
- Funding UTXOs fetched from Mempool (or fake if LOCAL). Change goes back to operator address
- Only 4 deposits / withdrwals possible at once as of right now.
- deposits.json:
{
"deposits": [
{
"from": {
"txId": "...",
"outputIndex": 0,
"address": "...",
"satoshis": 5000
},
"address": "..."
},
{
"from": {
"txId": "...",
"outputIndex": 1,
"address": "...",
"satoshis": 4000
},
"address": "..."
},
...
]
}
$ swbridge aggregate-deposits deposits.json
-> depositAggregationRes.json
{
"depositData": [
{
"address": "...",
"amount": 5000
},
{
"address": "...",
"amount": 4000
},
...
]
// "depositDataHashes": [
// '22e99994459ef19c5dc76aff4303a55fd1fb9b4c5c923557d555be0d953501ca',
// '01d86209caad8644d7a27858b715ee8d89411756e20cf1e92439cb45a4aa61c6',
// 'dbeea59b65f7e4582f42f815f78091b0843b7ab5851d1c911a219c04d0e69bcc',
// '62fc67d5aaead529677711671baad3907e9b1588085db96400e596ca440c5ddb'
// ],
"depositTree": [
[
'22e99994459ef19c5dc76aff4303a55fd1fb9b4c5c923557d555be0d953501ca',
'01d86209caad8644d7a27858b715ee8d89411756e20cf1e92439cb45a4aa61c6',
'dbeea59b65f7e4582f42f815f78091b0843b7ab5851d1c911a219c04d0e69bcc',
'62fc67d5aaead529677711671baad3907e9b1588085db96400e596ca440c5ddb'
],
[
'f84322a649476470ea134633818b9c6891c0f2a797f9efbb94bd63dafc01fc6a',
'1a3dc56d3b6e7cdf794dab67815aac3cee45a04f8fa7573ed9c4a61ceeeff9ee'
],
[
'1d1e03d03f7b51285d206415d5e71c4c5d1a2fb39fac91cc9c4f637d3924dcd6'
]
]
"txFunds": "0200000000010100000000000000000000000000000000000000000000000000000000000000000000000000ffffffff09e91000000000000016001427fcd64e5371761a2a174027b509dfc10088a366301100000000000016001427fcd64e5371761a2a174027b509dfc10088a366941100000000000016001427fcd64e5371761a2a174027b509dfc10088a366181300000000000016001427fcd64e5371761a2a174027b509dfc10088a366b80b00000000000016001427fcd64e5371761a2a174027b509dfc10088a366b80b00000000000016001427fcd64e5371761a2a174027b509dfc10088a366b80b00000000000016001427fcd64e5371761a2a174027b509dfc10088a366b80b00000000000016001427fcd64e5371761a2a174027b509dfc10088a366916f76481700000016001427fcd64e5371761a2a174027b509dfc10088a36602483045022100f56aae6dae256455ff11438566f1c596b5e31abd19e0d40fbbb0df4151b66a1102206af6aff068ca5fb02301d601b9fb75f0b2c5d4580a4f376533af837b671e52940121039868f80087096e0b607955933752428f4e697c23db0412d698a5c01918ad632800000000",
"leafTxns": [
"02000000000101bc15dd7a6a5e7c2e6d374b3a967640d265afbceb5c5f386d93abd0123cf3b7220000000000ffffffff02310500000000000022512017993071688b1a65947c292140678b293ed806a5fd99021384e8df858039e5820000000000000000226a2022e99994459ef19c5dc76aff4303a55fd1fb9b4c5c923557d555be0d953501ca02483045022100a65ed956253f08afd6602cf95adc3b6feb6f620dac5d091413ddd58d1336913e02200a646cbc8fa05f7da8902a68af2541d6d52e69e27e3b19ae4aaf19dd57a1a77b0121039868f80087096e0b607955933752428f4e697c23db0412d698a5c01918ad632800000000",
"02000000000101bc15dd7a6a5e7c2e6d374b3a967640d265afbceb5c5f386d93abd0123cf3b7220100000000ffffffff02780500000000000022512017993071688b1a65947c292140678b293ed806a5fd99021384e8df858039e5820000000000000000226a2001d86209caad8644d7a27858b715ee8d89411756e20cf1e92439cb45a4aa61c6024730440220404305d8ad563a2b7aa5883bbb21ea541858e42b79b75a0e1f0d4f9c053425d10220143f42a476a02d939a75baf2871651405bf325738ebcc5b81751570757bb2a480121039868f80087096e0b607955933752428f4e697c23db0412d698a5c01918ad632800000000",
"02000000000101bc15dd7a6a5e7c2e6d374b3a967640d265afbceb5c5f386d93abd0123cf3b7220200000000ffffffff02dc0500000000000022512017993071688b1a65947c292140678b293ed806a5fd99021384e8df858039e5820000000000000000226a20dbeea59b65f7e4582f42f815f78091b0843b7ab5851d1c911a219c04d0e69bcc0247304402203b04da28670e4e23bddcd47975dfdded1e21d14dd4c6490b1f0f56879686f8520220042ee22f4f47e1002b466976e147f84b4372107ea1ad5cf7832b3e3a9e3970750121039868f80087096e0b607955933752428f4e697c23db0412d698a5c01918ad632800000000",
"02000000000101bc15dd7a6a5e7c2e6d374b3a967640d265afbceb5c5f386d93abd0123cf3b7220300000000ffffffff02600700000000000022512017993071688b1a65947c292140678b293ed806a5fd99021384e8df858039e5820000000000000000226a2062fc67d5aaead529677711671baad3907e9b1588085db96400e596ca440c5ddb02473044022015c733c3a13265dd0f07554b051b760d0854b8c480fbd77d2318eb6b222b9dc20220735bd13b8db5475989d3d6d316fb8d111f51cbdfb3a68892d458acf133f50d120121039868f80087096e0b607955933752428f4e697c23db0412d698a5c01918ad632800000000",
],
"aggregateTxns": [
"02000000000103ffaa0ac2149ae7323...",
"02000000000103472e3ce33507c0b16...",
"02000000000103fd3ec59b9b13f9a30...",
]
}
- withdrawals.json:
{
"withdrawals": [
{
"from": {
"txId": "...",
"outputIndex": 0,
"address": "...",
"satoshis": 546
}
"address": "..."
"amount": 3000
},
{
"from": {
"txId": "...",
"outputIndex": 0,
"address": "...",
"satoshis": 546
}
"address": "..."
"amount": 2000
},
...
]
}
$ swbridge aggregate-withdrawals withdrawals.json
-> withdrawalAggregationRes.json
{
"withdrawalData": [
{
"address": "...",
"amount": 3000
},
{
"address": "...",
"amount": 2000
},
...
]
"withdrawalTree": [
[
'34d6826ebddcb9b9d64c1a347bfff398a84ed92f764574109227066af69c9032',
'306022d7544e80f6c857c402fd5ad3d8349ba2d0cad1378397d2162ef479f509',
'8c308ef4ffeed37230217d9527ddec6816f2a7932e35a3f83c48b90c85d23e3f',
'22ad4de20123ecaa1c4d4f48d8b138cfcbe3c3abf9bff99df4d1d0fe05e66c1c'
],
[
'd3c94a14ce2efe37698e8c1ade0f92fafb08eb015484c35dec63d4758a3398ec',
'c1a50aa4b3a0dc05e4c1a79fdf3adaf3486508414f374c08a58c8b430c2a534c'
],
[
'e55b5b39359e38d8995a7b971d0163dcd966896e5044289e99a1dcf8642dcf66'
]
],
//"intermediateSums": [
// [
// '0807000000000000',
// 'a206000000000000',
// '0000000000000000',
// '0000000000000000',
// '0000000000000000',
// '0000000000000000',
// '0000000000000000',
// '0000000000000000'
// ],
// [
// 'aa0d000000000000',
// '0000000000000000',
// '0000000000000000',
// '0000000000000000'
// ],
// [ 'aa0d000000000000', '0000000000000000' ],
// [ 'aa0d000000000000' ]
//],
"txFunds": "0200000000010100000000000000000000000000000000000000000000000000000000000000000000000000ffffffff09e91000000000000016001427fcd64e5371761a2a174027b509dfc10088a366301100000000000016001427fcd64e5371761a2a174027b509dfc10088a366941100000000000016001427fcd64e5371761a2a174027b509dfc10088a366181300000000000016001427fcd64e5371761a2a174027b509dfc10088a366b80b00000000000016001427fcd64e5371761a2a174027b509dfc10088a366b80b00000000000016001427fcd64e5371761a2a174027b509dfc10088a366b80b00000000000016001427fcd64e5371761a2a174027b509dfc10088a366b80b00000000000016001427fcd64e5371761a2a174027b509dfc10088a366916f76481700000016001427fcd64e5371761a2a174027b509dfc10088a36602483045022100f56aae6dae256455ff11438566f1c596b5e31abd19e0d40fbbb0df4151b66a1102206af6aff068ca5fb02301d601b9fb75f0b2c5d4580a4f376533af837b671e52940121039868f80087096e0b607955933752428f4e697c23db0412d698a5c01918ad632800000000",
"leafTxns": [
"02000000000101bc15dd7a6a5e7c2e6d374b3a967640d265afbceb5c5f386d93abd0123cf3b7220000000000ffffffff02310500000000000022512017993071688b1a65947c292140678b293ed806a5fd99021384e8df858039e5820000000000000000226a2022e99994459ef19c5dc76aff4303a55fd1fb9b4c5c923557d555be0d953501ca02483045022100a65ed956253f08afd6602cf95adc3b6feb6f620dac5d091413ddd58d1336913e02200a646cbc8fa05f7da8902a68af2541d6d52e69e27e3b19ae4aaf19dd57a1a77b0121039868f80087096e0b607955933752428f4e697c23db0412d698a5c01918ad632800000000",
"02000000000101bc15dd7a6a5e7c2e6d374b3a967640d265afbceb5c5f386d93abd0123cf3b7220100000000ffffffff02780500000000000022512017993071688b1a65947c292140678b293ed806a5fd99021384e8df858039e5820000000000000000226a2001d86209caad8644d7a27858b715ee8d89411756e20cf1e92439cb45a4aa61c6024730440220404305d8ad563a2b7aa5883bbb21ea541858e42b79b75a0e1f0d4f9c053425d10220143f42a476a02d939a75baf2871651405bf325738ebcc5b81751570757bb2a480121039868f80087096e0b607955933752428f4e697c23db0412d698a5c01918ad632800000000",
"02000000000101bc15dd7a6a5e7c2e6d374b3a967640d265afbceb5c5f386d93abd0123cf3b7220200000000ffffffff02dc0500000000000022512017993071688b1a65947c292140678b293ed806a5fd99021384e8df858039e5820000000000000000226a20dbeea59b65f7e4582f42f815f78091b0843b7ab5851d1c911a219c04d0e69bcc0247304402203b04da28670e4e23bddcd47975dfdded1e21d14dd4c6490b1f0f56879686f8520220042ee22f4f47e1002b466976e147f84b4372107ea1ad5cf7832b3e3a9e3970750121039868f80087096e0b607955933752428f4e697c23db0412d698a5c01918ad632800000000",
"02000000000101bc15dd7a6a5e7c2e6d374b3a967640d265afbceb5c5f386d93abd0123cf3b7220300000000ffffffff02600700000000000022512017993071688b1a65947c292140678b293ed806a5fd99021384e8df858039e5820000000000000000226a2062fc67d5aaead529677711671baad3907e9b1588085db96400e596ca440c5ddb02473044022015c733c3a13265dd0f07554b051b760d0854b8c480fbd77d2318eb6b222b9dc20220735bd13b8db5475989d3d6d316fb8d111f51cbdfb3a68892d458acf133f50d120121039868f80087096e0b607955933752428f4e697c23db0412d698a5c01918ad632800000000",
],
"aggregateTxns": [
"02000000000103ffaa0ac2149ae7323...",
"02000000000103472e3ce33507c0b16...",
"02000000000103fd3ec59b9b13f9a30...",
]
}
----------------------------------
----------------------------------
----------------------------------
----------------------------------
bridgeParams.json
{
"operatorPubKey": "..."
}
$ swbridge bridge-deploy bridgeParams.json
-> bridgeData.json
{
"latestBridgeTxn": "..."
"accoutns": [
{ address: '0000000000000000000000000000000000000000', balance: 0n },
{ address: '0000000000000000000000000000000000000000', balance: 0n },
{ address: '0000000000000000000000000000000000000000', balance: 0n },
{ address: '0000000000000000000000000000000000000000', balance: 0n },
{ address: '0000000000000000000000000000000000000000', balance: 0n },
{ address: '0000000000000000000000000000000000000000', balance: 0n },
{ address: '0000000000000000000000000000000000000000', balance: 0n },
{ address: '0000000000000000000000000000000000000000', balance: 0n },
{ address: '0000000000000000000000000000000000000000', balance: 0n },
{ address: '0000000000000000000000000000000000000000', balance: 0n },
{ address: '0000000000000000000000000000000000000000', balance: 0n },
{ address: '0000000000000000000000000000000000000000', balance: 0n },
{ address: '0000000000000000000000000000000000000000', balance: 0n },
{ address: '0000000000000000000000000000000000000000', balance: 0n },
{ address: '0000000000000000000000000000000000000000', balance: 0n },
{ address: '0000000000000000000000000000000000000000', balance: 0n }
]
"accountsTree": [
[
'41bffa41db9c3ec7dcfbf1e57310feb4bc51f3d17c0635d8ad7eb61a6823f21d',
'92f465a78af963af495cc77e737afec44e18fd9c632864eddc9c0a3e388f9be6',
'306022d7544e80f6c857c402fd5ad3d8349ba2d0cad1378397d2162ef479f509',
'5c19d5c5acf74e9c2cd74baabfc5acbf11525f230f47997b60e2cfa628cfc100',
'1750a788399805fa8448f42c8d210192a3425466e6d4629361a310d53b7b9240',
'1750a788399805fa8448f42c8d210192a3425466e6d4629361a310d53b7b9240',
'1750a788399805fa8448f42c8d210192a3425466e6d4629361a310d53b7b9240',
'1750a788399805fa8448f42c8d210192a3425466e6d4629361a310d53b7b9240',
'1750a788399805fa8448f42c8d210192a3425466e6d4629361a310d53b7b9240',
'1750a788399805fa8448f42c8d210192a3425466e6d4629361a310d53b7b9240',
'1750a788399805fa8448f42c8d210192a3425466e6d4629361a310d53b7b9240',
'1750a788399805fa8448f42c8d210192a3425466e6d4629361a310d53b7b9240',
'1750a788399805fa8448f42c8d210192a3425466e6d4629361a310d53b7b9240',
'1750a788399805fa8448f42c8d210192a3425466e6d4629361a310d53b7b9240',
'1750a788399805fa8448f42c8d210192a3425466e6d4629361a310d53b7b9240',
'1750a788399805fa8448f42c8d210192a3425466e6d4629361a310d53b7b9240'
],
[
'bac07c1f9e40cf21910e739e8b1af074fb57d3280ff433b993d2cb811e87d3d0',
'5e93fc4495baf5c4fdb7ba45a6f0f0fd6270899193ad4f2ac48e21a433a2fd54',
'31a5686667e62541396b4dbf3a074a9048541a411f38cebd8d48b592c6cb3a44',
'31a5686667e62541396b4dbf3a074a9048541a411f38cebd8d48b592c6cb3a44',
'31a5686667e62541396b4dbf3a074a9048541a411f38cebd8d48b592c6cb3a44',
'31a5686667e62541396b4dbf3a074a9048541a411f38cebd8d48b592c6cb3a44',
'31a5686667e62541396b4dbf3a074a9048541a411f38cebd8d48b592c6cb3a44',
'31a5686667e62541396b4dbf3a074a9048541a411f38cebd8d48b592c6cb3a44'
],
[
'65c2ed5e53ebac803f1f89ea4623b67c96bc49bfddb06d7e55f6983a9d68480e',
'bfb0707ca83d54f673fc0d4c8b8db9b8d5ae1a97e6f223a40c6053bdd2b7e86d',
'bfb0707ca83d54f673fc0d4c8b8db9b8d5ae1a97e6f223a40c6053bdd2b7e86d',
'bfb0707ca83d54f673fc0d4c8b8db9b8d5ae1a97e6f223a40c6053bdd2b7e86d'
],
[
'd95e68f5116553eff0802c437e0791490a052c472cce5d97582e8495bb70f14b',
'88cca65cbfef4fc7fc9904935ecd4319522e3873225dce62a90c6c881a7aea6f'
],
[
'a91e103893e18ca003aae2b1a31d3eccdbef48370614a53c078bb2f37151e241'
]
]
}
$ swbridge bridge-merge-deposits bridgeData.json depositAggregationRes.json
-> bridgeData.json
$ swbridge bridge-merge-deposits bridgeData.json withdrawalAggregationRes.json
-> bridgeData.json
$ swbridge expand-withdrawals bridgeData.json withdrawalAggregationRes.json
-> bridgeData.json
-> withdrawalExpansionRes.json
{
"expanderNodeTxns": [
...
]
"leafTxns": [
]
}