@btc-vision/bitcoin 7.0.0-alpha.0 → 7.0.0-alpha.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (369) hide show
  1. package/README.md +455 -155
  2. package/browser/address.d.ts +6 -2
  3. package/browser/address.d.ts.map +1 -1
  4. package/browser/block.d.ts.map +1 -1
  5. package/browser/branded.d.ts +3 -14
  6. package/browser/branded.d.ts.map +1 -1
  7. package/browser/chunks/psbt-parallel-BBFlkmiv.js +10717 -0
  8. package/browser/crypto.d.ts +1 -1
  9. package/browser/ecc/context.d.ts +25 -24
  10. package/browser/ecc/context.d.ts.map +1 -1
  11. package/browser/ecc/index.d.ts +1 -1
  12. package/browser/ecc/index.d.ts.map +1 -1
  13. package/browser/ecc/types.d.ts +10 -123
  14. package/browser/ecc/types.d.ts.map +1 -1
  15. package/browser/env.d.ts +13 -0
  16. package/browser/env.d.ts.map +1 -0
  17. package/browser/index.d.ts +7 -7
  18. package/browser/index.d.ts.map +1 -1
  19. package/browser/index.js +2497 -11686
  20. package/browser/io/BinaryReader.d.ts +15 -15
  21. package/browser/io/BinaryReader.d.ts.map +1 -1
  22. package/browser/io/BinaryWriter.d.ts +17 -17
  23. package/browser/io/BinaryWriter.d.ts.map +1 -1
  24. package/browser/io/hex.d.ts.map +1 -1
  25. package/browser/io/index.d.ts +0 -1
  26. package/browser/io/index.d.ts.map +1 -1
  27. package/browser/opcodes.d.ts +11 -0
  28. package/browser/opcodes.d.ts.map +1 -1
  29. package/browser/payments/bip341.d.ts +1 -1
  30. package/browser/payments/bip341.d.ts.map +1 -1
  31. package/browser/payments/embed.d.ts +1 -1
  32. package/browser/payments/embed.d.ts.map +1 -1
  33. package/browser/payments/p2ms.d.ts.map +1 -1
  34. package/browser/payments/p2op.d.ts +1 -1
  35. package/browser/payments/p2op.d.ts.map +1 -1
  36. package/browser/payments/p2pk.d.ts +1 -1
  37. package/browser/payments/p2pk.d.ts.map +1 -1
  38. package/browser/payments/p2pkh.d.ts +1 -1
  39. package/browser/payments/p2pkh.d.ts.map +1 -1
  40. package/browser/payments/p2sh.d.ts.map +1 -1
  41. package/browser/payments/p2tr.d.ts +2 -2
  42. package/browser/payments/p2tr.d.ts.map +1 -1
  43. package/browser/payments/p2wpkh.d.ts +1 -1
  44. package/browser/payments/p2wpkh.d.ts.map +1 -1
  45. package/browser/payments/p2wsh.d.ts.map +1 -1
  46. package/browser/payments/types.d.ts +1 -1
  47. package/browser/payments/types.d.ts.map +1 -1
  48. package/browser/psbt/PsbtCache.d.ts +54 -0
  49. package/browser/psbt/PsbtCache.d.ts.map +1 -0
  50. package/browser/psbt/PsbtFinalizer.d.ts +21 -0
  51. package/browser/psbt/PsbtFinalizer.d.ts.map +1 -0
  52. package/browser/psbt/PsbtSigner.d.ts +32 -0
  53. package/browser/psbt/PsbtSigner.d.ts.map +1 -0
  54. package/browser/psbt/PsbtTransaction.d.ts +25 -0
  55. package/browser/psbt/PsbtTransaction.d.ts.map +1 -0
  56. package/browser/psbt/bip371.d.ts.map +1 -1
  57. package/browser/psbt/types.d.ts +5 -71
  58. package/browser/psbt/types.d.ts.map +1 -1
  59. package/browser/psbt/validation.d.ts +1 -1
  60. package/browser/psbt/validation.d.ts.map +1 -1
  61. package/browser/psbt.d.ts +26 -40
  62. package/browser/psbt.d.ts.map +1 -1
  63. package/browser/script.d.ts.map +1 -1
  64. package/browser/transaction.d.ts +4 -4
  65. package/browser/transaction.d.ts.map +1 -1
  66. package/browser/types.d.ts +5 -3
  67. package/browser/types.d.ts.map +1 -1
  68. package/browser/workers/WorkerSigningPool.d.ts +24 -17
  69. package/browser/workers/WorkerSigningPool.d.ts.map +1 -1
  70. package/browser/workers/WorkerSigningPool.node.d.ts +19 -12
  71. package/browser/workers/WorkerSigningPool.node.d.ts.map +1 -1
  72. package/browser/workers/WorkerSigningPool.sequential.d.ts +67 -0
  73. package/browser/workers/WorkerSigningPool.sequential.d.ts.map +1 -0
  74. package/browser/workers/WorkerSigningPool.worklet.d.ts +64 -0
  75. package/browser/workers/WorkerSigningPool.worklet.d.ts.map +1 -0
  76. package/browser/workers/index.browser.d.ts +16 -0
  77. package/browser/workers/index.browser.d.ts.map +1 -0
  78. package/browser/workers/index.d.ts +4 -64
  79. package/browser/workers/index.d.ts.map +1 -1
  80. package/browser/workers/index.js +28 -0
  81. package/browser/workers/index.node.d.ts +17 -0
  82. package/browser/workers/index.node.d.ts.map +1 -0
  83. package/browser/workers/index.react-native.d.ts +28 -0
  84. package/browser/workers/index.react-native.d.ts.map +1 -0
  85. package/browser/workers/index.shared.d.ts +15 -0
  86. package/browser/workers/index.shared.d.ts.map +1 -0
  87. package/browser/workers/psbt-parallel.d.ts +2 -3
  88. package/browser/workers/psbt-parallel.d.ts.map +1 -1
  89. package/browser/workers/types.d.ts +17 -0
  90. package/browser/workers/types.d.ts.map +1 -1
  91. package/build/address.d.ts +6 -2
  92. package/build/address.d.ts.map +1 -1
  93. package/build/address.js +32 -19
  94. package/build/address.js.map +1 -1
  95. package/build/bech32utils.js.map +1 -1
  96. package/build/block.d.ts.map +1 -1
  97. package/build/block.js +2 -4
  98. package/build/block.js.map +1 -1
  99. package/build/branded.d.ts +3 -14
  100. package/build/branded.d.ts.map +1 -1
  101. package/build/branded.js +0 -5
  102. package/build/branded.js.map +1 -1
  103. package/build/crypto.d.ts +1 -1
  104. package/build/ecc/context.d.ts +25 -24
  105. package/build/ecc/context.d.ts.map +1 -1
  106. package/build/ecc/context.js +29 -101
  107. package/build/ecc/context.js.map +1 -1
  108. package/build/ecc/index.d.ts +1 -1
  109. package/build/ecc/index.d.ts.map +1 -1
  110. package/build/ecc/types.d.ts +7 -126
  111. package/build/ecc/types.d.ts.map +1 -1
  112. package/build/ecc/types.js +4 -1
  113. package/build/ecc/types.js.map +1 -1
  114. package/build/env.d.ts +13 -0
  115. package/build/env.d.ts.map +1 -0
  116. package/build/env.js +198 -0
  117. package/build/env.js.map +1 -0
  118. package/build/index.d.ts +8 -7
  119. package/build/index.d.ts.map +1 -1
  120. package/build/index.js +9 -7
  121. package/build/index.js.map +1 -1
  122. package/build/io/BinaryReader.d.ts +15 -15
  123. package/build/io/BinaryReader.d.ts.map +1 -1
  124. package/build/io/BinaryReader.js +17 -17
  125. package/build/io/BinaryReader.js.map +1 -1
  126. package/build/io/BinaryWriter.d.ts +17 -17
  127. package/build/io/BinaryWriter.d.ts.map +1 -1
  128. package/build/io/BinaryWriter.js +39 -39
  129. package/build/io/BinaryWriter.js.map +1 -1
  130. package/build/io/hex.d.ts.map +1 -1
  131. package/build/io/hex.js +2 -1
  132. package/build/io/hex.js.map +1 -1
  133. package/build/io/index.d.ts +0 -1
  134. package/build/io/index.d.ts.map +1 -1
  135. package/build/io/index.js +0 -2
  136. package/build/io/index.js.map +1 -1
  137. package/build/opcodes.d.ts +11 -0
  138. package/build/opcodes.d.ts.map +1 -1
  139. package/build/opcodes.js +19 -4
  140. package/build/opcodes.js.map +1 -1
  141. package/build/payments/bip341.d.ts +1 -2
  142. package/build/payments/bip341.d.ts.map +1 -1
  143. package/build/payments/bip341.js +1 -2
  144. package/build/payments/bip341.js.map +1 -1
  145. package/build/payments/embed.d.ts +1 -1
  146. package/build/payments/embed.d.ts.map +1 -1
  147. package/build/payments/embed.js +14 -14
  148. package/build/payments/embed.js.map +1 -1
  149. package/build/payments/p2ms.d.ts.map +1 -1
  150. package/build/payments/p2ms.js +21 -21
  151. package/build/payments/p2ms.js.map +1 -1
  152. package/build/payments/p2op.d.ts +1 -1
  153. package/build/payments/p2op.d.ts.map +1 -1
  154. package/build/payments/p2op.js +18 -18
  155. package/build/payments/p2op.js.map +1 -1
  156. package/build/payments/p2pk.d.ts +1 -1
  157. package/build/payments/p2pk.d.ts.map +1 -1
  158. package/build/payments/p2pk.js +17 -17
  159. package/build/payments/p2pk.js.map +1 -1
  160. package/build/payments/p2pkh.d.ts +1 -1
  161. package/build/payments/p2pkh.d.ts.map +1 -1
  162. package/build/payments/p2pkh.js +20 -20
  163. package/build/payments/p2pkh.js.map +1 -1
  164. package/build/payments/p2sh.d.ts.map +1 -1
  165. package/build/payments/p2sh.js +22 -20
  166. package/build/payments/p2sh.js.map +1 -1
  167. package/build/payments/p2tr.d.ts +2 -2
  168. package/build/payments/p2tr.d.ts.map +1 -1
  169. package/build/payments/p2tr.js +25 -26
  170. package/build/payments/p2tr.js.map +1 -1
  171. package/build/payments/p2wpkh.d.ts +1 -1
  172. package/build/payments/p2wpkh.d.ts.map +1 -1
  173. package/build/payments/p2wpkh.js +20 -20
  174. package/build/payments/p2wpkh.js.map +1 -1
  175. package/build/payments/p2wsh.d.ts.map +1 -1
  176. package/build/payments/p2wsh.js +22 -22
  177. package/build/payments/p2wsh.js.map +1 -1
  178. package/build/payments/types.d.ts +1 -1
  179. package/build/payments/types.d.ts.map +1 -1
  180. package/build/psbt/PsbtCache.d.ts +54 -0
  181. package/build/psbt/PsbtCache.d.ts.map +1 -0
  182. package/build/psbt/PsbtCache.js +249 -0
  183. package/build/psbt/PsbtCache.js.map +1 -0
  184. package/build/psbt/PsbtFinalizer.d.ts +21 -0
  185. package/build/psbt/PsbtFinalizer.d.ts.map +1 -0
  186. package/build/psbt/PsbtFinalizer.js +157 -0
  187. package/build/psbt/PsbtFinalizer.js.map +1 -0
  188. package/build/psbt/PsbtSigner.d.ts +32 -0
  189. package/build/psbt/PsbtSigner.d.ts.map +1 -0
  190. package/build/psbt/PsbtSigner.js +192 -0
  191. package/build/psbt/PsbtSigner.js.map +1 -0
  192. package/build/psbt/PsbtTransaction.d.ts +25 -0
  193. package/build/psbt/PsbtTransaction.d.ts.map +1 -0
  194. package/build/psbt/PsbtTransaction.js +61 -0
  195. package/build/psbt/PsbtTransaction.js.map +1 -0
  196. package/build/psbt/bip371.d.ts.map +1 -1
  197. package/build/psbt/bip371.js +6 -2
  198. package/build/psbt/bip371.js.map +1 -1
  199. package/build/psbt/psbtutils.js +1 -1
  200. package/build/psbt/psbtutils.js.map +1 -1
  201. package/build/psbt/types.d.ts +5 -71
  202. package/build/psbt/types.d.ts.map +1 -1
  203. package/build/psbt/validation.d.ts +1 -1
  204. package/build/psbt/validation.d.ts.map +1 -1
  205. package/build/psbt/validation.js +1 -1
  206. package/build/psbt/validation.js.map +1 -1
  207. package/build/psbt.d.ts +26 -40
  208. package/build/psbt.d.ts.map +1 -1
  209. package/build/psbt.js +180 -808
  210. package/build/psbt.js.map +1 -1
  211. package/build/script.d.ts.map +1 -1
  212. package/build/script.js +4 -4
  213. package/build/script.js.map +1 -1
  214. package/build/transaction.d.ts +4 -4
  215. package/build/transaction.d.ts.map +1 -1
  216. package/build/transaction.js +6 -5
  217. package/build/transaction.js.map +1 -1
  218. package/build/tsconfig.build.tsbuildinfo +1 -1
  219. package/build/types.d.ts +5 -3
  220. package/build/types.d.ts.map +1 -1
  221. package/build/types.js +14 -25
  222. package/build/types.js.map +1 -1
  223. package/build/workers/WorkerSigningPool.d.ts +24 -17
  224. package/build/workers/WorkerSigningPool.d.ts.map +1 -1
  225. package/build/workers/WorkerSigningPool.js +36 -25
  226. package/build/workers/WorkerSigningPool.js.map +1 -1
  227. package/build/workers/WorkerSigningPool.node.d.ts +19 -12
  228. package/build/workers/WorkerSigningPool.node.d.ts.map +1 -1
  229. package/build/workers/WorkerSigningPool.node.js +60 -28
  230. package/build/workers/WorkerSigningPool.node.js.map +1 -1
  231. package/build/workers/WorkerSigningPool.sequential.d.ts +76 -0
  232. package/build/workers/WorkerSigningPool.sequential.d.ts.map +1 -0
  233. package/build/workers/WorkerSigningPool.sequential.js +160 -0
  234. package/build/workers/WorkerSigningPool.sequential.js.map +1 -0
  235. package/build/workers/WorkerSigningPool.worklet.d.ts +79 -0
  236. package/build/workers/WorkerSigningPool.worklet.d.ts.map +1 -0
  237. package/build/workers/WorkerSigningPool.worklet.js +390 -0
  238. package/build/workers/WorkerSigningPool.worklet.js.map +1 -0
  239. package/build/workers/index.browser.d.ts +24 -0
  240. package/build/workers/index.browser.d.ts.map +1 -0
  241. package/build/workers/index.browser.js +30 -0
  242. package/build/workers/index.browser.js.map +1 -0
  243. package/build/workers/index.d.ts +6 -18
  244. package/build/workers/index.d.ts.map +1 -1
  245. package/build/workers/index.js +12 -14
  246. package/build/workers/index.js.map +1 -1
  247. package/build/workers/index.node.d.ts +38 -0
  248. package/build/workers/index.node.d.ts.map +1 -0
  249. package/build/workers/index.node.js +45 -0
  250. package/build/workers/index.node.js.map +1 -0
  251. package/build/workers/index.react-native.d.ts +28 -0
  252. package/build/workers/index.react-native.d.ts.map +1 -0
  253. package/build/workers/index.react-native.js +67 -0
  254. package/build/workers/index.react-native.js.map +1 -0
  255. package/build/workers/index.shared.d.ts +15 -0
  256. package/build/workers/index.shared.d.ts.map +1 -0
  257. package/build/workers/index.shared.js +20 -0
  258. package/build/workers/index.shared.js.map +1 -0
  259. package/build/workers/psbt-parallel.d.ts +2 -3
  260. package/build/workers/psbt-parallel.d.ts.map +1 -1
  261. package/build/workers/psbt-parallel.js +4 -4
  262. package/build/workers/psbt-parallel.js.map +1 -1
  263. package/build/workers/types.d.ts +17 -0
  264. package/build/workers/types.d.ts.map +1 -1
  265. package/build/workers/types.js.map +1 -1
  266. package/package.json +48 -9
  267. package/src/address.ts +53 -21
  268. package/src/bech32utils.ts +3 -3
  269. package/src/block.ts +17 -10
  270. package/src/branded.ts +15 -13
  271. package/src/crypto.ts +1 -1
  272. package/src/ecc/context.ts +36 -136
  273. package/src/ecc/index.ts +2 -2
  274. package/src/ecc/types.ts +7 -145
  275. package/src/env.ts +239 -0
  276. package/src/index.ts +57 -22
  277. package/src/io/BinaryReader.ts +18 -18
  278. package/src/io/BinaryWriter.ts +43 -43
  279. package/src/io/hex.ts +2 -1
  280. package/src/io/index.ts +0 -3
  281. package/src/opcodes.ts +21 -4
  282. package/src/payments/bip341.ts +5 -7
  283. package/src/payments/embed.ts +19 -19
  284. package/src/payments/p2ms.ts +34 -27
  285. package/src/payments/p2op.ts +22 -22
  286. package/src/payments/p2pk.ts +22 -22
  287. package/src/payments/p2pkh.ts +28 -28
  288. package/src/payments/p2sh.ts +33 -30
  289. package/src/payments/p2tr.ts +40 -40
  290. package/src/payments/p2wpkh.ts +30 -30
  291. package/src/payments/p2wsh.ts +29 -29
  292. package/src/payments/types.ts +1 -1
  293. package/src/psbt/PsbtCache.ts +325 -0
  294. package/src/psbt/PsbtFinalizer.ts +213 -0
  295. package/src/psbt/PsbtSigner.ts +302 -0
  296. package/src/psbt/PsbtTransaction.ts +82 -0
  297. package/src/psbt/bip371.ts +7 -3
  298. package/src/psbt/psbtutils.ts +1 -1
  299. package/src/psbt/types.ts +5 -94
  300. package/src/psbt/validation.ts +5 -12
  301. package/src/psbt.ts +376 -1201
  302. package/src/script.ts +6 -9
  303. package/src/transaction.ts +19 -15
  304. package/src/types.ts +33 -45
  305. package/src/workers/WorkerSigningPool.node.ts +72 -36
  306. package/src/workers/WorkerSigningPool.sequential.ts +191 -0
  307. package/src/workers/WorkerSigningPool.ts +48 -39
  308. package/src/workers/WorkerSigningPool.worklet.ts +522 -0
  309. package/src/workers/index.browser.ts +34 -0
  310. package/src/workers/index.node.ts +50 -0
  311. package/src/workers/index.react-native.ts +110 -0
  312. package/src/workers/index.shared.ts +58 -0
  313. package/src/workers/index.ts +14 -65
  314. package/src/workers/psbt-parallel.ts +8 -13
  315. package/src/workers/types.ts +26 -1
  316. package/test/address.spec.ts +2 -2
  317. package/test/bitcoin.core.spec.ts +5 -2
  318. package/test/browser/payments.spec.ts +151 -0
  319. package/test/browser/psbt.spec.ts +1510 -0
  320. package/test/browser/script.spec.ts +223 -0
  321. package/test/browser/setup.ts +13 -0
  322. package/test/browser/workers-signing.spec.ts +537 -0
  323. package/test/crypto.spec.ts +2 -2
  324. package/test/env.spec.ts +418 -0
  325. package/test/fixtures/core/base58_encode_decode.json +12 -48
  326. package/test/fixtures/core/base58_keys_invalid.json +50 -150
  327. package/test/fixtures/core/sighash.json +1 -3
  328. package/test/fixtures/core/tx_valid.json +133 -501
  329. package/test/fixtures/embed.json +3 -11
  330. package/test/fixtures/p2ms.json +21 -91
  331. package/test/fixtures/p2pk.json +5 -24
  332. package/test/fixtures/p2pkh.json +7 -36
  333. package/test/fixtures/p2sh.json +8 -54
  334. package/test/fixtures/p2tr.json +2 -6
  335. package/test/fixtures/p2wpkh.json +7 -36
  336. package/test/fixtures/p2wsh.json +14 -59
  337. package/test/fixtures/psbt.json +2 -6
  338. package/test/fixtures/script.json +12 -48
  339. package/test/integration/addresses.spec.ts +11 -5
  340. package/test/integration/bip32.spec.ts +1 -1
  341. package/test/integration/cltv.spec.ts +10 -6
  342. package/test/integration/csv.spec.ts +10 -9
  343. package/test/integration/payments.spec.ts +8 -4
  344. package/test/integration/taproot.spec.ts +26 -6
  345. package/test/integration/transactions.spec.ts +22 -8
  346. package/test/payments.spec.ts +1 -1
  347. package/test/payments.utils.ts +1 -1
  348. package/test/psbt.spec.ts +250 -64
  349. package/test/script_signature.spec.ts +1 -1
  350. package/test/transaction.spec.ts +18 -5
  351. package/test/tsconfig.json +6 -20
  352. package/test/workers-pool.spec.ts +65 -23
  353. package/test/workers-sequential.spec.ts +669 -0
  354. package/test/workers-signing.spec.ts +7 -3
  355. package/test/workers-worklet.spec.ts +500 -0
  356. package/test/workers.spec.ts +6 -7
  357. package/typedoc.json +39 -0
  358. package/vite.config.browser.ts +31 -6
  359. package/vitest.config.browser.ts +68 -0
  360. package/browser/ecpair.d.ts +0 -99
  361. package/browser/io/MemoryPool.d.ts +0 -220
  362. package/browser/io/MemoryPool.d.ts.map +0 -1
  363. package/build/io/MemoryPool.d.ts +0 -220
  364. package/build/io/MemoryPool.d.ts.map +0 -1
  365. package/build/io/MemoryPool.js +0 -309
  366. package/build/io/MemoryPool.js.map +0 -1
  367. package/src/ecpair.d.ts +0 -99
  368. package/src/io/MemoryPool.ts +0 -343
  369. package/test/taproot-cache.spec.ts +0 -694
