The following comparison fails when toXOnly() returns a Buffer and outputKey is a Uint8Array:
Even if both values contain the same underlying bytes, .equals() does not accept Uint8Array arguments directly.
Using Buffer.from(outputKey) works as expected:
if ((0, bip371_1.toXOnly)(pubkey).equals(Buffer.from(outputKey))) {
// works
}
Version
6.1.5
Expected behavior
outputKey must be a Buffer when used with .equals(). Currently, it’s an Uint8Array.