(pubKey: Buffer, h: Buffer | undefined)
| 40 | } |
| 41 | |
| 42 | export function tapTweakHash(pubKey: Buffer, h: Buffer | undefined): Buffer { |
| 43 | return bitcoin.crypto.taggedHash( |
| 44 | "TapTweak", |
| 45 | Buffer.concat(h ? [pubKey, h] : [pubKey]) |
| 46 | ); |
| 47 | } |
| 48 | |
| 49 | export function toXOnly(pubkey: Buffer): Buffer { |
| 50 | return Buffer.from(pubkey.subarray(1, 33)); |