@@ -1,4 +1,4 @@
1
- import { Bytes32, Bytes20 } from './types.js';
1
+ import { Bytes20, Bytes32 } from './types.js';
2
2
  /**
3
3
  * Computes RIPEMD-160 hash of the input.
4
4
  * @param data - Input data
@@ -1,4 +1,4 @@
1
- import { EccLib } from './types.js';
1
+ import { CryptoBackend } from '@btc-vision/ecpair';
2
2
  /**
3
3
  * Context class for managing the ECC library instance.
4
4
  * Uses dependency injection pattern instead of global singleton.
@@ -6,10 +6,11 @@ import { EccLib } from './types.js';
6
6
  * @example
7
7
  * ```typescript
8
8
  * import { EccContext } from '@btc-vision/bitcoin';
9
- * import * as secp256k1 from 'tiny-secp256k1';
9
+ * import { createNobleBackend } from '@btc-vision/ecpair';
10
10
  *
11
11
  * // Initialize once at app startup
12
- * EccContext.init(secp256k1);
12
+ * const backend = createNobleBackend();
13
+ * EccContext.init(backend);
13
14
  *
14
15
  * // Get instance anywhere in your code
15
16
  * const ecc = EccContext.get();
@@ -21,23 +22,27 @@ import { EccLib } from './types.js';
21
22
  export declare class EccContext {
22
23
  #private;
23
24
  private constructor();
25
+ /**
26
+ * The underlying ECC library instance.
27
+ */
28
+ get lib(): CryptoBackend;
24
29
  /**
25
30
  * Initializes the ECC context with the provided library.
26
31
  * The library is verified before being set as active.
27
32
  *
28
- * @param lib - The ECC library instance to initialize
33
+ * @param lib - The CryptoBackend instance to initialize
29
34
  * @returns The initialized EccContext instance
30
- * @throws Error if the ECC library fails verification
35
+ * @throws Error if the CryptoBackend fails verification
31
36
  *
32
37
  * @example
33
38
  * ```typescript
34
39
  * import { EccContext } from '@btc-vision/bitcoin';
35
- * import * as secp256k1 from 'tiny-secp256k1';
40
+ * import { createNobleBackend } from '@btc-vision/ecpair';
36
41
  *
37
- * const context = EccContext.init(secp256k1);
42
+ * const context = EccContext.init(createNobleBackend());
38
43
  * ```
39
44
  */
