MCPcopy Create free account
hub / github.com/NoteProtocol/NoteWallet / tapTweakHash

Function tapTweakHash

src/btc/btc-ecc.ts:42–47  ·  view source on GitHub ↗
(pubKey: Buffer, h: Buffer | undefined)

Source from the content-addressed store, hash-verified

40}
41
42export 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
49export function toXOnly(pubkey: Buffer): Buffer {
50 return Buffer.from(pubkey.subarray(1, 33));

Callers 1

tweakSignerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected