Commit d58dda7
committed
backend/btc: use PSBT as the internal format for passing unsigned tx
PSBT BIP: https://github.com/bitcoin/bips/blob/master/bip-0174.mediawiki
bitbox02-api-go now has a `BTCSignPSBT()` function, which simplifies
the signing code in the app significantly.
Benefits include:
- Standardized, so easier for devs to understand and maintain
- Future-proofing (interopable, extensible)
- Clear lifecycle:
- Create (unsigned)
- Update (add metadata)
- Sign (BitBox)
- Extract (create sigscripts and witnesses, create final signed tx)
The btcd/psbt lib is used and contains a function to extract the tx,
which makes our own functions to create sigscripts/witnesses
redundant.
godot is removed as a linter b/c of false positives and it not being
worth wasting time over not finishing a docstring with a dot.1 parent c476bae commit d58dda7
File tree
12 files changed
+225
-351
lines changed- backend
- coins/btc
- addresses
- maketx
- devices/bitbox02
- keystore/software
12 files changed
+225
-351
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
| 123 | + | |
123 | 124 | | |
124 | 125 | | |
125 | 126 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
25 | 24 | | |
26 | 25 | | |
27 | 26 | | |
| |||
38 | 37 | | |
39 | 38 | | |
40 | 39 | | |
41 | | - | |
42 | | - | |
| 40 | + | |
| 41 | + | |
43 | 42 | | |
44 | 43 | | |
45 | | - | |
46 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| |||
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
119 | | - | |
| 119 | + | |
120 | 120 | | |
121 | | - | |
| 121 | + | |
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
| |||
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | 131 | | |
149 | 132 | | |
150 | 133 | | |
| |||
180 | 163 | | |
181 | 164 | | |
182 | 165 | | |
183 | | - | |
| 166 | + | |
184 | 167 | | |
185 | 168 | | |
186 | 169 | | |
| |||
194 | 177 | | |
195 | 178 | | |
196 | 179 | | |
197 | | - | |
| 180 | + | |
198 | 181 | | |
199 | 182 | | |
200 | 183 | | |
| |||
207 | 190 | | |
208 | 191 | | |
209 | 192 | | |
210 | | - | |
| 193 | + | |
211 | 194 | | |
212 | 195 | | |
213 | 196 | | |
| |||
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
146 | | - | |
| 146 | + | |
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| |||
49 | 50 | | |
50 | 51 | | |
51 | 52 | | |
52 | | - | |
53 | | - | |
| 53 | + | |
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| 63 | + | |
63 | 64 | | |
64 | 65 | | |
65 | 66 | | |
66 | 67 | | |
67 | | - | |
| 68 | + | |
68 | 69 | | |
69 | 70 | | |
70 | 71 | | |
| |||
209 | 210 | | |
210 | 211 | | |
211 | 212 | | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
212 | 217 | | |
213 | 218 | | |
214 | 219 | | |
215 | 220 | | |
216 | | - | |
217 | 221 | | |
218 | 222 | | |
219 | 223 | | |
220 | 224 | | |
| 225 | + | |
221 | 226 | | |
222 | 227 | | |
223 | 228 | | |
| |||
307 | 312 | | |
308 | 313 | | |
309 | 314 | | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
310 | 320 | | |
311 | 321 | | |
312 | 322 | | |
313 | 323 | | |
314 | | - | |
315 | 324 | | |
316 | 325 | | |
317 | 326 | | |
318 | 327 | | |
| 328 | + | |
319 | 329 | | |
320 | 330 | | |
321 | 331 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
168 | | - | |
| 168 | + | |
169 | 169 | | |
170 | 170 | | |
171 | 171 | | |
| |||
0 commit comments