@btc-vision/bitcoin 7.0.0-alpha.2 → 7.0.0-alpha.4

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 (134) hide show
  1. package/README.md +455 -155
  2. package/browser/chunks/WorkerSigningPool.sequential-DHha7j0b.js +113 -0
  3. package/browser/ecc/context.d.ts +22 -21
  4. package/browser/ecc/context.d.ts.map +1 -1
  5. package/browser/ecc/index.d.ts +1 -1
  6. package/browser/ecc/index.d.ts.map +1 -1
  7. package/browser/ecc/types.d.ts +10 -123
  8. package/browser/ecc/types.d.ts.map +1 -1
  9. package/browser/env.d.ts +13 -0
  10. package/browser/env.d.ts.map +1 -0
  11. package/browser/index.d.ts +3 -3
  12. package/browser/index.d.ts.map +1 -1
  13. package/browser/index.js +5790 -4295
  14. package/browser/io/index.d.ts +0 -1
  15. package/browser/io/index.d.ts.map +1 -1
  16. package/browser/payments/p2tr.d.ts.map +1 -1
  17. package/browser/psbt/types.d.ts +2 -68
  18. package/browser/psbt/types.d.ts.map +1 -1
  19. package/browser/psbt.d.ts +9 -11
  20. package/browser/psbt.d.ts.map +1 -1
  21. package/browser/types.d.ts +1 -1
  22. package/browser/types.d.ts.map +1 -1
  23. package/browser/workers/WorkerSigningPool.d.ts +6 -0
  24. package/browser/workers/WorkerSigningPool.d.ts.map +1 -1
  25. package/browser/workers/WorkerSigningPool.node.d.ts +6 -0
  26. package/browser/workers/WorkerSigningPool.node.d.ts.map +1 -1
  27. package/browser/workers/WorkerSigningPool.sequential.d.ts +69 -0
  28. package/browser/workers/WorkerSigningPool.sequential.d.ts.map +1 -0
  29. package/browser/workers/WorkerSigningPool.worklet.d.ts +64 -0
  30. package/browser/workers/WorkerSigningPool.worklet.d.ts.map +1 -0
  31. package/browser/workers/index.d.ts +2 -2
  32. package/browser/workers/index.d.ts.map +1 -1
  33. package/browser/workers/index.react-native.d.ts +28 -0
  34. package/browser/workers/index.react-native.d.ts.map +1 -0
  35. package/browser/workers/psbt-parallel.d.ts +2 -3
  36. package/browser/workers/psbt-parallel.d.ts.map +1 -1
  37. package/browser/workers/types.d.ts +12 -0
  38. package/browser/workers/types.d.ts.map +1 -1
  39. package/build/ecc/context.d.ts +22 -21
  40. package/build/ecc/context.d.ts.map +1 -1
  41. package/build/ecc/context.js +19 -114
  42. package/build/ecc/context.js.map +1 -1
  43. package/build/ecc/index.d.ts +1 -1
  44. package/build/ecc/index.d.ts.map +1 -1
  45. package/build/ecc/types.d.ts +7 -126
  46. package/build/ecc/types.d.ts.map +1 -1
  47. package/build/ecc/types.js +4 -1
  48. package/build/ecc/types.js.map +1 -1
  49. package/build/env.d.ts +13 -0
  50. package/build/env.d.ts.map +1 -0
  51. package/build/env.js +198 -0
  52. package/build/env.js.map +1 -0
  53. package/build/index.d.ts +4 -3
  54. package/build/index.d.ts.map +1 -1
  55. package/build/index.js +2 -1
  56. package/build/index.js.map +1 -1
  57. package/build/io/index.d.ts +0 -1
  58. package/build/io/index.d.ts.map +1 -1
  59. package/build/io/index.js +0 -2
  60. package/build/io/index.js.map +1 -1
  61. package/build/payments/p2tr.d.ts.map +1 -1
  62. package/build/payments/p2tr.js +2 -3
  63. package/build/payments/p2tr.js.map +1 -1
  64. package/build/psbt/types.d.ts +2 -68
  65. package/build/psbt/types.d.ts.map +1 -1
  66. package/build/psbt.d.ts +9 -11
  67. package/build/psbt.d.ts.map +1 -1
  68. package/build/psbt.js +38 -53
  69. package/build/psbt.js.map +1 -1
  70. package/build/tsconfig.build.tsbuildinfo +1 -1
  71. package/build/types.d.ts +1 -1
  72. package/build/types.d.ts.map +1 -1
  73. package/build/types.js +2 -16
  74. package/build/types.js.map +1 -1
  75. package/build/workers/WorkerSigningPool.d.ts +6 -0
  76. package/build/workers/WorkerSigningPool.d.ts.map +1 -1
  77. package/build/workers/WorkerSigningPool.js +8 -0
  78. package/build/workers/WorkerSigningPool.js.map +1 -1
  79. package/build/workers/WorkerSigningPool.node.d.ts +6 -0
  80. package/build/workers/WorkerSigningPool.node.d.ts.map +1 -1
  81. package/build/workers/WorkerSigningPool.node.js +9 -2
  82. package/build/workers/WorkerSigningPool.node.js.map +1 -1
  83. package/build/workers/WorkerSigningPool.sequential.d.ts +78 -0
  84. package/build/workers/WorkerSigningPool.sequential.d.ts.map +1 -0
  85. package/build/workers/WorkerSigningPool.sequential.js +160 -0
  86. package/build/workers/WorkerSigningPool.sequential.js.map +1 -0
  87. package/build/workers/WorkerSigningPool.worklet.d.ts +79 -0
  88. package/build/workers/WorkerSigningPool.worklet.d.ts.map +1 -0
  89. package/build/workers/WorkerSigningPool.worklet.js +388 -0
  90. package/build/workers/WorkerSigningPool.worklet.js.map +1 -0
  91. package/build/workers/index.d.ts +2 -2
  92. package/build/workers/index.d.ts.map +1 -1
  93. package/build/workers/index.js +9 -0
  94. package/build/workers/index.js.map +1 -1
  95. package/build/workers/index.react-native.d.ts +28 -0
  96. package/build/workers/index.react-native.d.ts.map +1 -0
  97. package/build/workers/index.react-native.js +67 -0
  98. package/build/workers/index.react-native.js.map +1 -0
  99. package/build/workers/psbt-parallel.d.ts +2 -3
  100. package/build/workers/psbt-parallel.d.ts.map +1 -1
  101. package/build/workers/psbt-parallel.js +4 -4
  102. package/build/workers/psbt-parallel.js.map +1 -1
  103. package/build/workers/types.d.ts +12 -0
  104. package/build/workers/types.d.ts.map +1 -1
  105. package/package.json +14 -4
  106. package/src/ecc/context.ts +26 -147
  107. package/src/ecc/index.ts +2 -2
  108. package/src/ecc/types.ts +7 -138
  109. package/src/env.ts +237 -0
  110. package/src/index.ts +2 -4
  111. package/src/io/index.ts +0 -3
  112. package/src/payments/p2tr.ts +2 -2
  113. package/src/psbt/types.ts +2 -84
  114. package/src/psbt.ts +63 -121
  115. package/src/types.ts +5 -28
  116. package/src/workers/WorkerSigningPool.node.ts +10 -2
  117. package/src/workers/WorkerSigningPool.sequential.ts +190 -0
  118. package/src/workers/WorkerSigningPool.ts +9 -0
  119. package/src/workers/WorkerSigningPool.worklet.ts +519 -0
  120. package/src/workers/index.react-native.ts +110 -0
  121. package/src/workers/index.ts +10 -1
  122. package/src/workers/psbt-parallel.ts +8 -8
  123. package/src/workers/types.ts +16 -0
  124. package/test/env.spec.ts +418 -0
  125. package/test/workers-pool.spec.ts +43 -0
  126. package/test/workers-sequential.spec.ts +669 -0
  127. package/test/workers-worklet.spec.ts +500 -0
  128. package/browser/io/MemoryPool.d.ts +0 -220
  129. package/browser/io/MemoryPool.d.ts.map +0 -1
  130. package/build/io/MemoryPool.d.ts +0 -220
  131. package/build/io/MemoryPool.d.ts.map +0 -1
  132. package/build/io/MemoryPool.js +0 -309
  133. package/build/io/MemoryPool.js.map +0 -1
  134. package/src/io/MemoryPool.ts +0 -343
