wallet-cli message sign

July 16, 2026 · View on GitHub

Sign an arbitrary message (TIP-191/V2 · EIP-191).

Synopsis

wallet-cli message sign (--message <text> | --message-stdin) [options]

Description

Signs a message with the active account's key (or --account) using TRON's TIP-191/V2 personal-message scheme (EIP-191 compatible). Signing only — nothing is broadcast; --network is optional and can be omitted for fully offline signing.

stdin has a single consumer (fd 0): --message-stdin and --password-stdin cannot both be used in one run (secret_source_error). In practice:

  • Ledger accounts confirm on the device and need no master password — fd 0 is free, so you can pipe the message via --message-stdin.
  • Software accounts need --password-stdin for non-interactive use — the message must then go inline via --message.

Watch-only accounts cannot sign (watch_only_no_signer).

Options

OptionDescription
--message <string>Message text to sign; exactly one of --message / --message-stdin
--message-stdinRead the message from stdin (fd 0)
--password-stdinMaster password from stdin (software accounts)

Plus the global options.

Examples

In the examples, $PW is your master password (from an environment variable, password manager, etc.), fed on stdin via --password-stdin.

Software account — password via stdin, message inline:

echo "$PW" | wallet-cli message sign --message "hello" --password-stdin
✅ Signed
  Address    TMSgJxtPw29AFEHMXsjGo4kWV7UwbCToHJ
  Signature  0x9f3c...
echo "$PW" | wallet-cli message sign --message "hello" --password-stdin -o json
{"schema":"wallet-cli.result.v1","success":true,"command":"message.sign","data":{"address":"TMSgJxtPw29AFEHMXsjGo4kWV7UwbCToHJ","message":"hello","signature":"0x9f3c..."},"meta":{"durationMs":15,"warnings":[]},"chain":{"family":"tron","network":"tron:nile","chainId":"nile"}}

Ledger account — message via stdin, confirm on device:

cat challenge.txt | wallet-cli message sign --message-stdin --network tron:nile

Output

FieldTypeMeaning
addressstringSigner's base58 address
messagestringThe message that was signed
signaturestringSignature, 0x-prefixed hex

Exit status

0 signed · 1 execution failure (watch_only_no_signer, auth_failed; two stdin flags → secret_source_error) · 2 usage error (both or neither message source → invalid_option / missing_option).

See also

Security model · machine-interface → Secret handling