Type alias Secp256k1

Secp256k1: {
    addTweakPrivateKey: ((privateKey, tweakValue) => Uint8Array | string);
    addTweakPublicKeyCompressed: ((publicKey, tweakValue) => Uint8Array | string);
    addTweakPublicKeyUncompressed: ((publicKey, tweakValue) => Uint8Array | string);
    compressPublicKey: ((publicKey) => Uint8Array | string);
    derivePublicKeyCompressed: ((privateKey) => Uint8Array | string);
    derivePublicKeyUncompressed: ((privateKey) => Uint8Array | string);
    malleateSignatureCompact: ((signature) => Uint8Array | string);
    malleateSignatureDER: ((signature) => Uint8Array | string);
    mulTweakPrivateKey: ((privateKey, tweakValue) => Uint8Array | string);
    mulTweakPublicKeyCompressed: ((publicKey, tweakValue) => Uint8Array | string);
    mulTweakPublicKeyUncompressed: ((publicKey, tweakValue) => Uint8Array | string);
    normalizeSignatureCompact: ((signature) => Uint8Array | string);
    normalizeSignatureDER: ((signature) => Uint8Array | string);
    recoverPublicKeyCompressed: ((signature, recoveryId, messageHash) => Uint8Array | string);
    recoverPublicKeyUncompressed: ((signature, recoveryId, messageHash) => Uint8Array | string);
    signMessageHashCompact: ((privateKey, messageHash) => Uint8Array | string);
    signMessageHashDER: ((privateKey, messageHash) => Uint8Array | string);
    signMessageHashRecoverableCompact: ((privateKey, messageHash) => RecoverableSignature | string);
    signMessageHashSchnorr: ((privateKey, messageHash) => Uint8Array | string);
    signatureCompactToDER: ((signature) => Uint8Array | string);
    signatureDERToCompact: ((signature) => Uint8Array | string);
    uncompressPublicKey: ((publicKey) => Uint8Array | string);
    validatePrivateKey: ((privateKey) => boolean);
    validatePublicKey: ((publicKey) => boolean);
    verifySignatureCompact: ((signature, publicKey, messageHash) => boolean);
    verifySignatureCompactLowS: ((signature, publicKey, messageHash) => boolean);
    verifySignatureDER: ((signature, publicKey, messageHash) => boolean);
    verifySignatureDERLowS: ((signature, publicKey, messageHash) => boolean);
    verifySignatureSchnorr: ((signature, publicKey, messageHash) => boolean);
}

An object that exposes a set of purely-functional Secp256k1 methods.

Example

import { secp256k1 } from '@bitauth/libauth';
import { msgHash, pubkey, sig } from 'somewhere';

secp256k1.verifySignatureDERLowS(sig, pubkey, msgHash)
? console.log('🚀 Signature valid')
: console.log('❌ Signature invalid');