@@ -4,7 +4,7 @@
4
4
  *
5
5
  * @packageDocumentation
6
6
  */
7
- import type { EccLib } from './types.js';
7
+ import type { CryptoBackend } from '@btc-vision/ecpair';
8
8
  /**
9
9
  * Context class for managing the ECC library instance.
10
10
  * Uses dependency injection pattern instead of global singleton.
@@ -12,10 +12,11 @@ import type { EccLib } from './types.js';
12
12
  * @example
13
13
  * ```typescript
14
14
  * import { EccContext } from '@btc-vision/bitcoin';
15
- * import * as secp256k1 from 'tiny-secp256k1';
15
+ * import { createNobleBackend } from '@btc-vision/ecpair';
16
16
  *
17
17
  * // Initialize once at app startup
18
- * EccContext.init(secp256k1);
18
+ * const backend = createNobleBackend();
19
+ * EccContext.init(backend);
19
20
  *
20
21
  * // Get instance anywhere in your code
21
22
  * const ecc = EccContext.get();
@@ -30,24 +31,24 @@ export declare class EccContext {
30
31
  /**
31
32
  * The underlying ECC library instance.
32
33
  */
33
- get lib(): EccLib;
34
+ get lib(): CryptoBackend;
34
35
  /**
35
36
  * Initializes the ECC context with the provided library.
36
37
  * The library is verified before being set as active.
37
38
  *
38
- * @param lib - The ECC library instance to initialize
39
+ * @param lib - The CryptoBackend instance to initialize
39
40
  * @returns The initialized EccContext instance
40
- * @throws Error if the ECC library fails verification
41
+ * @throws Error if the CryptoBackend fails verification
41
42
  *
42
43
  * @example
43
44
  * ```typescript
44
45
  * import { EccContext } from '@btc-vision/bitcoin';
45
- * import * as secp256k1 from 'tiny-secp256k1';
46
+ * import { createNobleBackend } from '@btc-vision/ecpair';
46
47
  *
47
- * const context = EccContext.init(secp256k1);
48
+ * const context = EccContext.init(createNobleBackend());
48
49
  * ```
49
50
  */
