Function: signMessage()
function signMessage(
address: string,
message: string,
privateKey: PrivateKeyInput,
opts?: {
auxRand?: Uint8Array<ArrayBufferLike>;
prefixed?: boolean;
}): string;Defined in: index.ts:420 (opens in a new tab)
Sign message for address with a BIP-322 simple signature, base64.
address must be the P2WPKH or single-key P2TR (BIP-86) address of
privateKey; anything else throws. P2WPKH signatures are deterministic
(RFC 6979). P2TR signatures use fresh randomness unless auxRand is given.
By default the signature carries no smp prefix, the form every deployed
BIP-322 verifier reads; pass prefixed: true for the finalized BIP's form.
verifySignature accepts both.
ParametersLink to this section
| Parameter | Type |
|---|---|
address | string |
message | string |
privateKey | PrivateKeyInput |
opts | { auxRand?: Uint8Array<ArrayBufferLike>; prefixed?: boolean; } |
opts. | Uint8Array<ArrayBufferLike> |
opts. | boolean |
ReturnsLink to this section
string