Type declaration

  • addTweakPrivateKey: ((privateKey, tweakValue) => Uint8Array | string)

    Tweak a privateKey by adding tweakValue to it.

    Returns an error message if the private key is invalid or if the addition fails.

    Param: privateKey

    a valid secp256k1 private key

    Param: tweakValue

    256 bit value to tweak by (BE)

      • (privateKey, tweakValue): Uint8Array | string
      • Tweak a privateKey by adding tweakValue to it.

        Returns an error message if the private key is invalid or if the addition fails.

        Parameters

        • privateKey: Uint8Array

          a valid secp256k1 private key

        • tweakValue: Uint8Array

          256 bit value to tweak by (BE)

        Returns Uint8Array | string

  • addTweakPublicKeyCompressed: ((publicKey, tweakValue) => Uint8Array | string)

    Tweak a publicKey by adding tweakValue times the generator to it.

    Returns an error message if the provided public key could not be parsed or is not valid, or if the addition failed.

    The returned public key will be in compressed format.

    Param: publicKey

    a public key.

    Param: tweakValue

    256 bit value to tweak by (BE)

      • (publicKey, tweakValue): Uint8Array | string
      • Tweak a publicKey by adding tweakValue times the generator to it.

        Returns an error message if the provided public key could not be parsed or is not valid, or if the addition failed.

        The returned public key will be in compressed format.

        Parameters

        • publicKey: Uint8Array

          a public key.

        • tweakValue: Uint8Array

          256 bit value to tweak by (BE)

        Returns Uint8Array | string

  • addTweakPublicKeyUncompressed: ((publicKey, tweakValue) => Uint8Array | string)

    Tweak a publicKey by adding tweakValue times the generator to it.

    Returns an error message if the provided public key could not be parsed or is not valid, or if the addition failed.

    The returned public key will be in uncompressed format.

    Param: publicKey

    a public key.

    Param: tweakValue

    256 bit value to tweak by (BE)

      • (publicKey, tweakValue): Uint8Array | string
      • Tweak a publicKey by adding tweakValue times the generator to it.

        Returns an error message if the provided public key could not be parsed or is not valid, or if the addition failed.

        The returned public key will be in uncompressed format.

        Parameters

        • publicKey: Uint8Array

          a public key.

        • tweakValue: Uint8Array

          256 bit value to tweak by (BE)

        Returns Uint8Array | string

  • compressPublicKey: ((publicKey) => Uint8Array | string)

    Compress a valid ECDSA public key. Returns a public key in compressed format (33 bytes, header byte 0x02 or 0x03).

    This function supports parsing compressed (33 bytes, header byte 0x02 or 0x03), uncompressed (65 bytes, header byte 0x04), or hybrid (65 bytes, header byte 0x06 or 0x07) format public keys.

    Returns an error message if the provided public key could not be parsed or is not valid.

    Param: privateKey

    a public key to compress

      • (publicKey): Uint8Array | string
      • Compress a valid ECDSA public key. Returns a public key in compressed format (33 bytes, header byte 0x02 or 0x03).

        This function supports parsing compressed (33 bytes, header byte 0x02 or 0x03), uncompressed (65 bytes, header byte 0x04), or hybrid (65 bytes, header byte 0x06 or 0x07) format public keys.

        Returns an error message if the provided public key could not be parsed or is not valid.

        Parameters

        • publicKey: Uint8Array

        Returns Uint8Array | string

  • derivePublicKeyCompressed: ((privateKey) => Uint8Array | string)

    Derive a compressed public key from a valid secp256k1 private key.

    Returns an error message if the provided private key is too large (see validatePrivateKey).

    Param: privateKey

    a valid secp256k1, 32-byte private key

      • (privateKey): Uint8Array | string
      • Derive a compressed public key from a valid secp256k1 private key.

        Returns an error message if the provided private key is too large (see validatePrivateKey).

        Parameters

        • privateKey: Uint8Array

          a valid secp256k1, 32-byte private key

        Returns Uint8Array | string

  • derivePublicKeyUncompressed: ((privateKey) => Uint8Array | string)

    Derive an uncompressed public key from a valid secp256k1 private key.

    Returns an error message if the provided private key is too large (see validatePrivateKey).

    Param: privateKey

    a valid secp256k1, 32-byte private key

      • (privateKey): Uint8Array | string
      • Derive an uncompressed public key from a valid secp256k1 private key.

        Returns an error message if the provided private key is too large (see validatePrivateKey).

        Parameters

        • privateKey: Uint8Array

          a valid secp256k1, 32-byte private key

        Returns Uint8Array | string

  • malleateSignatureCompact: ((signature) => Uint8Array | string)

    Malleate a compact-encoded ECDSA signature.

    This is done by negating the S value modulo the order of the curve, "flipping" the sign of the random point R that is not included in the signature.

    Returns an error message if compact-signature parsing fails.

    Param: signature

    a compact-encoded ECDSA signature to malleate, max 72 bytes

      • (signature): Uint8Array | string
      • Malleate a compact-encoded ECDSA signature.

        This is done by negating the S value modulo the order of the curve, "flipping" the sign of the random point R that is not included in the signature.

        Returns an error message if compact-signature parsing fails.

        Parameters

        • signature: Uint8Array

          a compact-encoded ECDSA signature to malleate, max 72 bytes

        Returns Uint8Array | string

  • malleateSignatureDER: ((signature) => Uint8Array | string)

    Malleate a DER-encoded ECDSA signature.

    This is done by negating the S value modulo the order of the curve, "flipping" the sign of the random point R that is not included in the signature.

    Returns an error message if DER-signature parsing fails.

    Param: signature

    a DER-encoded ECDSA signature to malleate, max 72 bytes

      • (signature): Uint8Array | string
      • Malleate a DER-encoded ECDSA signature.

        This is done by negating the S value modulo the order of the curve, "flipping" the sign of the random point R that is not included in the signature.

        Returns an error message if DER-signature parsing fails.

        Parameters

        • signature: Uint8Array

          a DER-encoded ECDSA signature to malleate, max 72 bytes

        Returns Uint8Array | string

  • mulTweakPrivateKey: ((privateKey, tweakValue) => Uint8Array | string)

    Tweak a privateKey by multiplying it by a tweakValue.

    Returns an error message if the private key is invalid or if the multiplication fails.

    Param: privateKey

    a valid secp256k1 private key

    Param: tweakValue

    256 bit value to tweak by (BE)

      • (privateKey, tweakValue): Uint8Array | string
      • Tweak a privateKey by multiplying it by a tweakValue.

        Returns an error message if the private key is invalid or if the multiplication fails.

        Parameters

        • privateKey: Uint8Array

          a valid secp256k1 private key

        • tweakValue: Uint8Array

          256 bit value to tweak by (BE)

        Returns Uint8Array | string

  • mulTweakPublicKeyCompressed: ((publicKey, tweakValue) => Uint8Array | string)

    Tweak a publicKey by multiplying tweakValue to it.

    Returns an error message if the provided public key could not be parsed or is not valid, or if the multiplication failed.

    The returned public key will be in compressed format.

    Param: publicKey

    a public key.

    Param: tweakValue

    256 bit value to tweak by (BE)

      • (publicKey, tweakValue): Uint8Array | string
      • Tweak a publicKey by multiplying tweakValue to it.

        Returns an error message if the provided public key could not be parsed or is not valid, or if the multiplication failed.

        The returned public key will be in compressed format.

        Parameters

        • publicKey: Uint8Array

          a public key.

        • tweakValue: Uint8Array

          256 bit value to tweak by (BE)

        Returns Uint8Array | string

  • mulTweakPublicKeyUncompressed: ((publicKey, tweakValue) => Uint8Array | string)

    Tweak a publicKey by multiplying tweakValue to it.

    Returns an error message if the provided public key could not be parsed or is not valid, or if the multiplication failed.

    The returned public key will be in uncompressed format.

    Param: publicKey

    a public key.

    Param: tweakValue

    256 bit value to tweak by (BE)

      • (publicKey, tweakValue): Uint8Array | string
      • Tweak a publicKey by multiplying tweakValue to it.

        Returns an error message if the provided public key could not be parsed or is not valid, or if the multiplication failed.

        The returned public key will be in uncompressed format.

        Parameters

        • publicKey: Uint8Array

          a public key.

        • tweakValue: Uint8Array

          256 bit value to tweak by (BE)

        Returns Uint8Array | string

  • normalizeSignatureCompact: ((signature) => Uint8Array | string)

    Normalize a compact-encoded ECDSA signature to lower-S form.

    Returns an error message if compact-signature parsing fails.

    Param: signature

    a compact-encoded ECDSA signature to normalize to lower-S form, max 72 bytes

      • (signature): Uint8Array | string
      • Normalize a compact-encoded ECDSA signature to lower-S form.

        Returns an error message if compact-signature parsing fails.

        Parameters

        • signature: Uint8Array

          a compact-encoded ECDSA signature to normalize to lower-S form, max 72 bytes

        Returns Uint8Array | string

  • normalizeSignatureDER: ((signature) => Uint8Array | string)

    Normalize a DER-encoded ECDSA signature to lower-S form.

    Returns an error message if DER-signature parsing fails.

    Param: signature

    a DER-encoded ECDSA signature to normalize to lower-S form, max 72 bytes

      • (signature): Uint8Array | string
      • Normalize a DER-encoded ECDSA signature to lower-S form.

        Returns an error message if DER-signature parsing fails.

        Parameters

        • signature: Uint8Array

          a DER-encoded ECDSA signature to normalize to lower-S form, max 72 bytes

        Returns Uint8Array | string

  • recoverPublicKeyCompressed: ((signature, recoveryId, messageHash) => Uint8Array | string)

    Compute a compressed public key from a valid signature, recovery number, and the messageHash used to generate them.

    Returns an error message if the provided arguments are mismatched.

    Param: signature

    an ECDSA signature in compact format

    Param: recovery

    the recovery number

    Param: messageHash

    the hash used to generate the signature and recovery number

      • (signature, recoveryId, messageHash): Uint8Array | string
      • Compute a compressed public key from a valid signature, recovery number, and the messageHash used to generate them.

        Returns an error message if the provided arguments are mismatched.

        Parameters

        • signature: Uint8Array

          an ECDSA signature in compact format

        • recoveryId: RecoveryId
        • messageHash: Uint8Array

          the hash used to generate the signature and recovery number

        Returns Uint8Array | string

  • recoverPublicKeyUncompressed: ((signature, recoveryId, messageHash) => Uint8Array | string)

    Compute an uncompressed public key from a valid signature, recovery number, and the messageHash used to generate them.

    Returns an error message if the provided arguments are mismatched.

    Param: signature

    an ECDSA signature in compact format

    Param: recovery

    the recovery number

    Param: messageHash

    the hash used to generate the signature and recovery number

      • (signature, recoveryId, messageHash): Uint8Array | string
      • Compute an uncompressed public key from a valid signature, recovery number, and the messageHash used to generate them.

        Returns an error message if the provided arguments are mismatched.

        Parameters

        • signature: Uint8Array

          an ECDSA signature in compact format

        • recoveryId: RecoveryId
        • messageHash: Uint8Array

          the hash used to generate the signature and recovery number

        Returns Uint8Array | string

  • signMessageHashCompact: ((privateKey, messageHash) => Uint8Array | string)

    Create an ECDSA signature in compact format. The created signature is always in lower-S form and follows RFC 6979.

    Returns an error message if the provided private key is too large (see validatePrivateKey).

    Param: privateKey

    a valid secp256k1 private key

    Param: messageHash

    the 32-byte message hash to be signed

      • (privateKey, messageHash): Uint8Array | string
      • Create an ECDSA signature in compact format. The created signature is always in lower-S form and follows RFC 6979.

        Returns an error message if the provided private key is too large (see validatePrivateKey).

        Parameters

        • privateKey: Uint8Array

          a valid secp256k1 private key

        • messageHash: Uint8Array

          the 32-byte message hash to be signed

        Returns Uint8Array | string

  • signMessageHashDER: ((privateKey, messageHash) => Uint8Array | string)

    Create an ECDSA signature in DER format. The created signature is always in lower-S form and follows RFC 6979.

    Returns an error message if the provided private key is too large (see validatePrivateKey).

    Param: privateKey

    a valid secp256k1, 32-byte private key

    Param: messageHash

    the 32-byte message hash to be signed

      • (privateKey, messageHash): Uint8Array | string
      • Create an ECDSA signature in DER format. The created signature is always in lower-S form and follows RFC 6979.

        Returns an error message if the provided private key is too large (see validatePrivateKey).

        Parameters

        • privateKey: Uint8Array

          a valid secp256k1, 32-byte private key

        • messageHash: Uint8Array

          the 32-byte message hash to be signed

        Returns Uint8Array | string

  • signMessageHashRecoverableCompact: ((privateKey, messageHash) => RecoverableSignature | string)

    Create an ECDSA signature in compact format. The created signature is always in lower-S form and follows RFC 6979.

    Also returns a recovery number for use in the recoverPublicKey* functions

    Returns an error message if the provided private key is too large (see validatePrivateKey).

    Param: privateKey

    a valid secp256k1, 32-byte private key

    Param: messageHash

    the 32-byte message hash to be signed

      • (privateKey, messageHash): RecoverableSignature | string
      • Create an ECDSA signature in compact format. The created signature is always in lower-S form and follows RFC 6979.

        Also returns a recovery number for use in the recoverPublicKey* functions

        Returns an error message if the provided private key is too large (see validatePrivateKey).

        Parameters

        • privateKey: Uint8Array

          a valid secp256k1, 32-byte private key

        • messageHash: Uint8Array

          the 32-byte message hash to be signed

        Returns RecoverableSignature | string

  • signMessageHashSchnorr: ((privateKey, messageHash) => Uint8Array | string)

    Create a Secp256k1 EC-Schnorr-SHA256 signature (Bitcoin Cash construction).

    Signatures are 64-bytes, non-malleable, and support both batch validation and multiparty signing. Nonces are generated using RFC6979, where the Section 3.6, 16-byte ASCII "additional data" is set to Schnorr+SHA256 . This avoids leaking a private key by inadvertently creating both an ECDSA signature and a Schnorr signature using the same nonce.

    Returns an error message if the provided private key is too large (see validatePrivateKey).

    Param: privateKey

    a valid secp256k1, 32-byte private key

    Param: messageHash

    the 32-byte message hash to be signed

      • (privateKey, messageHash): Uint8Array | string
      • Create a Secp256k1 EC-Schnorr-SHA256 signature (Bitcoin Cash construction).

        Signatures are 64-bytes, non-malleable, and support both batch validation and multiparty signing. Nonces are generated using RFC6979, where the Section 3.6, 16-byte ASCII "additional data" is set to Schnorr+SHA256 . This avoids leaking a private key by inadvertently creating both an ECDSA signature and a Schnorr signature using the same nonce.

        Returns an error message if the provided private key is too large (see validatePrivateKey).

        Parameters

        • privateKey: Uint8Array

          a valid secp256k1, 32-byte private key

        • messageHash: Uint8Array

          the 32-byte message hash to be signed

        Returns Uint8Array | string

  • signatureCompactToDER: ((signature) => Uint8Array | string)

    Convert a compact-encoded ECDSA signature to DER encoding.

    Returns an error message if parsing of compact-encoded signature fails.

    Param: signature

    a compact-encoded ECDSA signature to convert

      • (signature): Uint8Array | string
      • Convert a compact-encoded ECDSA signature to DER encoding.

        Returns an error message if parsing of compact-encoded signature fails.

        Parameters

        • signature: Uint8Array

          a compact-encoded ECDSA signature to convert

        Returns Uint8Array | string

  • signatureDERToCompact: ((signature) => Uint8Array | string)

    Convert a DER-encoded ECDSA signature to compact encoding.

    Returns an error message if parsing of DER-encoded signature fails.

    Param: signature

    a DER-encoded ECDSA signature to convert

      • (signature): Uint8Array | string
      • Convert a DER-encoded ECDSA signature to compact encoding.

        Returns an error message if parsing of DER-encoded signature fails.

        Parameters

        • signature: Uint8Array

          a DER-encoded ECDSA signature to convert

        Returns Uint8Array | string

  • uncompressPublicKey: ((publicKey) => Uint8Array | string)

    Uncompress a valid ECDSA public key. Returns a public key in uncompressed format (65 bytes, header byte 0x04).

    This function supports parsing compressed (33 bytes, header byte 0x02 or 0x03), uncompressed (65 bytes, header byte 0x04), or hybrid (65 bytes, header byte 0x06 or 0x07) format public keys.

    Returns an error message if the provided public key could not be parsed or is not valid.

    Param: publicKey

    a public key to uncompress

      • (publicKey): Uint8Array | string
      • Uncompress a valid ECDSA public key. Returns a public key in uncompressed format (65 bytes, header byte 0x04).

        This function supports parsing compressed (33 bytes, header byte 0x02 or 0x03), uncompressed (65 bytes, header byte 0x04), or hybrid (65 bytes, header byte 0x06 or 0x07) format public keys.

        Returns an error message if the provided public key could not be parsed or is not valid.

        Parameters

        • publicKey: Uint8Array

          a public key to uncompress

        Returns Uint8Array | string

  • validatePrivateKey: ((privateKey) => boolean)

    Verify that a private key is valid for secp256k1. Note, this library requires all private keys to be provided as 32-byte Uint8Arrays (an array length of 32).

    Nearly every 256-bit number is a valid secp256k1 private key. Specifically, any 256-bit number greater than or equal to 0x01 and less than 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 is a valid private key. This range is part of the definition of the secp256k1 elliptic curve parameters.

    This method returns true if the private key is valid or false if it isn't.

    Param: privateKey

    a 32-byte private key to validate

      • (privateKey): boolean
      • Verify that a private key is valid for secp256k1. Note, this library requires all private keys to be provided as 32-byte Uint8Arrays (an array length of 32).

        Nearly every 256-bit number is a valid secp256k1 private key. Specifically, any 256-bit number greater than or equal to 0x01 and less than 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 is a valid private key. This range is part of the definition of the secp256k1 elliptic curve parameters.

        This method returns true if the private key is valid or false if it isn't.

        Parameters

        • privateKey: Uint8Array

          a 32-byte private key to validate

        Returns boolean

  • validatePublicKey: ((publicKey) => boolean)

    Verify that a public key is valid for secp256k1.

    This method returns true if the public key is valid or false if it isn't.

    Param: publicKey

    a public key to validate

      • (publicKey): boolean
      • Verify that a public key is valid for secp256k1.

        This method returns true if the public key is valid or false if it isn't.

        Parameters

        • publicKey: Uint8Array

          a public key to validate

        Returns boolean

  • verifySignatureCompact: ((signature, publicKey, messageHash) => boolean)

    Normalize a signature to lower-S form, then verifySignatureCompactLowS.

    Param: signature

    a compact-encoded ECDSA signature to verify, max 72 bytes

    Param: publicKey

    a public key, in either compressed (33-byte) or uncompressed (65-byte) format

    Param: messageHash

    the 32-byte message hash signed by the signature

      • (signature, publicKey, messageHash): boolean
      • Normalize a signature to lower-S form, then verifySignatureCompactLowS.

        Parameters

        • signature: Uint8Array

          a compact-encoded ECDSA signature to verify, max 72 bytes

        • publicKey: Uint8Array

          a public key, in either compressed (33-byte) or uncompressed (65-byte) format

        • messageHash: Uint8Array

          the 32-byte message hash signed by the signature

        Returns boolean

  • verifySignatureCompactLowS: ((signature, publicKey, messageHash) => boolean)

    Verify a compact-encoded ECDSA signature using the provided publicKey and messageHash. This method also returns false if the signature is not in normalized lower-S form.

    Param: signature

    a compact-encoded ECDSA signature to verify, max 72 bytes

    Param: publicKey

    a public key, in either compressed (33-byte) or uncompressed (65-byte) format

    Param: messageHash

    the 32-byte message hash signed by the signature

      • (signature, publicKey, messageHash): boolean
      • Verify a compact-encoded ECDSA signature using the provided publicKey and messageHash. This method also returns false if the signature is not in normalized lower-S form.

        Parameters

        • signature: Uint8Array

          a compact-encoded ECDSA signature to verify, max 72 bytes

        • publicKey: Uint8Array

          a public key, in either compressed (33-byte) or uncompressed (65-byte) format

        • messageHash: Uint8Array

          the 32-byte message hash signed by the signature

        Returns boolean

  • verifySignatureDER: ((signature, publicKey, messageHash) => boolean)

    Normalize a signature to lower-S form, then verifySignatureDERLowS.

    Param: signature

    a DER-encoded ECDSA signature to verify, max 72 bytes

    Param: publicKey

    a public key, in either compressed (33-byte) or uncompressed (65-byte) format

    Param: messageHash

    the 32-byte message hash signed by the signature

      • (signature, publicKey, messageHash): boolean
      • Normalize a signature to lower-S form, then verifySignatureDERLowS.

        Parameters

        • signature: Uint8Array

          a DER-encoded ECDSA signature to verify, max 72 bytes

        • publicKey: Uint8Array

          a public key, in either compressed (33-byte) or uncompressed (65-byte) format

        • messageHash: Uint8Array

          the 32-byte message hash signed by the signature

        Returns boolean

  • verifySignatureDERLowS: ((signature, publicKey, messageHash) => boolean)

    Verify a DER-encoded ECDSA signature using the provided publicKey and messageHash. This method also returns false if the signature is not in normalized lower-S form.

    Param: signature

    a DER-encoded ECDSA signature to verify, max 72 bytes

    Param: publicKey

    a public key, in either compressed (33-byte) or uncompressed (65-byte) format

    Param: messageHash

    the 32-byte message hash signed by the signature

      • (signature, publicKey, messageHash): boolean
      • Verify a DER-encoded ECDSA signature using the provided publicKey and messageHash. This method also returns false if the signature is not in normalized lower-S form.

        Parameters

        • signature: Uint8Array

          a DER-encoded ECDSA signature to verify, max 72 bytes

        • publicKey: Uint8Array

          a public key, in either compressed (33-byte) or uncompressed (65-byte) format

        • messageHash: Uint8Array

          the 32-byte message hash signed by the signature

        Returns boolean

  • verifySignatureSchnorr: ((signature, publicKey, messageHash) => boolean)

    Verify a Secp256k1 EC-Schnorr-SHA256 signature (Bitcoin Cash construction).

    Param: signature

    a 64-byte schnorr signature to verify

    Param: publicKey

    a public key, in either compressed (33-byte) or uncompressed (65-byte) format

    Param: messageHash

    the 32-byte message hash signed by the signature

      • (signature, publicKey, messageHash): boolean
      • Verify a Secp256k1 EC-Schnorr-SHA256 signature (Bitcoin Cash construction).

        Parameters

        • signature: Uint8Array

          a 64-byte schnorr signature to verify

        • publicKey: Uint8Array

          a public key, in either compressed (33-byte) or uncompressed (65-byte) format

        • messageHash: Uint8Array

          the 32-byte message hash signed by the signature

        Returns boolean

Generated using TypeDoc