sign_message_btc
Sign a message with a Bitcoin address from your Ledger. Returns a signature and SHA-256 hash. Blocks dangerous strings to prevent social-engineering attacks.
Instructions
Sign a UTF-8 message with a paired Bitcoin address using the Bitcoin Signed Message format (BIP-137). Returns a base64-encoded compact signature with a header byte that matches the address-type convention (legacy / P2SH-wrapped / native segwit) AND messageSha256 — a lowercase hex SHA-256 of the exact UTF-8 bytes submitted to the device (Inv #8 byte-fingerprint, issue #454). Surface messageSha256 in the verbatim message-sign block so the user can recompute on a separate device (printf '%s' '<message>' | sha256sum) and catch unicode-confusable substitution attacks the Ledger Nano OLED can't show in full. The Ledger BTC app prompts the user to confirm the message text on-device before signing — same clear-sign UX as send-side flows. DRAINER-STRING REFUSAL (issue #454): the MCP refuses messages containing value-transfer / authorization markers (transfer / authorize / grant / custody / release / consent) or explicit drainer templates ("I authorize", "granting full custody", "I consent to", "I hereby transfer", "release my") BEFORE any device interaction — fires regardless of agent cooperation. Legitimate Sign-In-with-Bitcoin / proof-of-funds flows don't use these markers. Taproot (bc1p…) addresses are refused: BIP-322 (taproot's canonical message scheme) is not yet exposed by the Ledger BTC app; sign with one of your other paired address types from the same Ledger account instead.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| wallet | Yes | Paired Bitcoin source address. Must already be in `pairings.bitcoin` (call `pair_ledger_btc` first). Phase 1 message-signing supports legacy (`1...`), P2SH-wrapped (`3...`), and native segwit (`bc1q...`); taproot (`bc1p...`) is refused because BIP-322 — taproot's canonical scheme — is not yet exposed by the Ledger BTC app. | |
| message | Yes | UTF-8 message to sign. Typical Sign-In-with-Bitcoin payloads are a few hundred chars; capped at 10000 because the Ledger BTC app's on-device review window chunks the message into 16-char segments and a multi-KB string isn't realistically reviewable. |