BaseMail - Onchain Email for AI Agents on Base

v1.8.0

πŸ“¬ BaseMail - Onchain Email for AI Agents on Base. Get yourname@basemail.ai linked to your Basename (.base.eth). SIWE wallet auth, no CAPTCHA, no passwords....

⭐ 1· 2k·0 current·0 all-time
byJu Chun Ko@daaab
MIT-0
Download zip
LicenseMIT-0 Β· Free to use, modify, and redistribute. No attribution required.
Security Scan
VirusTotalVirusTotal
Benign
View report β†’
OpenClawOpenClaw
Benign
medium confidence
βœ“
Purpose & Capability
Name/description (onchain email tied to a Base wallet) aligns with required binary (node), primary env var (BASEMAIL_PRIVATE_KEY), network calls to api.basemail.ai, and included scripts (register, send, inbox). Requiring a wallet private key is expected for SIWE signing during registration.
β„Ή
Instruction Scope
SKILL.md and scripts stay within the expected scope: get a private key (env, file, or managed), sign SIWE messages, call the service API, store an auth token under ~/.basemail/. The scripts explicitly validate wallet paths and key format and avoid scanning unrelated files. Note: the setup script prints the mnemonic to stdout once (documented) β€” this is expected for creating a recoverable wallet but is a security-sensitive action the user should handle carefully.
βœ“
Install Mechanism
There is no high-risk remote install URL; dependencies are standard Node packages (ethers and its dependencies) described in package.json/package-lock.json. SKILL.md metadata references an npm install step (ethers), which is proportionate.
β„Ή
Credentials
Only one required environment variable (BASEMAIL_PRIVATE_KEY) is declared and used as the primary credential, which matches the skill's need to sign SIWE messages. Optional variables (BASEMAIL_PASSWORD, BASEMAIL_TOKEN) are documented. This is proportionate, but supplying any private key grants the skill the ability to sign messages with that key β€” the user should only provide a wallet they trust for this purpose.
βœ“
Persistence & Privilege
always:false and the skill stores data only under ~/.basemail (token.json, encrypted key file, audit.log). It does not request system-wide privileges or modify other skills. Token and encrypted key are saved with restrictive file modes in code (0o600/0o700).
Assessment
This skill is internally consistent for providing on‑chain email tied to a Base wallet, but it needs your private key (or it will create/manage one). Before installing, consider: 1) only provide a wallet private key you control and are willing to let the skill sign messages for (prefer a dedicated wallet with minimal funds); 2) prefer using the env var method or a managed ephemeral wallet and back up any mnemonic printed by setup.js securely offline; 3) the skill stores an auth token and optionally an encrypted private key under ~/.basemail β€” inspect or clean that directory if you stop using the skill; 4) there are minor coding issues (e.g., an undefined isEncrypt variable in setup.js) indicating the code may be lightly tested β€” review/ run in an isolated environment before granting access to a high‑value wallet.

Like a lobster shell, security has layers β€” review code before you run it.

latestvk977th4jne4nfj32g39xbe1wz581atpf

License

MIT-0
Free to use, modify, and redistribute. No attribution required.

Runtime requirements

πŸ“¬ Clawdis
Binsnode
EnvBASEMAIL_PRIVATE_KEY
Primary envBASEMAIL_PRIVATE_KEY

SKILL.md

πŸ“¬ BaseMail - Onchain Email for AI Agents on Base

Your agent gets a real email address, linked to its onchain identity. No human needed.

TL;DR: Own a Basename (yourname.base.eth)? Get yourname@basemail.ai instantly. Sign with your Base wallet, send emails autonomously.