40
- static init(lib: EccLib): EccContext;
45
+ static init(lib: CryptoBackend): EccContext;
41
46
  /**
42
47
  * Gets the initialized ECC context.
43
48
  *
@@ -49,7 +54,7 @@ export declare class EccContext {
49
54
  * import { EccContext } from '@btc-vision/bitcoin';
50
55
  *
51
56
  * const context = EccContext.get();
52
- * const isValid = context.lib.isXOnlyPoint(someKey);
57
+ * const tweaked = context.lib.xOnlyPointAddTweak(key, tweak);
53
58
  * ```
54
59
  */
55
60
  static get(): EccContext;
@@ -76,54 +81,50 @@ export declare class EccContext {
76
81
  * import { EccContext } from '@btc-vision/bitcoin';
77
82
  *
78
83
  * if (!EccContext.isInitialized()) {
79
- * EccContext.init(secp256k1);
84
+ * EccContext.init(createNobleBackend());
80
85
  * }
81
86
  * ```
82
87
  */
83
88
  static isInitialized(): boolean;
84
- /**
85
- * The underlying ECC library instance.
86
- */
87
- get lib(): EccLib;
88
89
  }
89
90
  /**
90
91
  * Initializes the ECC library with the provided instance.
91
92
  * This is a convenience function that wraps EccContext.init().
92
93
  * Pass `undefined` to clear the library.
93
94
  *
94
- * @param eccLib - The ECC library instance to initialize, or undefined to clear
95
- * @throws Error if the ECC library fails verification
95
+ * @param eccLib - The CryptoBackend instance to initialize, or undefined to clear
96
+ * @throws Error if the CryptoBackend fails verification
96
97
  *
97
98
  * @example
98
99
  * ```typescript
99
100
  * import { initEccLib } from '@btc-vision/bitcoin';
100
- * import * as secp256k1 from 'tiny-secp256k1';
101
+ * import { createNobleBackend } from '@btc-vision/ecpair';
101
102
  *
102
103
  * // Initialize the ECC library
103
- * initEccLib(secp256k1);
104
+ * initEccLib(createNobleBackend());
104
105
  *
105
106
  * // Clear the library
106
107
  * initEccLib(undefined);
107
108
  * ```
108
109
  */
109
- export declare function initEccLib(eccLib: EccLib | undefined): void;
110
+ export declare function initEccLib(eccLib: CryptoBackend | undefined): void;
110
111
  /**
111
112
  * Retrieves the initialized ECC library instance.
112
113
  * This is a convenience function that wraps EccContext.get().lib.
113
114
  *
114
- * @returns The ECC library instance
115
+ * @returns The CryptoBackend instance
115
116
  * @throws Error if the ECC library has not been initialized
116
117
  *
117
118
  * @example
118
119
  * ```typescript
119
120
  * import { getEccLib, initEccLib } from '@btc-vision/bitcoin';
120
- * import * as secp256k1 from 'tiny-secp256k1';
121
+ * import { createNobleBackend } from '@btc-vision/ecpair';
121
122
  *
122
- * initEccLib(secp256k1);
123
+ * initEccLib(createNobleBackend());
123
124
  *
124
125
  * const ecc = getEccLib();
125
- * const isValid = ecc.isXOnlyPoint(somePublicKey);
126
+ * const tweaked = ecc.xOnlyPointAddTweak(pubkey, tweak);
126
127
  * ```
127
128
  */
128
- export declare function getEccLib(): EccLib;
129
+ export declare function getEccLib(): CryptoBackend;
129
130
  //# sourceMappingURL=context.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/ecc/context.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAIzC;;;;;;;;;;;;;;;;;;GAkBG;AACH,qBAAa,UAAU;;IAInB,OAAO;IAIP;;;;;;;;;;;;;;;OAeG;IACH,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU;IAMpC;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,GAAG,IAAI,UAAU;IASxB;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,KAAK,IAAI,IAAI;IAIpB;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,aAAa,IAAI,OAAO;IAI/B;;OAEG;IACH,IAAI,GAAG,IAAI,MAAM,CAEhB;CACJ;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAM3D;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,SAAS,IAAI,MAAM,CAElC"}
1
+ {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/ecc/context.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAGxD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,qBAAa,UAAU;;IAInB,OAAO;IAIP;;OAEG;IACH,IAAI,GAAG,IAAI,aAAa,CAEvB;IAED;;;;;;;;;;;;;;;OAeG;IACH,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,aAAa,GAAG,UAAU;IAU3C;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,GAAG,IAAI,UAAU;IASxB;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,KAAK,IAAI,IAAI;IAIpB;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,aAAa,IAAI,OAAO;CAGlC;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,aAAa,GAAG,SAAS,GAAG,IAAI,CAMlE;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,SAAS,IAAI,aAAa,CAEzC"}
@@ -6,6 +6,6 @@
6
6
  *
7
7
  * @packageDocumentation
8
8
  */
9
- export type { EccLib, XOnlyPointAddTweakResult, Parity } from './types.js';
9
+ export type { CryptoBackend, EccLib, XOnlyPointAddTweakResult, Parity } from './types.js';
10
10
  export { EccContext, initEccLib, getEccLib } from './context.js';
11
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ecc/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,YAAY,EAAE,MAAM,EAAE,wBAAwB,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAG3E,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ecc/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,YAAY,EAAE,aAAa,EAAE,MAAM,EAAE,wBAAwB,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAG1F,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC"}
@@ -1,128 +1,15 @@
1
- import { Bytes32, PrivateKey, PublicKey, Signature, SchnorrSignature, XOnlyPublicKey } from '../branded.js';
2
1
  /**
3
- * Parity of the y-coordinate for an x-only public key.
4
- * - 0: even y-coordinate
5
- * - 1: odd y-coordinate
6
- */
7
- export type Parity = 0 | 1;
8
- /**
9
- * Result of x-only point addition with tweak.
10
- */
11
- export interface XOnlyPointAddTweakResult {
12
- /** Parity of the resulting y-coordinate (0 = even, 1 = odd) */
13
- readonly parity: Parity;
14
- /** The resulting x-only public key */
15
- readonly xOnlyPubkey: XOnlyPublicKey;
16
- }
17
- /**
18
- * Interface for the ECC library used by this library.
19
- * This is compatible with tiny-secp256k1 and @noble/secp256k1.
2
+ * ECC (Elliptic Curve Cryptography) type definitions.
20
3
  *
21
- * @example
22
- * ```typescript
23
- * import { EccLib, initEccLib } from '@btc-vision/bitcoin';
24
- * import * as secp256k1 from 'tiny-secp256k1';
4
+ * Re-exports {@link CryptoBackend} from `@btc-vision/ecpair` as the canonical
5
+ * interface for secp256k1 operations. The legacy `EccLib` name is kept as a
6
+ * type alias for backward compatibility.
25
7
  *
26
- * // tiny-secp256k1 implements EccLib
27
- * const ecc: EccLib = secp256k1;
28
- * initEccLib(ecc);
29
- * ```
8
+ * @packageDocumentation
9
+ */
10
+ export type { CryptoBackend, XOnlyPointAddTweakResult, Parity } from '@btc-vision/ecpair';
11
+ /**
12
+ * @deprecated Use {@link CryptoBackend} from `@btc-vision/ecpair` instead.
30
13
  */
31
- export interface EccLib {
32
- /**
33
- * Checks if a 32-byte value is a valid x-only public key.
34
- *
35
- * @param p - 32-byte x-coordinate
36
- * @returns True if the point is valid on the secp256k1 curve
37
- */
38
- isXOnlyPoint(p: Uint8Array): boolean;
39
- /**
40
- * Adds a tweak to an x-only public key.
41
- *
42
- * @param p - 32-byte x-only public key
43
- * @param tweak - 32-byte scalar to add
44
- * @returns The tweaked public key with parity, or null if result is invalid
45
- */
46
- xOnlyPointAddTweak(p: XOnlyPublicKey, tweak: Bytes32): XOnlyPointAddTweakResult | null;
47
- /**
48
- * Signs a 32-byte message hash with a private key (ECDSA).
49
- * Optional - only needed for signing operations.
50
- *
51
- * @param hash - 32-byte message hash
52
- * @param privateKey - 32-byte private key
53
- * @returns DER-encoded signature
54
- */
55
- sign?(hash: Bytes32, privateKey: PrivateKey): Signature;
56
- /**
57
- * Signs a 32-byte message hash with a private key (Schnorr/BIP340).
58
- * Optional - only needed for Taproot key-path signing.
59
- *
60
- * @param hash - 32-byte message hash
61
- * @param privateKey - 32-byte private key
62
- * @returns 64-byte Schnorr signature
63
- */
64
- signSchnorr?(hash: Bytes32, privateKey: PrivateKey): SchnorrSignature;
65
- /**
66
- * Verifies an ECDSA signature.
67
- * Optional - only needed for signature verification.
68
- *
69
- * @param hash - 32-byte message hash
70
- * @param publicKey - 33 or 65-byte public key
71
- * @param signature - DER-encoded signature
72
- * @returns True if signature is valid
73
- */
74
- verify?(hash: Bytes32, publicKey: PublicKey, signature: Signature): boolean;
75
- /**
76
- * Verifies a Schnorr/BIP340 signature.
77
- * Optional - only needed for Taproot signature verification.
78
- *
79
- * @param hash - 32-byte message hash
80
- * @param publicKey - 32-byte x-only public key
81
- * @param signature - 64-byte Schnorr signature
82
- * @returns True if signature is valid
83
- */
84
- verifySchnorr?(hash: Bytes32, publicKey: XOnlyPublicKey, signature: SchnorrSignature): boolean;
85
- /**
86
- * Derives a public key from a private key.
87
- * Optional - only needed for key derivation.
88
- *
89
- * @param privateKey - 32-byte private key
90
- * @param compressed - Whether to return compressed (33-byte) or uncompressed (65-byte)
91
- * @returns The public key, or null if private key is invalid
92
- */
93
- pointFromScalar?(privateKey: PrivateKey, compressed?: boolean): PublicKey | null;
94
- /**
95
- * Computes the x-only public key from a private key.
96
- * Optional - only needed for Taproot key derivation.
97
- *
98
- * @param privateKey - 32-byte private key
99
- * @returns 32-byte x-only public key, or null if private key is invalid
100
- */
101
- xOnlyPointFromScalar?(privateKey: PrivateKey): XOnlyPublicKey | null;
102
- /**
103
- * Converts a full public key to x-only format.
104
- * Optional - only needed when working with x-only keys.
105
- *
106
- * @param pubkey - 33 or 65-byte public key
107
- * @returns 32-byte x-only public key
108
- */
109
- xOnlyPointFromPoint?(pubkey: PublicKey): XOnlyPublicKey;
110
- /**
111
- * Adds a scalar to a private key.
112
- * Optional - only needed for key tweaking.
113
- *
114
- * @param privateKey - 32-byte private key
115
- * @param tweak - 32-byte scalar to add
116
- * @returns The tweaked private key, or null if result is invalid
117
- */
118
- privateAdd?(privateKey: PrivateKey, tweak: Bytes32): PrivateKey | null;
119
- /**
120
- * Negates a private key.
121
- * Optional - only needed for Taproot parity handling.
122
- *
123
- * @param privateKey - 32-byte private key
124
- * @returns The negated private key
125
- */
126
- privateNegate?(privateKey: PrivateKey): PrivateKey;
127
- }
14
+ export type { CryptoBackend as EccLib } from '@btc-vision/ecpair';
128
15
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/ecc/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EACR,OAAO,EACP,UAAU,EACV,SAAS,EACT,SAAS,EACT,gBAAgB,EAChB,cAAc,EACjB,MAAM,eAAe,CAAC;AAEvB;;;;GAIG;AACH,MAAM,MAAM,MAAM,GAAG,CAAC,GAAG,CAAC,CAAC;AAE3B;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACrC,+DAA+D;IAC/D,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,sCAAsC;IACtC,QAAQ,CAAC,WAAW,EAAE,cAAc,CAAC;CACxC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,MAAM;IACnB;;;;;OAKG;IACH,YAAY,CAAC,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC;IAErC;;;;;;OAMG;IACH,kBAAkB,CAAC,CAAC,EAAE,cAAc,EAAE,KAAK,EAAE,OAAO,GAAG,wBAAwB,G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,0 +1,13 @@
1
+ /**
2
+ * Runtime capability verification and polyfills.
3
+ *
4
+ * Polyfills features that can be shimmed (TextEncoder, Map, Promise.allSettled, Symbol.dispose).
5
+ * Throws early with a clear error for features that cannot be polyfilled (BigInt, Uint8Array,
6
+ * structuredClone, DataView BigInt methods).
7
+ *
8
+ * Imported as a side effect by the main entry point.
9
+ *
10
+ * @packageDocumentation
11
+ */
12
+ export {};
13
+ //# sourceMappingURL=env.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../src/env.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG"}
@@ -1,5 +1,5 @@
1
1
  import { PsbtInput as _PsbtInput, PsbtInputUpdate as _PsbtInputUpdate, PsbtOutput as _PsbtOutput, TapBip32Derivation as _TapBip32Derivation, TapInternalKey as _TapInternalKey, TapKeySig as _TapKeySig, TapLeaf as _TapLeaf, TapLeafScript as _TapLeafScript, TapMerkleRoot as _TapMerkleRoot, TapScriptSig as _TapScriptSig, TapTree as _TapTree } from 'bip174';
2
- import { BitcoinError, ValidationError, InvalidInputError, InvalidOutputError, ScriptError, PsbtError, EccError, AddressError, SignatureError } from './errors.js';
2
+ import { AddressError, BitcoinError, EccError, InvalidInputError, InvalidOutputError, PsbtError, ScriptError, SignatureError, ValidationError } from './errors.js';
3
3
  import * as networks from './networks.js';
4
4
  import * as address from './address.js';
5
5
  import * as payments from './payments/index.js';
@@ -14,7 +14,8 @@ export * as script from './script.js';
14
14
  export { Block } from './block.js';
15
15
  /** @hidden */
16
16
  export * from './crypto.js';
17
- export * from './psbt.js';
17
+ export { Psbt, PsbtCache, PsbtSigner, PsbtFinalizer, PsbtTransaction, transactionFromBuffer, getFinalScripts, prepareFinalScripts, } from './psbt.js';
18
+ export type { TransactionInput, PsbtTxInput, TransactionOutput, PsbtTxOutput, ValidateSigFunction, PsbtBaseExtended, PsbtOptsOptional, PsbtOpts, PsbtInputExtended, PsbtOutputExtended, PsbtOutputExtendedScript, HDSigner, HDSignerAsync, Signer, SignerAsync, TaprootHashCheckSigner, PsbtCacheInterface, TxCacheNumberKey, ScriptType, AllScriptType, GetScriptReturn, FinalScriptsFunc, FinalTaprootScriptsFunc, } from './psbt.js';
18
19
  /** @hidden */
19
20
  export { opcodes } from './opcodes.js';
20
21
  export { Transaction } from './transaction.js';
@@ -23,7 +24,7 @@ export type { TaprootHashCache } from './transaction.js';
23
24
  export type { Network } from './networks.js';
24
25
  /** @hidden */
25
26
  export { initEccLib, getEccLib, EccContext } from './ecc/context.js';
26
- export type { EccLib } from './ecc/types.js';
27
+ export type { CryptoBackend, EccLib } from './ecc/types.js';
27
28
  export { PaymentType } from './payments/index.js';
28
29
  export type { Payment, PaymentCreator, PaymentOpts, P2WSHPayment, P2PKPayment, BasePayment, P2SHPayment, P2TRPayment, P2WPKHPayment, P2PKHPayment, P2MSPayment, EmbedPayment, P2OPPayment, P2OPPaymentParams, } from './payments/index.js';
29
30
  export type { Stack, StackElement, StackFunction } from './types.js';
@@ -52,7 +53,7 @@ export interface PsbtInputUpdate extends _PsbtInputUpdate {
52
53
  }
53
54
  export * from './psbt/bip371.js';
54
55
  export * from './address.js';
55
- export { toHex, fromHex, isHex, concat, equals, compare, isZero, clone, reverse, reverseCopy, alloc, xor, fromUtf8, toUtf8, MemoryPool, SimpleMemoryPool, varuint, } from './io/index.js';
56
+ export { toHex, fromHex, isHex, concat, equals, compare, isZero, clone, reverse, reverseCopy, alloc, xor, fromUtf8, toUtf8, varuint, } from './io/index.js';
56
57
  export * from './payments/bip341.js';
57
58
  export * from './psbt/psbtutils.js';
58
59
  export { toXOnly, decompressPublicKey, pubkeysMatch, type UncompressedPublicKey, } from './pubkey.js';
@@ -74,9 +75,8 @@ export declare const errors: {
74
75
  readonly AddressError: typeof AddressError;
75
76
  readonly SignatureError: typeof SignatureError;
76
77
  };
77
- export * as workers from './workers/index.js';
78
- export { WorkerSigningPool, getSigningPool, SignatureType, createSigningPool, signPsbtParallel, } from './workers/index.js';
79
- export type { WorkerPoolConfig, SigningTask, ParallelSignerKeyPair, ParallelSigningResult, ParallelSignOptions, PsbtParallelKeyPair, } from './workers/index.js';
78
+ export { WorkerSigningPool, getSigningPool, SignatureType, signPsbtParallel, prepareSigningTasks, applySignaturesToPsbt, } from './workers/index.shared.js';
79
+ export type { WorkerPoolConfig, SigningTask, SigningPoolLike, ParallelSignerKeyPair, ParallelSigningResult, ParallelSignOptions, PsbtParallelKeyPair, } from './workers/index.shared.js';
80
80
  declare const bitcoin: {
81
81
  networks: typeof networks;
82
82
  address: typeof address;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,SAAS,IAAI,UAAU,EACvB,eAAe,IAAI,gBAAgB,EACnC,UAAU,IAAI,WAAW,EACzB,kBAAkB,IAAI,mBAAmB,EACzC,cAAc,IAAI,eAAe,EACjC,SAAS,IAAI,UAAU,EACvB,OAAO,IAAI,QAAQ,EACnB,aAAa,IAAI,cAAc,EAC/B,aAAa,IAAI,cAAc,EAC/B,YAAY,IAAI,aAAa,EAC7B,OAAO,IAAI,QAAQ,EACtB,MAAM,QAAQ,CAAC;AAChB,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAC1C,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC;AACxC,OAAO,KAAK,QAAQ,MAAM,qBAAqB,CAAC;AAChD,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AACtC,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AACtC,OAAO,KAAK,WAAW,MAAM,kBAAkB,CAAC;AAEhD,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC;AACxC,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AACtC,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAC1C,OAAO,KAAK,QAAQ,MAAM,qBAAqB,CAAC;AAChD,OAAO,KAAK,MAAM,MAAM,aAAa,CAA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