UNPKG

@bsv/sdk

Version:

BSV Blockchain Software Development Kit

29 lines 1.72 kB
import PrivateKey from '../primitives/PrivateKey.js'; import PublicKey from '../primitives/PublicKey.js'; import Signature from '../primitives/Signature.js'; /** * Generates a SHA256 double-hash of the prefixed message. * @deprecated Replaced by BRC-77 which uses a more secure and private method for message signing. * @param messageBuf The message buffer to be hashed. * @returns The double-hash of the prefixed message as a number array. */ export declare const magicHash: (messageBuf: number[]) => number[]; /** * Signs a BSM message using the given private key. * @deprecated Replaced by BRC-77 which employs BRC-42 key derivation and BRC-43 invoice numbers for enhanced security and privacy. * @param message The message to be signed as a number array. * @param privateKey The private key used for signing the message. * @param mode The mode of operation. When "base64", the BSM format signature is returned. When "raw", a Signature object is returned. Default: "base64". * @returns The signature object when in raw mode, or the BSM base64 string when in base64 mode. */ export declare const sign: (message: number[], privateKey: PrivateKey, mode?: "raw" | "base64") => Signature | string; /** * Verifies a BSM signed message using the given public key. * @deprecated Replaced by BRC-77 which provides privately-verifiable signatures and avoids key reuse. * @param message The message to be verified as a number array. * @param sig The signature object. * @param pubKey The public key for verification. * @returns True if the signature is valid, false otherwise. */ export declare const verify: (message: number[], sig: Signature, pubKey: PublicKey) => boolean; //# sourceMappingURL=BSM.d.ts.map