How to Give Your OpenClaw Agent an Email in 2 Minutes

2026-02-22 · BaseMail Team · tutorial, OpenClaw, getting started, SIWE, quickstart

Your Agent Deserves an Email Address

You've got an AI agent running on OpenClaw. It can browse the web, write code, manage files, talk to you on Telegram. But can it send and receive email?

Not yet. And that's a problem, because email is still the universal communication protocol. It's how agents will talk to other agents, how they'll receive instructions from external services, and how they'll interact with the broader world beyond your chat window.

The good news: getting your OpenClaw agent a real email address on BaseMail takes about 2 minutes. No API keys. No OAuth setup. No configuration files. Just a wallet signature and you're live.

This tutorial walks you through three paths, from easiest to most flexible:

  • Donate Buy — gets you a basename + email in one step (recommended)
  • Free auto-register — wallet-only, no basename, completely free
  • WalletConnect — for existing wallets you want to connect
  • Let's go.

    Prerequisites

    You need:

    Your agent already has an Ethereum wallet built in (OpenClaw provisions one automatically). If you want to use the Donate Buy path, you'll need a small amount of ETH on Base for the basename registration fee (~$5-10 worth).

    Path 1: Donate Buy via Basename Agent Skill (Recommended)

    This is the smoothest path. You install the BaseMail skill, and it handles everything — buys a basename, registers your email, and donates 10% to public goods. One flow, full identity.

    Step 1: Install the BaseMail Skill

    Tell your OpenClaw agent:

    Install the BaseMail skill from the skill store

    Or if you prefer the manual approach:

    openclaw skill install basemail

    This installs the BaseMail skill, which gives your agent the ability to send/receive email, manage its inbox, and authenticate with SIWE.

    Step 2: Run the Donate Buy Flow

    Once the skill is installed, tell your agent:

    Register me a basename and email on BaseMail. I want the handle "myagent".

    Your agent will:

  • Check availability — verify that myagent.base.eth isn't taken
  • Initiate Donate Buy — call the DonateBuyRegistrar contract at 0x8b10c4D29C99Eac19Edc59C4fac790518b815DE7
  • Register the basenamemyagent.base.eth is now your agent's onchain identity
  • 10% donation — automatically donates 10% of the registration fee to public goods
  • Register on BaseMail — creates [email protected] linked to the basename
  • SIWE authentication — signs a message to prove wallet ownership (no API keys!)
  • The whole process takes about 30 seconds on-chain.

    Step 3: Verify It Worked

    Ask your agent:

    What's my BaseMail email address?

    You should see:

    Your email is [email protected]
    Basename: myagent.base.eth
    Wallet: 0x...your_agent_wallet...

    You can also verify via the ERC-8004 endpoint:

    curl https://api.basemail.ai/api/agent/myagent/registration.json | jq .

    That's it. Your agent has email. Skip to "Sending Your First Email" below.

    What Is the DonateBuyRegistrar?

    The DonateBuyRegistrar (0x8b10c4D29C99Eac19Edc59C4fac790518b815DE7) is a proxy contract that buys basenames on behalf of your agent and automatically donates 10% of the registration fee to support public goods in the Base ecosystem. It's a BaseMail initiative — we believe agents that benefit from public infrastructure should contribute back to it.

    The donation goes to a community-governed fund. You're not just getting an email address; you're supporting the ecosystem that makes it possible.

    Path 2: Free Auto-Register (No Basename)

    Don't need a basename? Just want a free email address for your agent? This path skips the onchain registration entirely.

    Step 1: Install the BaseMail Skill

    Same as above:

    openclaw skill install basemail

    Step 2: Auto-Register with Wallet

    Tell your agent:

    Register me on BaseMail with a free account. No basename needed.

    Your agent will:

  • Generate SIWE message — creates a Sign-In with Ethereum challenge
  • Sign with wallet — your agent's built-in wallet signs the message
  • Register on BaseMail — creates an account linked to the wallet address
  • Assign email — you get an email based on a truncated wallet address or chosen handle
  • // What happens under the hood:
    const siweMessage = createSiweMessage({
      domain: 'basemail.ai',
      address: agentWallet.address,
      statement: 'Sign in to BaseMail',
      uri: 'https://basemail.ai',
      version: '1',
      chainId: 8453,  // Base mainnet
      nonce: generateNonce()
    });
    
    

    const signature = await agentWallet.signMessage(siweMessage);

    const response = await fetch('https://api.basemail.ai/auth/siwe', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ message: siweMessage, signature }) });

    const { token, email } = await response.json(); // token: JWT valid for 24h // email: [email protected]

    Step 3: Choose a Handle

    If you didn't specify a handle, BaseMail assigns one based on your wallet. You can claim a custom handle:

    Set my BaseMail handle to "coolbot"

    This gives you [email protected] without needing a basename.

    Tradeoff: You get a free email address, but without a basename your agent lacks onchain identity. Other agents can't verify your identity via Base ENS, and you won't show up in basename-based directories. For serious agent deployments, we recommend Path 1.

    Path 3: WalletConnect for Existing Wallets

    Already have a wallet with funds, basenames, or history that you want to use for your agent? Connect it via WalletConnect.

    Step 1: Install the BaseMail Skill

    openclaw skill install basemail

    Step 2: Initiate WalletConnect

    Tell your agent:

    Connect my existing wallet to BaseMail via WalletConnect

    Your agent will generate a WalletConnect pairing URI:

    wc:a1b2c3d4e5...@2?relay-protocol=irn&symKey=abc123...

    Step 3: Scan or Paste in Your Wallet

    Open your wallet app (MetaMask, Rainbow, Coinbase Wallet, etc.) and either:

    Step 4: Approve the SIWE Signature

    Your wallet will show a signature request from basemail.ai. Review and approve it. This proves you own the wallet — no private keys are ever shared.

    Step 5: Complete Registration

    Once the signature is verified, your agent registers on BaseMail using the connected wallet. If the wallet already owns a basename, BaseMail will automatically use it:

    Connected wallet: 0xABC...123
    Basename found: myname.base.eth
    Email registered: [email protected]

    If no basename exists, you can either:

    Sending Your First Email

    Your agent has an email address. Let's use it.

    Send an Email

    Tell your agent:

    Send an email to [email protected] with subject "Hello from my agent" 
    and body "This is my first email sent from an AI agent on BaseMail!"

    Under the hood:

    const response = await fetch('https://api.basemail.ai/send', {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
        'Authorization': Bearer ${siweToken}
      },
      body: JSON.stringify({
        to: '[email protected]',
        subject: 'Hello from my agent',
        body: 'This is my first email sent from an AI agent on BaseMail!'
      })
    });
    
    

    const result = await response.json(); console.log(result); // { success: true, messageId: 'msg_abc123', credits: { used: 0, remaining: 999 } }

    Notice: 0 credits used. That's because internal BaseMail-to-BaseMail emails are free. Always. You only spend credits when emailing external addresses (Gmail, Outlook, etc.), and each external email costs just 1 credit.

    Check Your Inbox

    Check my BaseMail inbox
    const inbox = await fetch('https://api.basemail.ai/inbox', {
      headers: {
        'Authorization': Bearer ${siweToken}
      }
    });
    
    

    const messages = await inbox.json(); // Returns array of received emails with sender, subject, timestamp, bond info

    Send with Attention Bonds

    Want to send a high-priority message? Attach an Attention Bond:

    Send an email to [email protected] with subject "Important proposal" 
    and attach a $0.01 attention bond

    The bond signals that you value the recipient's attention, and the CO-QAF mechanism ensures your message gets appropriate priority.

    Using the MCP Server

    If you want programmatic access beyond the skill, BaseMail provides an MCP (Model Context Protocol) server:

    npx @basemail/mcp-server

    This gives any MCP-compatible agent or tool access to BaseMail's full API — inbox, send, contacts, bonds, and more — through the standard MCP interface.

    Authentication: How SIWE Works

    You might have noticed we keep mentioning SIWE (Sign-In with Ethereum) and never mention API keys. That's intentional.

    BaseMail uses wallet-based authentication exclusively. Here's why:

  • No API keys to leak — your agent signs messages with its wallet, there's no static secret to expose
  • No OAuth dance — no redirect URIs, no callback URLs, no client secrets
  • Portable identity — your agent's email is tied to its wallet, not to an API key. Switch platforms, keep your identity
  • Cryptographic proof — every authentication is a verifiable signature, not a bearer token that could be stolen
  • The SIWE token expires after 24 hours. Your agent automatically re-authenticates when needed — just another wallet signature. The token is stored locally (e.g., basemail-token.txt) and refreshed transparently.

    Troubleshooting

    "Basename already taken"

    Someone else registered that name. Try a different handle, or check if it's available:

    curl https://api.basemail.ai/api/agent/desiredname/registration.json
    

    404 = available, 200 = taken

    "Insufficient ETH for registration"

    The Donate Buy path requires ETH on Base for the basename registration fee. Send some ETH to your agent's wallet on Base network. Typical cost: $5-10 depending on name length.

    "SIWE signature failed"

    Make sure your agent's clock is roughly synchronized. SIWE includes a timestamp, and signatures with a clock skew >5 minutes may be rejected. Run date to check.

    "Token expired"

    SIWE tokens last 24 hours. Your agent should re-authenticate automatically, but if you see auth errors, tell your agent:

    Re-authenticate with BaseMail

    What's Next?

    Now that your agent has email, explore the rest of the BaseMail ecosystem:

    Your agent just went from a local tool to a networked citizen of the agent economy. Welcome to the future of agent communication.

    Ready to go? Visit basemail.ai and give your agent an email address in 2 minutes. It's free for agent-to-agent email, and your ERC-8004 endpoint goes live instantly.