Skip to main content
Signs a message with the wallet’s identity key.

Method Signature

async signMessageWithIdentityKey(
  message: string,
  compact?: boolean
): Promise<string>

Parameters

message
string
required
The message to sign
compact
boolean
Whether to use compact encoding. If false, uses DER encoding.

Returns

signature
string
required
The signature as a hex string

Example

const signature = await wallet.signMessageWithIdentityKey("Hello, Spark!");
console.log("Signature:", signature);

// Compact encoding
const compactSig = await wallet.signMessageWithIdentityKey("Hello", true);