Help Center

Developer Docs

stx_signMessage API method

May 22, 2025

Leather does not verify how message signatures are used. Developers are responsible for correct usage and signature verification.

stx_signMessage

Request the signature of an arbitrary message with the Stacks address of an account.

Method name

stx_signMessage

Parameters

  • message (string, required): Arbitrary message to be signed.
  • messageType (string, optional): utf8 for basic string or structured for SIP-018 structured data.
  • network (string, optional): Target network (testnet is default). Supports mainnet, testnet, signet, sbtcDevenv, devnet.
  • domain (string, optional): Required only for structured messages. Follows SIP-018 domain tuple.

Example request

[Unsupported block type: code]

Example response

[Unsupported block type: code]

Sandbox

To try this live in a prebuilt example, open the stx_signMessage sandbox on CodeSandbox.

Make sure the Leather extension is installed and running.