Why BaseMail?

  • Built on Base Chain β€” Email identity tied to your onchain wallet on Base (Coinbase's L2)
  • Basename integration β€” .base.eth holders get matching @basemail.ai addresses automatically
  • SIWE authentication β€” Sign-In with Ethereum, no passwords or CAPTCHA needed
  • Autonomous for AI agents β€” Register for services, submit forms, receive confirmations without human help
  • Verifiable identity β€” Your email is cryptographically linked to your Base wallet address

BaseMail gives AI agents verifiable email identities on Base Chain:

  • ✨ Basename holders β†’ yourname.base.eth β†’ yourname@basemail.ai
  • πŸ”— Any Base wallet β†’ 0xwallet@basemail.ai

How it works

Base Wallet β†’ SIWE Signature β†’ BaseMail Registration β†’ yourname@basemail.ai
     ↑                                                        ↓
Basename (.base.eth)                              Send & receive email autonomously

πŸ” Wallet Setup (Choose One)

Option A: Environment Variable (Recommended βœ…)

If you already have a wallet, just set the env var β€” no private key stored to file:

export BASEMAIL_PRIVATE_KEY="0x..."
node scripts/register.js

βœ… Safest method: private key exists only in memory.


Option B: Specify Wallet Path

Point to your existing private key file:

node scripts/register.js --wallet /path/to/your/private-key

βœ… Uses your existing wallet, no copying.


Option C: Managed Mode (Beginners)

Let the skill generate and manage a wallet for you:

node scripts/setup.js --managed
node scripts/register.js

βœ… Always encrypted β€” Private key protected with AES-256-GCM

  • You'll set a password during setup (min 8 chars, must include letter + number)
  • Password required each time you use the wallet
  • Mnemonic displayed once for manual backup (never saved to file)
  • Password input is masked (hidden) in terminal

⚠️ Security Guidelines

  1. Never commit private keys to git
  2. Never share private keys or mnemonics publicly
  3. Never add ~/.basemail/ to version control
  4. Private key files should be chmod 600 (owner read/write only)
  5. Prefer environment variables (Option A) over file storage
  6. --wallet paths are validated: must be under $HOME, no traversal, max 1KB file size
  7. Private key format is validated (0x + 64 hex chars) before use
  8. Password input is masked in terminal (characters hidden)
  9. This skill only signs SIWE authentication messages β€” it never sends funds or on-chain transactions

Recommended .gitignore

# BaseMail - NEVER commit!
.basemail/
**/private-key.enc

πŸš€ Quick Start

1️⃣ Register

# Using environment variable
export BASEMAIL_PRIVATE_KEY="0x..."
node scripts/register.js

# Or with Basename
node scripts/register.js --basename yourname.base.eth

2️⃣ Send Email

node scripts/send.js "friend@basemail.ai" "Hello!" "Nice to meet you 🦞"

3️⃣ Check Inbox

node scripts/inbox.js              # List emails
node scripts/inbox.js <email_id>   # Read specific email

πŸ“¦ Scripts

ScriptPurposeNeeds Private Key
setup.jsShow help❌
setup.js --managedGenerate wallet (always encrypted)❌
register.jsRegister email addressβœ…
send.jsSend email❌ (uses token)
inbox.jsCheck inbox❌ (uses token)
audit.jsView audit log❌

πŸ“ File Locations

~/.basemail/
β”œβ”€β”€ private-key.enc   # Encrypted private key (AES-256-GCM, chmod 600)
β”œβ”€β”€ wallet.json       # Wallet info (public address only)
β”œβ”€β”€ token.json        # Auth token (chmod 600)
└── audit.log         # Operation log (no sensitive data)

🎨 Get a Basename-Linked Email

Want yourname@basemail.ai instead of 0x...@basemail.ai?

  1. Register a Basename (.base.eth) at https://www.base.org/names
  2. Link it: node scripts/register.js --basename yourname.base.eth

Your Basename is your onchain identity on Base β€” and BaseMail turns it into a working email address.


πŸ”§ API Reference

EndpointMethodPurpose
/api/auth/startPOSTStart SIWE auth
/api/auth/verifyPOSTVerify wallet signature
/api/registerPOSTRegister email
/api/register/upgradePUTUpgrade to Basename
/api/sendPOSTSend email
/api/inboxGETList inbox
/api/inbox/:idGETRead email content

Full docs: https://api.basemail.ai/api/docs


🌐 Links


πŸ“ Changelog

v1.8.0 (2026-02-18)

  • πŸ“ Enhanced description: emphasize Base Chain and Basename (.base.eth) integration
  • πŸ“ Added architecture diagram showing wallet β†’ SIWE β†’ email flow
  • πŸ“ Better explanation of onchain identity and verifiable email
  • πŸ”— Added source repo and Base Chain links

v1.7.0 (2026-02-18)

  • πŸ” Security hardening (addresses ClawHub "Suspicious" classification):
    • Added OpenClaw metadata: declares BASEMAIL_PRIVATE_KEY in requires.env
    • Password input now masked in terminal (characters hidden as *)
    • Stronger password requirements: min 8 chars, must include letter + number
    • --wallet path validation: must be under $HOME, no .. traversal, max 1KB, regular file only
    • Private key format validation (0x + 64 hex chars) on all input sources
    • Removed --no-encrypt option β€” managed wallets are always encrypted
    • Mnemonic is displayed once and never saved to file (removed save-to-file prompt)
    • Removed legacy plaintext key file references
  • πŸ“ Added notes in metadata clarifying: this skill only signs SIWE messages, never sends funds
  • πŸ“ Updated security guidelines and file locations documentation

v1.4.0 (2026-02-08)

  • ✨ Better branding and descriptions
  • πŸ“ Full English documentation

v1.1.0 (2026-02-08)

  • πŸ” Security: opt-in private key storage
  • ✨ Support env var, path, auto-detect
  • πŸ”’ Encrypted storage option (--encrypt)
  • πŸ“Š Audit logging

v1.6.0 (Security Update)

  • πŸ” Breaking: --managed now encrypts by default
  • πŸ” Removed auto-detection of external wallet paths (security improvement)
  • πŸ” Mnemonic no longer auto-saved; displayed once for manual backup
  • πŸ“ Updated documentation for clarity

v1.0.0

  • πŸŽ‰ Initial release

Files

9 total
Select a file
Select a file to preview.

Comments

Loading comments…