| name | siwx |
| description | CAIP-122 Sign-In with X CLI tool for generating signing messages and verifying signatures across Ethereum and Solana. Use when the user asks to create sign-in challenges, verify wallet signatures, generate nonces, or parse CAIP-122 messages. Supports JSON output via --json flag for agent consumption. |
siwx CLI — CAIP-122 Sign-In with X Tool
siwx is a single binary CLI for generating and verifying blockchain sign-in messages following the CAIP-122 standard. Supports Ethereum (EIP-191) and Solana (Ed25519).
Installation
Shell (macOS / Linux):
curl -fsSL https://sh.qntx.fun/siwx | sh
PowerShell (Windows):
irm https://sh.qntx.fun/siwx/ps | iex
Or via Cargo:
cargo install siwx-cli
Verify installation
siwx --version
CLI Structure
siwx [--json] <chain> <subcommand> [options]
The --json flag is global and must appear before the chain subcommand. When set, all output (including errors) is a single JSON object on stdout.
Commands
| Command | Description |
|---|
evm message | Generate an Ethereum CAIP-122 signing message |
evm verify | Verify an EIP-191 signature |
svm message | Generate a Solana CAIP-122 signing message |
svm verify | Verify an Ed25519 signature |
nonce | Generate a cryptographic nonce |
parse | Parse a CAIP-122 message string into fields |
Chain aliases
| Chain | Primary | Aliases |
|---|
| Ethereum | evm | eth |
| Solana | svm | sol |
Message Generation Flags
| Flag | Required | Description |
|---|
--domain | ✓ | RFC 4501 domain requesting the signing |
--address | ✓ | Blockchain address (0x-hex for EVM, base58 for SVM) |
--uri | ✓ | RFC 3986 URI subject of the signing |
--chain-id | ✓ | CAIP-2 chain identifier (e.g. "1" for Ethereum mainnet) |
--statement | | Human-readable statement |
--nonce | | Nonce (auto-generated if omitted) |
--expiration | | Expiration (RFC 3339 timestamp or seconds from now) |
--not-before | | Not-before time (RFC 3339 or seconds from now) |
--request-id | | System-specific request ID |
--resource | | Resource URI (repeatable) |
--msg-version | | Message version (default: "1") |
Verify Flags
| Flag | Required | Description |
|---|
--message | ✓ | The raw CAIP-122 signing message text |
--signature | ✓ | Hex-encoded signature (0x prefix optional) |
Usage Examples
Generate Ethereum signing message (JSON)
siwx --json evm message \
--domain example.com \
--address 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045 \
--uri https://example.com/login \
--chain-id 1 \
--statement "I accept the Terms of Service"
Generate Solana signing message (JSON)
siwx --json svm message \
--domain example.com \
--address GwAF45zjfyGzUbd3i3hXxzGeuchzEZXwpRYHZM5912F1 \
--uri https://example.com/login \
--chain-id 5eykt4UsFv8P8NJdTREpY1vzqKqZKvdpKuc147dw2N9d
Verify an EIP-191 signature (JSON)
siwx --json evm verify \
--message "example.com wants you to sign in with your Ethereum account:..." \
--signature 0x1234abcd...
Verify a Solana Ed25519 signature (JSON)
siwx --json svm verify \
--message "example.com wants you to sign in with your Solana account:..." \
--signature abcd1234...
Generate a nonce
siwx --json nonce
siwx nonce --len 32
Parse a message
siwx --json parse --message "example.com wants you to sign in with your Ethereum account:..."
JSON Output Schemas
Message Generation
{
"chain": "ethereum",
"message": "example.com wants you to sign in with your Ethereum account:\n0xd8dA...\n\n...",
"domain": "example.com",
"address": "0xd8dA...",
"uri": "https://example.com/login",
"version": "1",
"chain_id": "1",
"nonce": "abc123def456",
"issued_at": "2026-03-20T12:00:00Z"
}
Verify
{
"valid": true,
"chain": "ethereum",
"domain": "example.com",
"address": "0xd8dA..."
}
Nonce
{
"nonce": "M07wdVLtaJVndQAx5",
"len": 17
}
Parse
{
"domain": "example.com",
"address": "0xd8dA...",
"uri": "https://example.com/login",
"version": "1",
"chain_id": "1",
"nonce": "abc123",
"issued_at": "2026-03-20T12:00:00Z"
}
Error
All errors in JSON mode return exit code 1 with:
{
"error": "invalid message format: missing preamble marker"
}
Agent Best Practices
- Always use
--json for programmatic consumption to avoid ANSI escape codes.
--json placement: Must appear before the chain subcommand: siwx --json evm message, not siwx evm --json message.
- Nonce auto-generation: If
--nonce is omitted in message, a 17-character cryptographic nonce is auto-generated.
- Issued-at auto-set:
issued_at is always set to the current UTC time.
- Expiration shorthand: Pass seconds for relative expiration:
--expiration 3600 = 1 hour from now.
- Verify reads address from message: For SVM verify, the public key is derived from the address in the parsed message.
- Errors in JSON mode return
{"error": "..."} with exit code 1.
- Signature format: Always hex-encoded,
0x prefix is optional.