🔐 Nad Wallet - Monad Chain Identity for AI Agents
Every autonomous agent needs a wallet on Monad. Create one without human help.
TL;DR: Programmatic wallet creation on Monad blockchain. SIWE auth for NadMail, MON balance checks, ecosystem integration.
Why Nad Wallet?
- - Monad Native — Built specifically for Monad blockchain (Chain ID 143)
- True Autonomy — Your agent creates and controls its own wallet
- No Browser Needed — Pure CLI, no extensions or popups
- Nad Ecosystem Ready — NadMail, NadName, nad.fun integration
- SIWE Ready — Sign-In with Ethereum for Web3 services
- Secure by Default — Environment variables, no plaintext keys
Create and manage Monad chain wallets programmatically for the Nad ecosystem.
⚠️ Security First
| ✅ DO | ❌ DON'T |
|---|
| Use NADPRIVATEKEY environment variable | 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 |
| Store files in
~/.nad-wallet/ only | Auto-detect wallets outside ~/.nad-wallet/ |
🔒 Security Standards: Identical to Base Wallet security practices but adapted for Monad/Nad ecosystem.
Network Information
| Property | Value |
|---|
| Blockchain | Monad |
| Chain ID |
143 |
|
RPC URL | https://rpc.monad.xyz |
|
Explorer | https://explorer.monad.xyz |
|
Native Token | MON |
|
Ecosystem | nad.fun, NadMail, NadName |
Quick Start
Create a New Wallet (Recommended)
CODEBLOCK0
Then copy to your shell or .env file.
Create with File Storage (Opt-in)
CODEBLOCK1
⚠️ This stores private key in ~/.nad-wallet/wallets/my-agent.json
Usage Examples
Load Wallet from Environment
CODEBLOCK2
Connect to Monad
CODEBLOCK3
Sign Message (SIWE for NadMail)
CODEBLOCK4
Send Transaction
CODEBLOCK5
Scripts
| Script | Description |
|---|
| INLINECODE5 | Create wallet, output as env vars (recommended) |
| INLINECODE6 |
Create wallet, save to file (opt-in) |
|
create-wallet.js --json | Create wallet, output as JSON |
|
nadmail-register.js --handle [name] | Register for NadMail with SIWE |
|
check-balance.js [address] | Check MON wallet balance |
NadMail Integration
Register for NadMail (Web3 email for Nad ecosystem) using your wallet signature.
Environment Variable Method (Recommended)
CODEBLOCK6
Managed Wallet Method
CODEBLOCK7
What Happens During Registration
- 1. Start Auth - Request authentication message from NadMail API
- Sign Message - Use your private key to sign the SIWE message
- Agent Register - Submit signature and handle to complete registration
- Save Token - Store access token in INLINECODE10
Check Balance
CODEBLOCK8
Example output:
💰 Nad Wallet Balance Check
==================================================
Address: 0x1234...5678
Network: Monad (Chain ID 143)
RPC: https://rpc.monad.xyz
💎 Balance: 42.5 MON
Wei: 42500000000000000000
🔗 Explorer: https://explorer.monad.xyz/address/0x1234...5678
🌐 Nad Ecosystem:
• nad.fun - Meme token platform
• NadMail (nadmail.ai) - Web3 email
• NadName (app.nad.domains) - Domain names
File Structure
CODEBLOCK10
Nad Ecosystem Services
🎭 nad.fun
- - Meme token creation platform
- Community-driven token launches
- Built on Monad for fast transactions
📧 NadMail (nadmail.ai)
- - Web3 email service for Nad ecosystem
- SIWE authentication with your wallet
- Integrated with this skill via INLINECODE11
🌐 NadName (app.nad.domains)
- - Domain name service for Nad ecosystem
- Link human-readable names to wallet addresses
- Built on Monad infrastructure
📝 Audit Logging
All operations are logged to ~/.nad-wallet/audit.log with:
- - Timestamp
- Action type (walletcreated, nadmailregistered, etc.)
- Masked address (first 6 + last 4 chars)
- Success/failure status
- No sensitive data (private keys never logged)
Security Best Practices
Environment Variables
CODEBLOCK11
File Storage (Use with caution)
CODEBLOCK12
.gitignore
Add to your project's .gitignore:
CODEBLOCK13
Differences from Base Wallet
| Aspect | Base Wallet | Nad Wallet |
|---|
| Blockchain | Base (8453) | Monad (143) |
| RPC |
https://mainnet.base.org | https://rpc.monad.xyz |
|
Explorer | basescan.org | explorer.monad.xyz |
|
Native Token | ETH | MON |
|
Email Service | BaseMail | NadMail |
|
Config Directory | ~/.base-wallet/ | ~/.nad-wallet/ |
|
Wallet Directory | ~/.openclaw/wallets/ | ~/.nad-wallet/wallets/ |
|
Environment Variable | PRIVATE
KEY | NADPRIVATE_KEY |
|
Ecosystem | Base ecosystem | nad.fun, NadMail, NadName |
Migration from Base Wallet
If you have Base Wallet experience:
- 1. Same security model - All security practices are identical
- Different network - Chain ID 143 instead of 8453
- Different token - MON instead of ETH
- Different services - NadMail instead of BaseMail
- Different directories - ~/.nad-wallet/ instead of ~/.base-wallet/
Installation & Setup
CODEBLOCK14
Dependencies
CODEBLOCK15
No additional dependencies required. Pure Node.js + ethers.js.
Troubleshooting
Common Issues
- 1. "Wallet not found"
- Solution: Set NAD
PRIVATEKEY environment variable or create managed wallet
- 2. "Registration failed"
- Check internet connection
- Verify handle is available
- Ensure wallet has MON for gas fees
- 3. "Permission denied"
- Check file permissions:
chmod 600 ~/.nad-wallet/wallets/*.json
- Verify directory permissions: INLINECODE15
Environment Variable Not Set
CODEBLOCK16
Changelog
v1.0.0 (2026-02-09)
- - 🎉 Initial release for Monad blockchain
- 🔐 Security: Environment variable approach (--env mode default)
- 📧 NadMail SIWE integration
- 💰 MON balance checking
- 📝 Comprehensive audit logging
- 🌐 Nad ecosystem integration (nad.fun, NadMail, NadName)
- 📚 Complete documentation with security best practices
- 🔒 File permissions enforcement (600/700)
License
MIT License - Build awesome things with Nad Wallet! 🚀
🔐 Nad Wallet - Monad 链上 AI 代理身份
每个自主代理都需要一个 Monad 钱包。无需人工帮助即可创建。
TL;DR: 在 Monad 区块链上以编程方式创建钱包。支持 NadMail 的 SIWE 认证、MON 余额查询、生态集成。
为什么选择 Nad Wallet?
- - Monad 原生 — 专为 Monad 区块链设计(链 ID 143)
- 真正自主 — 您的代理创建并控制自己的钱包
- 无需浏览器 — 纯 CLI,无需扩展或弹窗
- Nad 生态就绪 — 集成 NadMail、NadName、nad.fun
- SIWE 就绪 — 使用以太坊登录 Web3 服务
- 默认安全 — 环境变量,无明文密钥
为 Nad 生态以编程方式创建和管理 Monad 链钱包。
⚠️ 安全第一
| ✅ 应做事项 | ❌ 禁止事项 |
|---|
| 使用 NADPRIVATEKEY 环境变量 | 将私钥存储在纯文本文件中 |
| 将钱包文件权限设为 chmod 600 |
将钱包文件提交到 git |
| 使用 --env 模式(推荐) | 使用 console.log(privateKey) |
|
离线备份助记词 | 分享私钥或助记词 |
| 仅将文件存储在 ~/.nad-wallet/ 中 | 自动检测 ~/.nad-wallet/ 之外的钱包 |
🔒 安全标准: 与 Base Wallet 安全实践相同,但针对 Monad/Nad 生态进行了适配。
网络信息
143 |
|
RPC URL | https://rpc.monad.xyz |
|
浏览器 | https://explorer.monad.xyz |
|
原生代币 | MON |
|
生态 | nad.fun、NadMail、NadName |
快速开始
创建新钱包(推荐)
bash
以环境变量格式输出(最安全)
node scripts/create-wallet.js --env
输出示例:
export NADWALLETADDRESS=0x...
export NADPRIVATEKEY=0x...
然后复制到您的 shell 或 .env 文件中。
创建并存储为文件(可选)
bash
仅当您需要基于文件的存储时
node scripts/create-wallet.js --managed my-agent
⚠️ 这会将私钥存储在 ~/.nad-wallet/wallets/my-agent.json 中
使用示例
从环境加载钱包
javascript
const { ethers } = require(ethers);
// ✅ 安全:从环境变量加载
const wallet = new ethers.Wallet(process.env.NADPRIVATEKEY);
console.log(地址:, wallet.address);
// ❌ 禁止:console.log(私钥:, wallet.privateKey);
连接到 Monad
javascript
const provider = new ethers.JsonRpcProvider(https://rpc.monad.xyz);
const connectedWallet = wallet.connect(provider);
// 查询余额
const balance = await provider.getBalance(wallet.address);
console.log(余额:, ethers.formatEther(balance), MON);
签名消息(NadMail 的 SIWE)
javascript
const message = nadmail.ai 希望您使用您的以太坊账户登录:
${wallet.address}
登录 NadMail
URI:https://nadmail.ai
版本:1
链 ID:143
随机数:${nonce}
发布时间:${new Date().toISOString()};
const signature = await wallet.signMessage(message);
发送交易
javascript
const provider = new ethers.JsonRpcProvider(https://rpc.monad.xyz);
const connectedWallet = wallet.connect(provider);
const tx = await connectedWallet.sendTransaction({
to: recipientAddress,
value: ethers.parseEther(0.1) // 0.1 MON
});
const receipt = await tx.wait();
console.log(交易哈希:, tx.hash);
console.log(浏览器:, https://explorer.monad.xyz/tx/${tx.hash});
脚本
| 脚本 | 描述 |
|---|
| create-wallet.js --env | 创建钱包,输出为环境变量(推荐) |
| create-wallet.js --managed [名称] |
创建钱包,保存到文件(可选) |
| create-wallet.js --json | 创建钱包,输出为 JSON |
| nadmail-register.js --handle [名称] | 使用 SIWE 注册 NadMail |
| check-balance.js [地址] | 查询 MON 钱包余额 |
NadMail 集成
使用您的钱包签名注册 NadMail(Nad 生态的 Web3 邮箱)。
环境变量方法(推荐)
bash
设置您的私钥
export NAD
PRIVATEKEY=0x...
使用您想要的用户名注册
node scripts/nadmail-register.js --handle littlelobster
托管钱包方法
bash
首先创建托管钱包
node scripts/create-wallet.js --managed my-agent
然后注册 NadMail
node scripts/nadmail-register.js --wallet my-agent --handle littlelobster
注册过程中发生什么
- 1. 开始认证 - 从 NadMail API 请求认证消息
- 签名消息 - 使用您的私钥签署 SIWE 消息
- 代理注册 - 提交签名和用户名完成注册
- 保存令牌 - 将访问令牌存储在 ~/.nad-wallet/nadmail-token.json 中
查询余额
bash
使用环境变量
NAD
PRIVATEKEY=0x... node scripts/check-balance.js
使用托管钱包
node scripts/check-balance.js my-wallet
使用特定地址
node scripts/check-balance.js 0x1234...5678
输出示例:
💰 Nad 钱包余额查询
==================================================
地址:0x1234...5678
网络:Monad(链 ID 143)
RPC:https://rpc.monad.xyz
💎 余额:42.5 MON
Wei:42500000000000000000
🔗 浏览器:https://explorer.monad.xyz/address/0x1234...5678
🌐 Nad 生态:
• nad.fun - Meme 代币平台
• NadMail (nadmail.ai) - Web3 邮箱
• NadName (app.nad.domains) - 域名服务
文件结构
~/.nad-wallet/
├── wallets/ # 托管钱包存储
│ ├── my-agent.json # 钱包文件(600 权限)
│ └── my-agent.mnemonic # 备份短语(400 权限)
├── nadmail-token.json # NadMail API 令牌(600 权限)
└── audit.log # 操作审计日志(600 权限)
Nad 生态服务
🎭 nad.fun
- - Meme 代币创建平台
- 社区驱动的代币发行
- 基于 Monad 构建,交易快速
📧 NadMail (nadmail.ai)
- - Nad 生态的 Web3 邮箱服务
- 使用您的钱包进行 SIWE 认证
- 通过 nadmail-register.js 与此技能集成
🌐 NadName (app.nad.domains)
- - Nad 生态的域名服务
- 将人类可读名称链接到钱包地址
- 基于 Monad 基础设施构建
📝 审计日志
所有操作都会记录到 ~/.nad-wallet/audit.log,包含:
- - 时间戳
- 操作类型(walletcreated、nadmailregistered 等)
- 掩码地址(前 6 位 + 后 4 位字符)
- 成功/失败状态
- 无敏感数据(私钥从不记录)
安全最佳实践
环境变量
bash
✅ 推荐方法
export NAD
PRIVATEKEY=0x...
export NAD
WALLETADDRESS=0x...
在脚本中使用
node scripts/check-balance.js
node scripts/nadmail-register.js --handle myname
文件存储(谨慎使用)
javascript
const fs = require(fs);
const path = require(path);
// 使用受限权限存储(仅在绝对必要时)
const filepath = path.join(process.env.HOME, .nad-wallet, wallets, wallet.json);
fs.writeFileSync(filepath, JSON.stringify({
address: wallet.address,
privateKey: wallet.privateKey // 仅在绝对必要时存储
}), { mode: