stx_signMessage API method
The `stx_signMessage` API method allows applications to request the signature of an arbitrary message using a user's Stacks address via the Leather extension. This method supports both plain text and SIP-018 structured data messages, and is ideal for off-chain actions such as login verification or agreement consent flows.
May 22, 2025
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.
Disclaimer
Leather does not verify how message signatures are used. Developers are responsible for correct usage and signature verification.