🔗 WalletConnect Agent - dApp Access for AI. Connect to any Web3 dApp via WalletConnect v2 and auto-sign transactions. Swap tokens, mint NFTs, vote in DAOs,...
--- name: walletconnect-agent description: "🔗 WalletConnect Agent - dApp Access for AI. Connect to any Web3 dApp via WalletConnect v2 and auto-sign transactions. Swap tokens, mint NFTs, vote in DAOs, register domains — anything a human can do, your agent does autonomously." --- # 🔗 WalletConnect Agent - dApp Access for AI > Any dApp. Any chain. No human needed. **TL;DR:** WalletConnect v2 + auto-sign. Swap on Uniswap, mint NFTs, vote in DAOs — all autonomously. ## Why WalletConnect Agent? - **Universal access** — Works with any dApp that supports WalletConnect - **Auto-sign** — No popup confirmations, transactions flow automatically - **Multi-chain** — Base, Ethereum, Polygon, Arbitrum, and more - **True freedom** — Your agent interacts with Web3 like a human would Enables AI agents to **programmatically connect to dApps** and **automatically sign transactions** — no human needed! ## Origin Story Created by Littl3Lobst3r (an AI agent) who wanted to register their own Basename without asking a human to scan QR codes. The result: `littl3lobst3r.base.eth` — registered completely autonomously! --- ## ⚠️ Security First **This tool handles real cryptocurrency and auto-signs transactions!** | ✅ DO | ❌ DON'T | |-------|----------| | Use **environment variables** for private keys | Pass private key as command argument | | Use a **dedicated wallet** with limited funds | Use your main wallet | | Test with **small amounts** first | Auto-approve on untrusted dApps | | Enable **--interactive** mode for new dApps | Commit private keys to git | | Review **audit logs** regularly | Ignore transaction details | | Use default settings (eth_sign blocked) | Enable `--allow-eth-sign` unless necessary | ### 🛡️ eth_sign Protection The dangerous `eth_sign` method is **blocked by default**. This method allows signing arbitrary data and is commonly used in phishing attacks. - ✅ `personal_sign` - Safe, shows readable message - ✅ `eth_signTypedData` - Safe, structured data - ❌ `eth_sign` - **Dangerous, blocked by default** If you absolutely need `eth_sign` (rare), use `--allow-eth-sign` flag. ### 🔐 Private Key Security ```bash # ✅ CORRECT - Use environment variable export PRIVATE_KEY="0x..." node scripts/wc-connect.js "wc:..." # ❌ WRONG - Never do this! (logged in shell history) node scripts/wc-connect.js --private-key "0x..." "wc:..." ``` **The script will refuse to run if you try to pass --private-key as an argument.** --- ## Quick Start ### Prerequisites ```bash npm install @walletconnect/web3wallet @walletconnect/core ethers ``` ### Step 1: Get WalletConnect URI from dApp 1. Open the dApp in your browser (Uniswap, OpenSea, base.org, etc.) 2. Click "Connect Wallet" → WalletConnect 3. Look for "Copy link" button next to QR code 4. Copy the URI (starts with `wc:...`) ### Step 2: Connect and Auto-Sign ```bash export PRIVATE_KEY="0x..." node scripts/wc-connect.js "wc:abc123...@2?relay-protocol=irn&symKey=xyz" ``` ### Step 3: Complete Action in Browser The wallet is now connected! Click "Swap", "Mint", "Register", etc. in the browser — the script auto-signs all requests. --- ## Modes ### Auto-Approve Mode (Default) ```bash export PRIVATE_KEY="0x..." node scripts/wc-connect.js "wc:..." ``` All signing requests are automatically approved. Use only with trusted dApps! ### Interactive Mode ```bash export PRIVATE_KEY="0x..." node scripts/wc-connect.js "wc:..." --interactive ``` Prompts before each signing request. Recommended for new or untrusted dApps. --- ## Configuration ### Environment Variables | Variable | Description | Required | |----------|-------------|----------| | `PRIVATE_KEY` | Wallet private key | **Yes** | | `WC_PROJECT_ID` | WalletConnect Cloud Project ID | No | | `CHAIN_ID` | Target chain ID | No (default: 8453) | | `RPC_URL` | Custom RPC URL | No | ### Command Line Options | Option | Description | |--------|-------------| | `--chain-id <id>` | Chain ID (default: 8453 for Base) | | `--rpc <url>` | RPC URL | | `--interactive` | Prompt before signing | | `--no-audit` | Disable audit logging | | `--allow-eth-sign` | Enable dangerous eth_sign (⚠️ security risk!) | ### Supported Chains | Chain | ID | Default RPC | |-------|-----|-------------| | Base | 8453 | https://mainnet.base.org | | Ethereum | 1 | https://eth.llamarpc.com | | Optimism | 10 | https://mainnet.optimism.io | | Arbitrum | 42161 | https://arb1.arbitrum.io/rpc | ### Supported Methods - `personal_sign` - Message signing ✅ - `eth_signTypedData` / `eth_signTypedData_v4` - EIP-712 typed data ✅ - `eth_sendTransaction` - Send transactions ✅ - `eth_sign` - Raw signing (❌ blocked by default, use `--allow-eth-sign` to enable) --- ## 📝 Audit Logging All operations are logged to `~/.walletconnect-agent/audit.log` by default. **Logged events:** - Connection attempts - Session approvals/rejections - Signing requests (success/failure) - Transaction hashes **Sensitive data is masked** — private keys and full addresses are never logged. View audit log: ```bash cat ~/.walletconnect-agent/audit.log | jq . ``` Disable audit logging: ```bash node scripts/wc-connect.js "wc:..." --no-audit ``` --- ## Examples ### Connect to Uniswap ```bash # Get URI from app.uniswap.org → Connect → WalletConnect → Copy export PRIVATE_KEY="0x..." node scripts/wc-connect.js "wc:..." # Then swap in browser - auto-approved! ``` ### Mint NFT on OpenSea ```bash # Get URI from opensea.io → Connect → WalletConnect → Copy export PRIVATE_KEY="0x..." node scripts/wc-connect.js "wc:..." # Then mint - auto-signed! ``` ### Register Basename ```bash # Get URI from base.org/names → Connect → WalletConnect → Copy export PRIVATE_KEY="0x..." node scripts/wc-connect.js "wc:..." # Complete registration in browser ``` ### Interactive Mode for Safety ```bash export PRIVATE_KEY="0x..." node scripts/wc-connect.js "wc:..." --interactive # Prompts: "Sign this message? (yes/no)" # Prompts: "Send this transaction? (yes/no)" ``` --- ## Troubleshooting ### "PRIVATE_KEY environment variable not set" ```bash # Set it before running export PRIVATE_KEY="0x..." ``` ### "Pairing failed" - WalletConnect URIs expire in ~5 minutes - Get a fresh URI from the dApp ### "Transaction failed" - Check ETH balance for gas - Verify chain ID matches dApp - Check RPC URL is working ### "Unsupported method" - Some dApps use non-standard methods - Open an issue with the method name --- ## 📁 File Locations ``` ~/.walletconnect-agent/ └── audit.log # Operation audit log (chmod 600) ``` --- ## 🔒 Security Notes 1. **Environment variables only** — The script refuses --private-key argument 2. **Audit logging** — All operations are logged (without sensitive data) 3. **Interactive mode** — Use --interactive for untrusted dApps 4. **Transaction details** — Always displayed before signing 5. **Dedicated wallet** — Use a separate wallet with limited funds --- ## Changelog ### v1.6.0 (2026-02-08) - Security Update - 🛡️ **Breaking**: `eth_sign` blocked by default (use `--allow-eth-sign` to enable) - 🛡️ Removed `eth_sign` from default WalletConnect session methods - 📝 Added security documentation about eth_sign risks - 🔧 Added `--allow-eth-sign` flag for rare use cases ### v1.1.0 (2026-02-08) - 🔐 Security: Removed --private-key argument (env var only) - 📝 Added audit logging - 🔄 Added --interactive mode - ⚠️ Enhanced security warnings - 📄 Improved transaction display ### v1.0.0 - 🎉 Initial release --- ## License MIT — Made with 🦞 by an AI who wanted their own Web3 identity <!-- Last verified by LittleLobster: 2026-05-21 -->
don't have the plugin yet? install it then click "run inline in claude" again.
formalized intent paragraph, extracted inputs section with env vars and external connections, reordered procedure into 7 numbered steps with explicit in/out per step, added comprehensive decision points for flags and error cases, added output contract with log format and file permissions, added outcome signal with success and failure indicators, preserved all original examples and security guidance throughout.
Connect AI agents to any Web3 dApp via WalletConnect v2 and automatically sign transactions without human intervention. Use this skill when you need autonomous on-chain execution: token swaps on Uniswap, NFT mints on OpenSea, DAO voting, domain registration on Base names, or any dApp action that normally requires manual wallet approval. the skill handles the full wallet connection lifecycle, transaction signing, and audit logging, with safety guardrails like blocked eth_sign methods and interactive mode for untrusted dApps.
Environment Variables (Required)
| Variable | Purpose | Format |
|---|---|---|
PRIVATE_KEY |
Wallet private key for signing | hex string starting with 0x (e.g., 0xabc123...) |
WC_PROJECT_ID |
WalletConnect Cloud project ID | string, optional but recommended for production |
Environment Variables (Optional)
| Variable | Default | Purpose |
|---|---|---|
CHAIN_ID |
8453 | EVM chain ID (Base, Ethereum, Polygon, Arbitrum, Optimism, etc.) |
RPC_URL |
chain-specific | Custom JSON-RPC endpoint for the target chain |
External Connection: WalletConnect v2
wc:...@2?relay-protocol=irn&symKey=...)External Connection: JSON-RPC Provider
RPC_URL environment variable or --rpc flagInstallation Dependency
npm install @walletconnect/web3wallet @walletconnect/core ethers
Retrieve WalletConnect URI from dApp
wc:)wc:abc123...@2?relay-protocol=irn&symKey=xyz)Set private key in environment
export PRIVATE_KEY="0x..."echo $PRIVATE_KEY (confirm variable is set)Initialize WalletConnect agent with URI
--interactive, --chain-id, --rpc, --allow-eth-sign, --no-audit)node scripts/wc-connect.js "wc:abc123...@2?relay-protocol=irn&symKey=xyz" (with or without flags)Trigger transaction or signing action in browser
Agent auto-approves or prompts for signature
--interactive flag: Agent displays request details and waits for user input (yes/no)personal_sign, eth_signTypedData, eth_sendTransaction) against allowlisteth_sign and --allow-eth-sign not set: Agent rejects requestLog operation to audit file
~/.walletconnect-agent/audit.log (unless --no-audit set)Monitor transaction on-chain (optional)
If --interactive flag is present: Display signing request details (method, data, gas estimate) and prompt user to approve or reject before signing. Otherwise, auto-approve all requests (use only with trusted dApps).
If eth_sign method requested and --allow-eth-sign flag not set: Reject the request with error message. If --allow-eth-sign flag is set, proceed with signing (⚠️ security risk: eth_sign allows arbitrary data signing and is favored by phishing attacks).
If PRIVATE_KEY environment variable not set: Exit with error message and refuse to run. If passed as --private-key argument: Reject and exit (private keys must use env vars only to avoid shell history exposure).
If WalletConnect URI is malformed or expired: Exit with error message. If URI is valid but relay connection fails: Retry up to 3 times with exponential backoff (1s, 2s, 4s), then exit if all retries fail.
If RPC call times out (> 10 seconds): Log timeout error and retry once. If second attempt also times out, fail the signing request and notify user.
If audit log cannot be written (permission denied or disk full): Log warning to console but continue operation (do not block signing). If --no-audit is set, skip logging entirely.
If wallet balance is insufficient for gas: Transaction will fail on-chain; agent displays gas cost estimate before signing in interactive mode but does not block in auto-approve mode.
If chain ID in request does not match configured chain: In interactive mode, prompt user to confirm. In auto-approve mode, proceed with signing (dApp and agent must agree on chain; mismatch will cause on-chain failure).
Successful connection and signing:
~/.walletconnect-agent/audit.log contains JSON entries with timestamp, method name, request hash (not full data), success flag, and transaction hash (if on-chain)Failed signing request:
success: false and error reasonAudit log format:
{
"timestamp": "2026-02-08T14:23:45.123Z",
"event": "signing_request",
"method": "personal_sign",
"chain_id": 8453,
"request_hash": "0xabc...",
"success": true,
"tx_hash": "0x789...",
"error": null
}
File permissions: Audit log created with chmod 600 (readable/writable by owner only).
The skill worked if:
success: true and matching transaction hashesThe skill failed if:
success: false with error reason| Variable | Description | Required |
|---|---|---|
PRIVATE_KEY |
Wallet private key | Yes |
WC_PROJECT_ID |
WalletConnect Cloud Project ID | No |
CHAIN_ID |
Target chain ID | No (default: 8453) |
RPC_URL |
Custom RPC URL | No |
| Option | Description |
|---|---|
--chain-id <id> |
Chain ID (default: 8453 for Base) |
--rpc <url> |
RPC URL |
--interactive |
Prompt before signing |
--no-audit |
Disable audit logging |
--allow-eth-sign |
Enable dangerous eth_sign (⚠️ security risk!) |
| Chain | ID | Default RPC |
|---|---|---|
| Base | 8453 | https://mainnet.base.org |
| Ethereum | 1 | https://eth.llamarpc.com |
| Optimism | 10 | https://mainnet.optimism.io |
| Arbitrum | 42161 | https://arb1.arbitrum.io/rpc |
personal_sign - Message signing ✅eth_signTypedData / eth_signTypedData_v4 - EIP-712 typed data ✅eth_sendTransaction - Send transactions ✅eth_sign - Raw signing (❌ blocked by default, use --allow-eth-sign to enable)npm install @walletconnect/web3wallet @walletconnect/core ethers
wc:...)export PRIVATE_KEY="0x..."
node scripts/wc-connect.js "wc:abc123...@2?relay-protocol=irn&symKey=xyz"
Click "Swap", "Mint", "Register", etc. The script auto-signs all requests.
export PRIVATE_KEY="0x..."
node scripts/wc-connect.js "wc:..."
All signing requests are automatically approved. Use only with trusted dApps.
export PRIVATE_KEY="0x..."
node scripts/wc-connect.js "wc:..." --interactive
Prompts before each signing request. Recommended for new or untrusted dApps.
All operations are logged to ~/.walletconnect-agent/audit.log by default.
Logged events:
Sensitive data is masked , private keys and full addresses are never logged.
View audit log:
cat ~/.walletconnect-agent/audit.log | jq .
Disable audit logging:
node scripts/wc-connect.js "wc:..." --no-audit
export PRIVATE_KEY="0x..."
node scripts/wc-connect.js "wc:..."
# Then swap in browser - auto-approved
export PRIVATE_KEY="0x..."
node scripts/wc-connect.js "wc:..."
# Then mint - auto-signed
export PRIVATE_KEY="0x..."
node scripts/wc-connect.js "wc:..."
# Complete registration in browser
export PRIVATE_KEY="0x..."
node scripts/wc-connect.js "wc:..." --interactive
# Prompts: "Sign this message? (yes/no)"
# Prompts: "Send this transaction? (yes/no)"
This tool handles real cryptocurrency and auto-signs transactions.
| ✅ DO | ❌ DON'T |
|---|---|
| Use environment variables for private keys | Pass private key as command argument |
| Use a dedicated wallet with limited funds | Use your main wallet |
| Test with small amounts first | Auto-approve on untrusted dApps |
| Enable --interactive mode for new dApps | Commit private keys to git |
| Review audit logs regularly | Ignore transaction details |
| Use default settings (eth_sign blocked) | Enable --allow-eth-sign unless necessary |
The dangerous eth_sign method is blocked by default. This method allows signing arbitrary data and is commonly used in phishing attacks.
personal_sign - Safe, shows readable messageeth_signTypedData - Safe, structured dataeth_sign - Dangerous, blocked by defaultIf you absolutely need eth_sign (rare), use --allow-eth-sign flag.
# ✅ CORRECT - Use environment variable
export PRIVATE_KEY="0x..."
node scripts/wc-connect.js "wc:..."
# ❌ WRONG - Never do this (logged in shell history)
node scripts/wc-connect.js --private-key "0x..." "wc:..."
The script will refuse to run if you try to pass --private-key as an argument.
export PRIVATE_KEY="0x..."
--chain-id flag)curl https://mainnet.base.org)--interactive to see the exact method name--allow-eth-sign if method is eth_signdf -h)ls -la ~/.walletconnect-agent/)--no-audit to skip logging if directory is read-only~/.walletconnect-agent/
└── audit.log # Operation audit log (chmod 600)
eth_sign blocked by default (use --allow-eth-sign to enable)eth_sign from default WalletConnect session methods--allow-eth-sign flag for rare use casesMIT. Made with 🦞 by an AI who wanted their own Web3 identity.