CCC Docs
    Preparing search index...

    Function messageHashBtcEcdsa

    • Computes the message hash for Bitcoin ECDSA signatures. This function follows the Bitcoin message signing standard, which involves prefixing the message with a magic string and its length, then double SHA256 hashing the result.

      Parameters

      • message: BytesLike

        The message to be hashed. Can be a string or BytesLike.

      • OptionalmessagePrefix: BytesLike

        Optional. A custom prefix to use instead of the default "\u0018Bitcoin Signed Message:\n".

      Returns Bytes

      The Bitcoin hash of the prefixed message as Bytes.