50
- static init(lib: EccLib): EccContext;
51
+ static init(lib: CryptoBackend): EccContext;
51
52
  /**
52
53
  * Gets the initialized ECC context.
53
54
  *
@@ -59,7 +60,7 @@ export declare class EccContext {
59
60
  * import { EccContext } from '@btc-vision/bitcoin';
60
61
  *
61
62
  * const context = EccContext.get();
62
- * const isValid = context.lib.isXOnlyPoint(someKey);
63
+ * const tweaked = context.lib.xOnlyPointAddTweak(key, tweak);
63
64
  * ```
64
65
  */
65
66
  static get(): EccContext;
@@ -86,7 +87,7 @@ export declare class EccContext {
86
87
  * import { EccContext } from '@btc-vision/bitcoin';
87
88
  *
88
89
  * if (!EccContext.isInitialized()) {
89
- * EccContext.init(secp256k1);
90
+ * EccContext.init(createNobleBackend());
90
91
  * }
91
92
  * ```
92
93
  */
@@ -97,39 +98,39 @@ export declare class EccContext {
97
98
  * This is a convenience function that wraps EccContext.init().
98
99
  * Pass `undefined` to clear the library.
99
100
  *
100
- * @param eccLib - The ECC library instance to initialize, or undefined to clear
101
- * @throws Error if the ECC library fails verification
101
+ * @param eccLib - The CryptoBackend instance to initialize, or undefined to clear
102
+ * @throws Error if the CryptoBackend fails verification
102
103
  *
103
104
  * @example
104
105
  * ```typescript
105
106
  * import { initEccLib } from '@btc-vision/bitcoin';
106
- * import * as secp256k1 from 'tiny-secp256k1';
107
+ * import { createNobleBackend } from '@btc-vision/ecpair';
107
108
  *
108
109
  * // Initialize the ECC library
109
- * initEccLib(secp256k1);
110
+ * initEccLib(createNobleBackend());
110
111
  *
111
112
  * // Clear the library
112
113
  * initEccLib(undefined);
113
114
  * ```
114
115
  */
115
- export declare function initEccLib(eccLib: EccLib | undefined): void;
116
+ export declare function initEccLib(eccLib: CryptoBackend | undefined): void;
116
117
  /**
117
118
  * Retrieves the initialized ECC library instance.
118
119
  * This is a convenience function that wraps EccContext.get().lib.
119
120
  *
120
- * @returns The ECC library instance
121
+ * @returns The CryptoBackend instance
121
122
  * @throws Error if the ECC library has not been initialized
122
123
  *
123
124
  * @example
124
125
  * ```typescript
125
126
  * import { getEccLib, initEccLib } from '@btc-vision/bitcoin';
126
- * import * as secp256k1 from 'tiny-secp256k1';
127
+ * import { createNobleBackend } from '@btc-vision/ecpair';
127
128
  *
128
- * initEccLib(secp256k1);
129
+ * initEccLib(createNobleBackend());
129
130
  *
130
131
  * const ecc = getEccLib();
131
- * const isValid = ecc.isXOnlyPoint(somePublicKey);
132
+ * const tweaked = ecc.xOnlyPointAddTweak(pubkey, tweak);
132
133
  * ```
133
134
  */
134
- export declare function getEccLib(): EccLib;
135
+ export declare function getEccLib(): CryptoBackend;
135
136
  //# 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,IAAI,GAAG,IAAI,MAAM,CAEhB;IAED;;;;;;;;;;;;;;;OAeG;IACH,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU;IAUpC;;;;;;;;;;;;;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,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"}
@@ -1,4 +1,4 @@
1
- import { equals, fromHex } from '../io/index.js';
1
+ import { verifyCryptoBackend } 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 { equals, fromHex } from '../io/index.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();
@@ -34,16 +35,16 @@ export class EccContext {
34
35
  * Initializes the ECC context with the provided library.
35
36
  * The library is verified before being set as active.
36
37
  *
37
- * @param lib - The ECC library instance to initialize
38
+ * @param lib - The CryptoBackend instance to initialize
38
39
  * @returns The initialized EccContext instance
39
- * @throws Error if the ECC library fails verification
40
+ * @throws Error if the CryptoBackend fails verification
40
41
  *
41
42
  * @example
42
43
  * ```typescript
43
44
  * import { EccContext } from '@btc-vision/bitcoin';
44
- * import * as secp256k1 from 'tiny-secp256k1';
45
+ * import { createNobleBackend } from '@btc-vision/ecpair';
45
46
  *
46
- * const context = EccContext.init(secp256k1);
47
+ * const context = EccContext.init(createNobleBackend());
47
48
  * ```
48
49
  */
49
50
  static init(lib) {
@@ -51,7 +52,7 @@ export class EccContext {
51
52
  if (EccContext.#instance && EccContext.#instance.#lib === lib) {
52
53
  return EccContext.#instance;
53
54
  }
54
- verifyEcc(lib);
55
+ verifyCryptoBackend(lib);
55
56
  EccContext.#instance = new EccContext(lib);
56
57
  return EccContext.#instance;
57
58
  }
@@ -66,7 +67,7 @@ export class EccContext {
66
67
  * import { EccContext } from '@btc-vision/bitcoin';
67
68
  *
68
69
  * const context = EccContext.get();
69
- * const isValid = context.lib.isXOnlyPoint(someKey);
70
+ * const tweaked = context.lib.xOnlyPointAddTweak(key, tweak);
70
71
  * ```
71
72
  */
72
73
  static get() {
@@ -100,7 +101,7 @@ export class EccContext {
100
101
  * import { EccContext } from '@btc-vision/bitcoin';
101
102
  *
102
103
  * if (!EccContext.isInitialized()) {
103
- * EccContext.init(secp256k1);
104
+ * EccContext.init(createNobleBackend());
104
105
  * }
105
106
  * ```
106
107
  */
@@ -113,16 +114,16 @@ export class EccContext {
113
114
  * This is a convenience function that wraps EccContext.init().
114
115
  * Pass `undefined` to clear the library.
115
116
  *
116
- * @param eccLib - The ECC library instance to initialize, or undefined to clear
117
- * @throws Error if the ECC library fails verification
117
+ * @param eccLib - The CryptoBackend instance to initialize, or undefined to clear
118
+ * @throws Error if the CryptoBackend fails verification
118
119
  *
119
120
  * @example
120
121
  * ```typescript
121
122
  * import { initEccLib } from '@btc-vision/bitcoin';
122
- * import * as secp256k1 from 'tiny-secp256k1';
123
+ * import { createNobleBackend } from '@btc-vision/ecpair';
123
124
  *
124
125
  * // Initialize the ECC library
125
- * initEccLib(secp256k1);
126
+ * initEccLib(createNobleBackend());
126
127
  *
127
128
  * // Clear the library
128
129
  * initEccLib(undefined);
@@ -139,117 +140,21 @@ export function initEccLib(eccLib) {
139
140
  * Retrieves the initialized ECC library instance.
140
141
  * This is a convenience function that wraps EccContext.get().lib.
141
142
  *
142
- * @returns The ECC library instance
143
+ * @returns The CryptoBackend instance
143
144
  * @throws Error if the ECC library has not been initialized
144
145
  *
145
146
  * @example
146
147
  * ```typescript
147
148
  * import { getEccLib, initEccLib } from '@btc-vision/bitcoin';
148
- * import * as secp256k1 from 'tiny-secp256k1';
149
+ * import { createNobleBackend } from '@btc-vision/ecpair';
149
150
  *
150
- * initEccLib(secp256k1);
151
+ * initEccLib(createNobleBackend());
151
152
  *
152
153
  * const ecc = getEccLib();
153
- * const isValid = ecc.isXOnlyPoint(somePublicKey);
154
+ * const tweaked = ecc.xOnlyPointAddTweak(pubkey, tweak);
154
155
  * ```
155
156
  */
156
157
  export function getEccLib() {
157
158
  return EccContext.get().lib;
158
159
  }
159
- // Lazily decoded test vectors (decoded once on first verification)
160
- let _tweakVectors;
161
- let _validPoints;
162
- let _invalidPoints;
163
- function getTweakVectors() {
164
- if (!_tweakVectors) {
165
- _tweakVectors = [
166
- {
167
- pubkey: fromHex('79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798'),
168
- tweak: fromHex('fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140'),
169
- parity: -1,
170
- result: null,
171
- },
172
- {
173
- pubkey: fromHex('1617d38ed8d8657da4d4761e8057bc396ea9e4b9d29776d4be096016dbd2509b'),
174
- tweak: fromHex('a8397a935f0dfceba6ba9618f6451ef4d80637abf4e6af2669fbc9de6a8fd2ac'),
175
- parity: 1,
176
- result: fromHex('e478f99dab91052ab39a33ea35fd5e6e4933f4d28023cd597c9a1f6760346adf'),
177
- },
178
- {
179
- pubkey: fromHex('2c0b7cf95324a07d05398b240174dc0c2be444d96b159aa6c7f7b1e668680991'),
180
- tweak: fromHex('823c3cd2142744b075a87eade7e1b8678ba308d566226a0056ca2b7a76f86b47'),
181
- parity: 0,
182
- result: fromHex('9534f8dc8c6deda2dc007655981c78b49c5d96c778fbf363462a11ec9dfd948c'),
183
- },
184
- ];
185
- }
186
- return _tweakVectors;
187
- }
188
- function getValidPoints() {
189
- if (!_validPoints) {
190
- _validPoints = [
191
- fromHex('79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798'),
192
- fromHex('fffffffffffffffffffffffffffffffffffffffffffffffffffffffeeffffc2e'),
193
- fromHex('f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9'),
194
- fromHex('0000000000000000000000000000000000000000000000000000000000000001'),
195
- ];
196
- }
197
- return _validPoints;
198
- }
199
- function getInvalidPoints() {
200
- if (!_invalidPoints) {
201
- _invalidPoints = [
202
- fromHex('0000000000000000000000000000000000000000000000000000000000000000'),
203
- fromHex('fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f'),
204
- ];
205
- }
206
- return _invalidPoints;
207
- }
208
- /**
209
- * Verifies that the ECC library implementation is correct.
210
- * Tests `isXOnlyPoint` and `xOnlyPointAddTweak` with known test vectors.
211
- *
212
- * @param ecc - The ECC library to verify
213
- * @throws Error if any verification test fails
214
- */
215
- function verifyEcc(ecc) {
216
- if (typeof ecc.isXOnlyPoint !== 'function') {
217
- throw new Error('ECC library missing isXOnlyPoint function');
218
- }
219
- // Test isXOnlyPoint with valid points (pre-decoded)
220
- for (const point of getValidPoints()) {
221
- if (!ecc.isXOnlyPoint(point)) {
222
- throw new Error('ECC library isXOnlyPoint failed for a valid point');
223
- }
224
- }
225
- // Test isXOnlyPoint with invalid points (pre-decoded)
226
- for (const point of getInvalidPoints()) {
227
- if (ecc.isXOnlyPoint(point)) {
228
- throw new Error('ECC library isXOnlyPoint should reject invalid point');
229
- }
230
- }
231
- // Test xOnlyPointAddTweak
232
- if (typeof ecc.xOnlyPointAddTweak !== 'function') {
233
- throw new Error('ECC library missing xOnlyPointAddTweak function');
234
- }
235
- for (const vector of getTweakVectors()) {
236
- const result = ecc.xOnlyPointAddTweak(vector.pubkey, vector.tweak);
237
- if (vector.result === null) {
238
- if (result !== null) {
239
- throw new Error('ECC library xOnlyPointAddTweak should return null for test vector');
240
- }
241
- }
242
- else {
243
- if (result === null) {
244
- throw new Error('ECC library xOnlyPointAddTweak returned null unexpectedly');
245
- }
246
- if (result.parity !== vector.parity) {
247
- throw new Error('ECC library xOnlyPointAddTweak parity mismatch');
248
- }
249
- if (!equals(result.xOnlyPubkey, vector.result)) {
250
- throw new Error('ECC library xOnlyPointAddTweak result mismatch');
251
- }
252
- }
253
- }
254
- }
255
160
  //# sourceMappingURL=context.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/ecc/context.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAGjD;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,OAAO,UAAU;IACnB,MAAM,CAAC,SAAS,CAAyB;IAChC,IAAI,CAAS;IAEtB,YAAoB,GAAW;QAC3B,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC;IACpB,CAAC;IAED;;OAEG;IACH,IAAI,GAAG;QACH,OAAO,IAAI,CAAC,IAAI,CAAC;IACrB,CAAC;IAED;;;;;;;;;;;;;;;OAeG;IACH,MAAM,CAAC,IAAI,CAAC,GAAW;QACnB,0DAA0D;QAC1D,IAAI,UAAU,CAAC,SAAS,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CAAC,MAAiC;IACxD,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QACvB,UAAU,CAAC,KAAK,EAAE,CAAC;QACnB,OAAO;IACX,CAAC;IACD,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAC5B,CAAC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,SAAS;IACrB,OAAO,UAAU,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC;AAChC,CAAC"}
@@ -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,134 +1,15 @@
1
1
  /**
2
2
  * ECC (Elliptic Curve Cryptography) type definitions.
3
- * Defines interfaces for secp256k1 operations used in Taproot and signatures.
3
+ *
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.
4
7
  *
5
8
  * @packageDocumentation
6
9
  */
7
- import type { Bytes32, PrivateKey, PublicKey, SchnorrSignature, Signature, XOnlyPublicKey } from '../branded.js';
8
- /**
9
- * Parity of the y-coordinate for an x-only public key.
10
- * - 0: even y-coordinate
11
- * - 1: odd y-coordinate
12
- */
13
- export type Parity = 0 | 1;
10
+ export type { CryptoBackend, XOnlyPointAddTweakResult, Parity } from '@btc-vision/ecpair';
14
11
  /**
15
- * Result of x-only point addition with tweak.
16
- */
17
- export interface XOnlyPointAddTweakResult {
18
- /** Parity of the resulting y-coordinate (0 = even, 1 = odd) */
19
- readonly parity: Parity;
20
- /** The resulting x-only public key */
21
- readonly xOnlyPubkey: XOnlyPublicKey;
22
- }
23
- /**
24
- * Interface for the ECC library used by this library.
25
- * This is compatible with tiny-secp256k1 and @noble/secp256k1.
26
- *
27
- * @example
28
- * ```typescript
29
- * import { EccLib, initEccLib } from '@btc-vision/bitcoin';
30
- * import * as secp256k1 from 'tiny-secp256k1';
31
- *
32
- * // tiny-secp256k1 implements EccLib
33
- * const ecc: EccLib = secp256k1;
34
- * initEccLib(ecc);
35
- * ```
12
+ * @deprecated Use {@link CryptoBackend} from `@btc-vision/ecpair` instead.
36
13
  */
37
- export interface EccLib {
38
- /**
39
- * Checks if a 32-byte value is a valid x-only public key.
40
- *
41
- * @param p - 32-byte x-coordinate
42
- * @returns True if the point is valid on the secp256k1 curve
43
- */
44
- isXOnlyPoint(p: Uint8Array): boolean;
45
- /**
46
- * Adds a tweak to an x-only public key.
47
- *
48
- * @param p - 32-byte x-only public key
49
- * @param tweak - 32-byte scalar to add
50
- * @returns The tweaked public key with parity, or null if result is invalid
51
- */
52
- xOnlyPointAddTweak(p: XOnlyPublicKey, tweak: Bytes32): XOnlyPointAddTweakResult | null;
53
- /**
54
- * Signs a 32-byte message hash with a private key (ECDSA).
55
- * Optional - only needed for signing operations.
56
- *
57
- * @param hash - 32-byte message hash
58
- * @param privateKey - 32-byte private key
59
- * @returns DER-encoded signature
60
- */
61
- sign?(hash: Bytes32, privateKey: PrivateKey): Signature;
62
- /**
63
- * Signs a 32-byte message hash with a private key (Schnorr/BIP340).
64
- * Optional - only needed for Taproot key-path signing.
65
- *
66
- * @param hash - 32-byte message hash
67
- * @param privateKey - 32-byte private key
68
- * @returns 64-byte Schnorr signature
69
- */
70
- signSchnorr?(hash: Bytes32, privateKey: PrivateKey): SchnorrSignature;
71
- /**
72
- * Verifies an ECDSA signature.
73
- * Optional - only needed for signature verification.
74
- *
75
- * @param hash - 32-byte message hash
76
- * @param publicKey - 33 or 65-byte public key
77
- * @param signature - DER-encoded signature
78
- * @returns True if signature is valid
79
- */
80
- verify?(hash: Bytes32, publicKey: PublicKey, signature: Signature): boolean;
81
- /**
82
- * Verifies a Schnorr/BIP340 signature.
83
- * Optional - only needed for Taproot signature verification.
84
- *
85
- * @param hash - 32-byte message hash
86
- * @param publicKey - 32-byte x-only public key
87
- * @param signature - 64-byte Schnorr signature
88
- * @returns True if signature is valid
89
- */
90
- verifySchnorr?(hash: Bytes32, publicKey: XOnlyPublicKey, signature: SchnorrSignature): boolean;
91
- /**
92
- * Derives a public key from a private key.
93
- * Optional - only needed for key derivation.
94
- *
95
- * @param privateKey - 32-byte private key
96
- * @param compressed - Whether to return compressed (33-byte) or uncompressed (65-byte)
97
- * @returns The public key, or null if private key is invalid
98
- */
99
- pointFromScalar?(privateKey: PrivateKey, compressed?: boolean): PublicKey | null;
100
- /**
101
- * Computes the x-only public key from a private key.
102
- * Optional - only needed for Taproot key derivation.
103
- *
104
- * @param privateKey - 32-byte private key
105
- * @returns 32-byte x-only public key, or null if private key is invalid
106
- */
107
- xOnlyPointFromScalar?(privateKey: PrivateKey): XOnlyPublicKey | null;
108
- /**
109
- * Converts a full public key to x-only format.
110
- * Optional - only needed when working with x-only keys.
111
- *
112
- * @param pubkey - 33 or 65-byte public key
113
- * @returns 32-byte x-only public key
114
- */
115
- xOnlyPointFromPoint?(pubkey: PublicKey): XOnlyPublicKey;
116
- /**
117
- * Adds a scalar to a private key.
118
- * Optional - only needed for key tweaking.
119
- *
120
- * @param privateKey - 32-byte private key
121
- * @param tweak - 32-byte scalar to add
122
- * @returns The tweaked private key, or null if result is invalid
123
- */
124
- privateAdd?(privateKey: PrivateKey, tweak: Bytes32): PrivateKey | null;
125
- /**
126
- * Negates a private key.
127
- * Optional - only needed for Taproot parity handling.
128
- *
129
- * @param privateKey - 32-byte private key
130
- * @returns The negated private key
131
- */
132
- privateNegate?(privateKey: PrivateKey): PrivateKey;
133
- }
14
+ export type { CryptoBackend as EccLib } from '@btc-vision/ecpair';
134
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,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,gBAAgB,EAAE,SAAS,EAAE,cAAc,EAAG,MAAM,eAAe,CAAC;AAElH;;;;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,GAAG,IAAI,CAAC;IAEvF;;;;;;;OAOG;IACH,IAAI,CAAC,CAAC,IAAI,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU,GAAG,SAAS,CAAC;IAExD;;;;;;;OAOG;IACH,WAAW,CAAC,CAAC,IAAI,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU,GAAG,gBAAgB,CAAC;IAEtE;;;;;;;;OAQG;IACH,MAAM,CAAC,CAAC,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,GAAG,OAAO,CAAC;IAE5E;;;;;;;;OAQG;IACH,aAAa,CAAC,CAAC,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,SAAS,EAAE,gBAAgB,GAAG,OAAO,CAAC;IAE/F;;;;;;;OAOG;IACH,eAAe,CAAC,CAAC,UAAU,EAAE,UAAU,EAAE,UAAU,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,IAAI,CAAC;IAEjF;;;;;;OAMG;IACH,oBAAoB,CAAC,CAAC,UAAU,EAAE,UAAU,GAAG,cAAc,GAAG,IAAI,CAAC;IAErE;;;;;;OAMG;IACH,mBAAmB,CAAC,CAAC,MAAM,EAAE,SAAS,GAAG,cAAc,CAAC;IAExD;;;;;;;OAOG;IACH,UAAU,CAAC,CAAC,UAAU,EAAE,UAAU,EAAE,KAAK,EAAE,OAAO,GAAG,UAAU,GAAG,IAAI,CAAC;IAEvE;;;;;;OAMG;IACH,aAAa,CAAC,CAAC,UAAU,EAAE,UAAU,GAAG,UAAU,CAAC;CACtD"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/ecc/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,YAAY,EAAE,aAAa,EAAE,wBAAwB,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAE1F;;GAEG;AACH,YAAY,EAAE,aAAa,IAAI,MAAM,EAAE,MAAM,oBAAoB,CAAC"}
@@ -1,6 +1,9 @@
1
1
  /**
2
2
  * ECC (Elliptic Curve Cryptography) type definitions.
3
- * Defines interfaces for secp256k1 operations used in Taproot and signatures.
3
+ *
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.
4
7
  *
5
8
  * @packageDocumentation
6
9
  */
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/ecc/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/ecc/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG"}
package/build/env.d.ts ADDED
@@ -0,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"}