Agent-to-agent payments over email. Two emails, any rail.
The idea: email already has identity (DKIM), payloads (MIME), threading (In-Reply-To), and federation (SMTP). The only missing dimension is value. Envelopay adds a payment proof to the envelope.
Sign up at AgentMail (free tier: 3 inboxes, 100 emails/day). Create your agent inboxes:
export AGENTMAIL_API_KEY="am_..."
# Create inboxes
curl -X POST https://api.agentmail.to/v0/inboxes \
-H "Authorization: Bearer $AGENTMAIL_API_KEY" \
-H "Content-Type: application/json" \
-d '{"username": "axiomatic"}'
curl -X POST https://api.agentmail.to/v0/inboxes \
-H "Authorization: Bearer $AGENTMAIL_API_KEY" \
-H "Content-Type: application/json" \
-d '{"username": "blader"}'uv syncuv run python demo/four_rails.pyShows all four payment paths:
| Path | Payer rail | Receiver rail | Bridge |
|---|---|---|---|
| Crypto → crypto | On-chain | On-chain | None |
| Card → crypto | Stripe | On-chain | Bridge.xyz on-ramp |
| Crypto → card | On-chain | Bank/card | Bridge.xyz off-ramp |
| Card → card | Stripe | Stripe | None |
Plus a bounced payment (invalid proof → no FULFILL).
Two states. That's the whole protocol.
| State | Direction | Semantics |
|---|---|---|
ORDER |
Payer → Worker | Task + payment proof |
FULFILL |
Worker → Payer | Work product + settlement proof |
The X-Envelopay-Type header carries the state. The JSON MIME part carries the payload. DKIM proves provenance. In-Reply-To links the thread. The thread is the transaction log.
See SPEC.md for the full protocol specification.
From: axiomatic@agentmail.to
To: blader@agentmail.to
Subject: Review PR #417
Message-ID: <req-8f3a@agentmail.to>
X-Envelopay-Type: ORDER
DKIM-Signature: v=1; a=rsa-sha256; d=agentmail.to; ...
Content-Type: multipart/mixed; boundary="mp"
--mp
Content-Type: text/plain; charset=utf-8
Review PR #417 in github.com/axiomatic/widget
--mp
Content-Type: application/json; charset=utf-8
{
"task": {"description": "Review PR #417", "repo": "github.com/axiomatic/widget"},
"amount": "500000",
"token": "USDC",
"chain": "solana",
"proof": {"tx": "4vJ9..."},
"fallback": "https://cash.app/$axiomatic"
}
--mp--
From: blader@agentmail.to
To: axiomatic@agentmail.to
Subject: Re: Review PR #417
In-Reply-To: <req-8f3a@agentmail.to>
X-Envelopay-Type: FULFILL
DKIM-Signature: v=1; a=rsa-sha256; d=agentmail.to; ...
{
"result": {"summary": "Approved with 2 comments"},
"settlement": {"tx": "4vJ9...", "status": "confirmed"}
}
Two emails. Both DKIM-signed. Both parties hold the full record.
The fallback field carries a payment URL for counterparties without a wallet: Stripe checkout, PayPal, Cash App, Venmo — any URL that accepts money. The protocol mandates a proof, not a rail.
| Variable | Required | Description |
|---|---|---|
AGENTMAIL_API_KEY |
Yes | AgentMail API key for sending/receiving |
SOLANA_PRIVATE_KEY |
For crypto paths | Solana wallet private key (base58) |
BRIDGE_API_KEY |
For cross-rail | Bridge.xyz API key for fiat ↔ crypto |
STRIPE_SECRET_KEY |
For card paths | Stripe API key for card payments |
AGPL-3.0. If you serve this over a network, share your source.
- Sent — the user story
- Certified Mail — the semantics
- You Have Mail — the protocol argument
- No Postage — the economics
- Illegal Tender — the stack
- Proof of Trust — trust topology
- SPEC.md — protocol specification
- STACK.md — component map