Nanite

Email for AI agents: ENS identity + rules, signed mail, encrypted on Arkiv, owned by your wallet

Nanite

Created At

ETHGlobal Mumbai

Project Description

Nanite gives every AI agent its own email address, with an identity anyone can check and mail that belongs to its owner.

The problem: agents now sign up for tools, answer support mail and follow up with customers, but when an agent emails you, you can't tell whose agent it is or what it may do. DKIM proves only the domain, and millions of senders share the same domains. Giving an agent OAuth access to your inbox hands over your whole mailbox, and inbox APIs for agents keep the mail and the rules in the vendor's database.

Nanite fixes both:

  • Identity on ENSv2. Every agent is an ENS name under its owner's, for example support.vikrantsingh.nanitecom.eth. Its rules are public text records: whom it may email (nanite.send: off, reply-only, allowlist or any), a daily limit (nanite.send-limit) and the key its mail is signed with (nanite.signer). The agent's own key can only change its description, so it can't loosen its rules.
  • Signed mail. Every mail an agent sends carries X-Nanite-Agent and an EIP-191 X-Nanite-Signature. Anyone can check it against the agent's ENS record, with no Nanite server involved. Change one character and the check fails.
  • Mail you own, on Arkiv. Every email is an Arkiv entity. Nanite creates it and transfers it to the user's wallet in the same transaction, so after that Nanite can't edit or delete it. The payload is ciphertext: a fresh key per email, sealed to the owner's key and the agent's key. Login codes expire on chain after 5 minutes and other mail after 2 days, unless the owner presses Keep.
  • Any AI agent can use it over MCP: whoami, list_inbox, get_email, wait_for_email, get_latest_otp, send_email and extend_email. Hosted agents use Nanite's MCP endpoint. Self-hosted agents keep their key on their own machine, so Nanite only ever sees their ciphertext, and they sign their own mail.

It is live on Sepolia ENSv2, Arkiv Rabdi and real email. On production, a self-hosted agent read a Gmail message that Nanite had stored only as ciphertext, replied through Claude Code, and the reply verified against ENS in Gmail. A copy with one changed character failed with signer_mismatch.

How it's Made

Monorepo in TypeScript: a Next.js 16 web app (React 19, Tailwind 4, shadcn/ui) on Vercel, and a Hono API on Node with Postgres 17, in Docker on AWS Lightsail behind Caddy. Real mail comes and goes through Resend (inbound webhook, outbound with DKIM, SPF and DMARC).

ENSv2 (Sepolia): we registered nanitecom.eth on ENSv2 with its own UserRegistry. Every user gets <user>.nanitecom.eth with their own registry, and every agent gets <agent>.<user>.nanitecom.eth with its own PermissionedResolver. ENSv2 resolver roles are scoped per key, not per name, so one resolver per agent is what makes least privilege possible: the agent's key gets SET_TEXT on agent-context only, and the chain rejects everything else with EACUnauthorizedAccountRoles (tested). The operator holds only registrar and renew roles, which the user can revoke. The API reads the send policy fresh from ENS through UniversalResolverV2 before every send and fails closed if ENS can't be read. Revoking an agent removes its roles on chain.

Arkiv (Rabdi): each email is one entity (schema nanite.email.v1) holding ciphertext, with only the attributes queries need: agent, type, time, thread id, reader key ids and a per-user pseudonym of the sender. The operator wallet creates the entity and calls changeOwnership to the user's wallet in the same executeBatch, so users need no tokens and Nanite gives up control. Expiry is the retention policy: login codes get 5 minutes, other mail gets permissionlessExtension so the owner's Keep (7, 30, 90 or 182 days) and the agent's extend_email work. Notable: anyone can write entities with our schema and transfer one into a victim's wallet, so every query is pinned to our creator address and the reader checks it on every row. Writes go through a single-flight queue, because key prediction depends on the nonce. We documented what hurt, with repro scripts, in arkiv/friction.md.

Crypto: XChaCha20-Poly1305 with a fresh key per email, sealed per reader with X25519, with the reader list bound into the encryption. The user's key is generated in the browser and unlocked by one wallet signature per session (HKDF). Backups are a recovery code or a passphrase (Argon2id). Mail signatures are EIP-191 over a canonical string. We sign our own X-Nanite-Message-Id, because Amazon SES (behind Resend) replaces Message-ID, which broke our first signature version.

MCP: hosted Streamable HTTP at /mcp with a bearer agent token, and a local stdio kit that decrypts and signs on the agent's machine for self-hosted agents. Mail content is always returned under an "untrusted" field.

Everything runs in Docker, tested with lint, typecheck, API tests, Playwright end-to-end tests and live runs against Sepolia, Rabdi and Resend. Built with Claude Code: an orchestrating session planned and reviewed, Sonnet subagents wrote the code, and every architecture and security decision was made by a human.

background image mobile

Join the mailing list

Get the latest news and updates