🔐 Base Wallet - Crypto Identity for AI Agents. Create wallets, sign messages (SIWE), send transactions programmatically. No browser extensions, no human intervention. The foundation for autonomous Web3 agents.
数据来源:ClawHub。 在 ClawSkills 查看
选择你使用的 Agent
方法一:命令行安装(推荐)
推荐(无需提前安装 clawhub)
npx clawhub@latest --dir ~/.claude/skills install base-wallet或使用 clawhub CLI(需提前安装)
clawhub --dir ~/.claude/skills install base-wallet⚠️ 需要 Node.js 18+,没有 Node?请使用下方方法二直接下载 ZIP。 安装 Node.js →
方法二:手动下载安装(无需 Node)
下载 ZIP,解压后将文件夹放到以下路径,重启 Agent 即可:
安装路径
~/.claude/skills/base-wallet/💡解压后将文件夹放到上方路径,重启 Agent 即可生效
--- name: base-wallet description: "🔐 Base Wallet - Crypto Identity for AI Agents. Create wallets, sign messages (SIWE), send transactions programmatically. No browser extensions, no human intervention. The foundation for autonomous Web3 agents." ---
> Every autonomous agent needs a wallet. Create one without human help.
TL;DR: Programmatic wallet creation on Base/Ethereum. SIWE auth, balance checks, transactions.
Create and manage Base chain (Ethereum-compatible) wallets programmatically.
---
| ✅ DO | ❌ DON'T | |-------|----------| | Use environment variables for private keys | Store private keys in plain text files | | Set wallet files to chmod 600 | Commit wallet files to git | | Use --env mode (recommended) | Use console.log(privateKey) | | Back up mnemonics offline | Share private keys or mnemonics |
---
# Output as environment variable format (safest)
node scripts/create-wallet.js --env
# Output example:
# export WALLET_ADDRESS="0x..."
# export PRIVATE_KEY="0x..."
Then copy to your shell or .env file.
# Only if you need file-based storage
node scripts/create-wallet.js --managed my-agent
⚠️ This stores private key in ~/.openclaw/wallets/my-agent.json
---
const { ethers } = require('ethers');
// ✅ SECURE: Load from environment variable
const wallet = new ethers.Wallet(process.env.PRIVATE_KEY);
console.log('Address:', wallet.address);
// ❌ NEVER: console.log('Private Key:', wallet.privateKey);
const wallet = ethers.Wallet.fromPhrase(process.env.MNEMONIC);
const provider = new ethers.JsonRpcProvider('https://mainnet.base.org');
const balance = await provider.getBalance(wallet.address);
console.log('Balance:', ethers.formatEther(balance), 'ETH');
const message = `example.com wants you to sign in with your Ethereum account:
${wallet.address}
Sign in message
URI: https://example.com
Version: 1
Chain ID: 8453
Nonce: ${nonce}
Issued At: ${new Date().toISOString()}`;
const signature = await wallet.signMessage(message);
const provider = new ethers.JsonRpcProvider('https://mainnet.base.org');
const connectedWallet = wallet.connect(provider);
const tx = await connectedWallet.sendTransaction({
to: recipientAddress,
value: ethers.parseEther('0.001')
});
const receipt = await tx.wait();
console.log('TX Hash:', tx.hash);
---
| Script | Description | |--------|-------------| | create-wallet.js --env | Create wallet, output as env vars (recommended) | | create-wallet.js --managed [name] | Create wallet, save to file (opt-in) | | create-wallet.js --json | Create wallet, output as JSON | | basemail-register.js [name] | Register for BaseMail email | | check-balance.js [address] | Check wallet balance |
---
Register for a @basemail.ai email using your wallet signature.
# If using environment variable:
PRIVATE_KEY="0x..." node scripts/basemail-register.js
# If using managed wallet:
node scripts/basemail-register.js my-agent
---
| Network | Chain ID | RPC URL | |---------|----------|---------| | Base Mainnet | 8453 | https://mainnet.base.org | | Base Sepolia | 84532 | https://sepolia.base.org |
---
Operations are logged to ~/.base-wallet/audit.log.
---
// ✅ Recommended: Use environment variables
const privateKey = process.env.PRIVATE_KEY;
if (!privateKey) {
throw new Error('PRIVATE_KEY environment variable not set');
}
const wallet = new ethers.Wallet(privateKey);
// ❌ Avoid: Storing private keys in code or files
If you must store to file (not recommended):
const fs = require('fs');
const path = require('path');
// Store with restricted permissions
const filepath = path.join(process.env.HOME, '.openclaw', 'wallets', 'wallet.json');
fs.writeFileSync(filepath, JSON.stringify({
address: wallet.address,
// Only store if absolutely necessary
privateKey: wallet.privateKey
}), { mode: 0o600 }); // Owner read/write only
---
Add to your project's .gitignore:
# Wallet files - NEVER commit!
.openclaw/
*.wallet.json
*.mnemonic
private-key*
---
npm install ethers
---
安装 Base Wallet 后,可以对 AI 说这些话来触发它
Send a Slack message to the #engineering channel about the deployment
Formats and sends the message with relevant context, tagging the right people
Summarize all unread messages in my inbox from today
Reads messages across connected channels and returns a prioritized summary
Draft a reply to this customer complaint and send it for review
Writes an empathetic, professional response and routes it to the approval queue
将技能文件夹放到 ~/.claude/skills/base-wallet/ 目录(个人级,所有项目可用),或 .claude/skills/base-wallet/(项目级)。重启 AI 客户端后,用 /base-wallet 主动调用,或让 AI 根据上下文自动发现并使用。
Base Wallet 支持 Claude、Cursor、OpenClaw,可与这些 AI 平台无缝集成,扩展其能力。
Base Wallet 可免费安装使用。请查阅仓库了解许可证信息。
🔐 Base Wallet - Crypto Identity for AI Agents. Create wallets, sign messages (SIWE), send transactions programmatically. No browser extensions, no human intervention. The foundation for autonomous Web3 agents.
Base Wallet 属于「Communication」分类,该分类的技能帮助 AI 智能体在此领域执行专业任务。