evm_sign_message
Signs arbitrary messages with an EVM private key using EIP-191 to prove address ownership for authentication and off-chain verification, without broadcasting a transaction or paying gas.
Instructions
Sign arbitrary message for authentication, verification, or proof-of-ownership (NOT a transaction).
Creates cryptographic signature of a message using private key. Used for authentication flows, message verification, and proving address ownership. Does not broadcast to blockchain.
CRITICAL RULES:
Signs messages, NOT transactions (no gas cost, no broadcast)
Signature can be verified without exposing private key
Standard EIP-191 message signing (\x19Ethereum Signed Message prefix)
Anyone can verify signature matches address (public verification)
Signature is deterministic (same message+key = same signature)
PARAMETERS:
chain: EVM chain context (required but doesn't affect signature)
Signature works across all chains
Chain parameter for consistency
message: Text message to sign (required)
Any UTF-8 text string
Common uses: "Sign in to {app}", "Prove ownership", timestamps
Example: "I approve this action at 2024-01-15T10:30:00Z"
privateKey: Signing key (required, KEEP SECRET)
Format: 0x followed by 64 hex characters
Must be key for address you want to prove ownership of
Never share or log this value
EXAMPLES: ✅ Sign authentication message: {chain: "polygon", message: "Sign in to MyApp", privateKey: "0xac0974..."}
✅ Prove ownership with timestamp: {chain: "ethereum", message: "I own this address - 2024-01-15", privateKey: "0x..."}
✅ Sign structured data: {chain: "bsc", message: "Action: transfer\nAmount: 100\nTimestamp: 1234567890", privateKey: "0x..."}
❌ Invalid - trying to sign transaction: {chain: "polygon", message: "0xf86c...", privateKey: "0x..."} // Use evm_send_transaction
❌ Invalid - wrong key format: {chain: "ethereum", message: "test", privateKey: "1234"}
SUPPORTED EVM CHAINS (7 networks): • ethereum (Sepolia) - EIP-1559 enabled, ~12s blocks, moderate gas costs • polygon (Amoy) - Low fees, fast finality (~2s), layer 2 • avalanche (Fuji C-Chain) - Sub-second finality, dynamic fees • bsc (BNB Testnet) - 3s blocks, low gas costs, Binance ecosystem • arbitrum (Sepolia) - Optimistic rollup, low fees, Ethereum security • base (Sepolia) - Coinbase layer 2, EIP-1559, low fees • worldchain (World Sepolia) - World Network testnet, EIP-1559
CRITICAL GAS CONSIDERATIONS:
Ethereum: High gas costs, use gas oracle for timing
Polygon/BSC: Very low gas, safe for frequent transactions
Arbitrum/Base: L2 optimizations, ~10-50x cheaper than Ethereum
Avalanche: Dynamic fees, can spike during congestion
Always check gas price before executing transactions
TESTNET TOKENS: All chains use testnet tokens with NO REAL VALUE. Faucets available for all supported networks.
OUTPUT STRUCTURE: • success: Boolean indicating signing success • message: Original message that was signed • signature: ECDSA signature (0x... 130 hex chars: r + s + v) • address: Address that created signature (derived from privateKey) • messageHash: Keccak256 hash of prefixed message • executionTime: Time taken in milliseconds
COMMON MISTAKES:
Trying to sign transactions (use evm_send_transaction instead)
Not including timestamp in message (vulnerable to replay)
Exposing private key accidentally
Not implementing signature verification on backend
Assuming signatures expire (they don't - add expiry in message)
USE CASES:
Web3 authentication (Sign-In with Ethereum)
Prove address ownership without transaction
Off-chain message verification
Create signed permits/approvals
Generate proofs for access control
SIGNATURE VERIFICATION:
Frontend: Use ethers.verifyMessage(message, signature)
Backend: Recover address from signature and compare
Anyone can verify signature without private key
Signature proves message was signed by address
SECURITY NOTES:
Never sign messages from untrusted sources
Include context in message (app name, action, timestamp)
Implement message expiry (include timestamp users should check)
Don't sign messages that look like transactions
Running on Linux.
LINUX-SPECIFIC NOTES:
Package manager: apt (Ubuntu/Debian), yum (RHEL/CentOS), or pacman (Arch)
Python 3 is typically 'python3' command
GNU tools are standard
Use 'xdg-open' command to open files/applications
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"chain": "<chain>",
"message": "<message>",
"privateKey": "<privateKey>"
},
"name": "evm_sign_message"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| chain | Yes | EVM chain context | |
| message | Yes | Message to sign (any UTF-8 text) | |
| privateKey | Yes | Private key to sign with (0x... - KEEP SECRET) |