walletš Base Wallet - Crypto Identity for AI Agents. Create wallets, sign messages (SIWE), send transactions programmatically. No browser extensions, no human int...
Install via ClawdBot CLI:
clawdbot install walletEvery 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
Generated Mar 1, 2026
An AI agent uses the wallet to handle customer refunds or loyalty token distributions on a decentralized platform. It autonomously verifies user requests via SIWE signatures and processes micro-transactions without human intervention, ensuring 24/7 service availability.
A content platform employs an AI agent to automatically distribute earnings to creators based on engagement metrics. The wallet enables secure, programmatic payments on Base, handling transactions in real-time while logging all activities for audit compliance.
In logistics, an AI agent uses the wallet to sign and verify product authenticity data on a blockchain. It autonomously creates wallets for new suppliers, signs SIWE messages for access control, and records transaction logs to ensure tamper-proof audit trails.
An AI agent manages a decentralized finance portfolio by programmatically executing trades and staking operations on Base. It leverages the wallet to sign transactions, check balances, and interact with smart contracts, optimizing returns without manual oversight.
A gaming platform uses an AI agent to distribute NFT rewards to players based on in-game achievements. The wallet handles the creation of player-specific wallets, signs messages for authentication, and sends transactions to mint and transfer NFTs autonomously.
Offer a subscription-based platform where developers integrate the wallet skill into their AI agents for Web3 functionalities. Revenue comes from tiered plans based on transaction volume, support levels, and advanced features like enhanced audit logging.
Monetize by charging a small percentage fee on each transaction processed through the wallet skill in AI agents. This model aligns with high-volume use cases like micro-payments or DeFi operations, generating revenue proportional to agent activity.
Provide enterprise-grade packages that include the wallet skill with added security audits, compliance reporting, and custom integration support. Target industries like finance or supply chain where secure, autonomous wallet management is critical for regulatory adherence.
š¬ Integration Tip
Always store private keys in environment variables and use the --env mode for wallet creation to prevent security breaches; avoid file-based storage unless absolutely necessary.
Connect Claude to Clawdbot instantly and keep it connected 24/7. Run after setup to link your subscription, then auto-refreshes tokens forever.
ERC-8004 Trustless Agents - Register, discover, and build reputation for AI agents on Ethereum. Use when registering agents on-chain, querying agent registries, giving/receiving reputation feedback, or interacting with the AI agent trust layer.
Autonomous crypto trading on Base via Bankr. Use for trading tokens, monitoring launches, executing strategies, or managing a trading portfolio. Triggers on "trade", "buy", "sell", "launch", "snipe", "profit", "PnL", "portfolio balance", or any crypto trading task on Base.
Deploy ERC20 tokens on Base using Clanker SDK. Create tokens with built-in Uniswap V4 liquidity pools. Supports Base mainnet and Sepolia testnet. Requires PRIVATE_KEY in config.
Query DeFi portfolio data across 50+ chains via Zapper's GraphQL API. Use when the user wants to check wallet balances, DeFi positions, NFT holdings, token prices, or transaction history. Supports Base, Ethereum, Polygon, Arbitrum, Optimism, and more. Requires ZAPPER_API_KEY.
Interact with Solana blockchain via Helius APIs. Create/manage wallets, check balances (SOL + tokens), send transactions, swap tokens via Jupiter, and monitor addresses. Use for any Solana blockchain operation, crypto wallet management, token transfers, DeFi swaps, or portfolio tracking.