@@ -84,18 +84,6 @@ interface RecipientOutput {
8484 signature : string ;
8585}
8686
87- // ================================================================
88- // =================== scalar helpers (mod n) ==================
89- // ================================================================
90- const N = fromHex (
91- 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141' ,
92- ) ;
93-
94- function isZero32 ( a : Uint8Array ) {
95- for ( let i = 0 ; i < 32 ; i ++ ) if ( a [ i ] !== 0 ) return false ;
96- return true ;
97- }
98-
9987// Detect patterns
10088function isP2PKH ( spkHex ?: string ) : boolean {
10189 const u = fromHex ( spkHex || '' ) ;
@@ -167,24 +155,6 @@ function parseWitnessItems(witHex: string): Uint8Array[] {
167155 return items ;
168156}
169157
170- // ---- helper: sum compressed pubkeys exactly as given (33B) ----
171- function sumPointsCompressed ( points33 : Uint8Array [ ] ) : Uint8Array {
172- let acc : Uint8Array | null = null ;
173- for ( const P of points33 ) {
174- if ( ! P || P . length !== 33 || ( P [ 0 ] !== 0x02 && P [ 0 ] !== 0x03 ) ) {
175- throw new Error ( 'bad compressed pubkey in input_pub_keys' ) ;
176- }
177- if ( acc === null ) acc = P ;
178- else {
179- const next = ecc . pointAdd ( acc , P , true ) as Uint8Array | null ;
180- if ( ! next ) throw new Error ( 'pointAdd failed when summing inputs' ) ;
181- acc = next ;
182- }
183- }
184- if ( ! acc ) throw new Error ( 'no input_pub_keys to sum' ) ;
185- return acc ; // 33B compressed A_sum
186- }
187-
188158/**
189159 * Return a single compressed pubkey for display, or null if none.
190160 *
0 commit comments