Skip to main content

tapTweakHash

bitcoinjs-lib v1.0.7


bitcoinjs-lib / payments / tapTweakHash

Function: tapTweakHash()

tapTweakHash(pubKey, h): Uint8Array

Defined in: ts_src/payments/bip341.ts:133

Computes the taproot tweak hash for a given public key and optional hash. If a hash is provided, the public key and hash are concatenated before computing the hash. If no hash is provided, only the public key is used to compute the hash.

Parameters

pubKey

Uint8Array

The public key buffer.

h

The optional hash buffer.

undefined | Uint8Array

Returns

Uint8Array

The taproot tweak hash.