Open templates: letting an agent draft crypto payment requests that a human signs (MCP, Claude Desktop, Cursor, n8n)

Disclosure: I build send21, so this is my own project. Posting because the templates are free to copy and the pattern may be useful even if you never use send21.

The problem: an agent that can pay is one bad tool call away from an irreversible mistake. The pattern we use is simple: the agent proposes, a human signs.

  • The agent gets a scoped API key that cannot spend. It can create drafts and payment requests and read their status, nothing else.
  • send21 prepares payment instructions (amount, address, network, locked rate). It never holds keys or funds and never signs or broadcasts.
  • The human pays from their own wallet, so the wallet signature is the approval, bound to the exact amount and payee.
  • Status comes back over signed webhooks. The v2 header, X-Send21-Signature-V2, is t=<unix>,v1=<HMAC-SHA256 of "<t>.<delivery id>.<raw body>">; refuse anything older than 5 minutes to stop replays.

MCP server: version 1.3.1 on the official MCP registry as io.github.send21io/mcp, Streamable HTTP at send21.io/mcp, 11 tools. Listing tools and reading fees works without a key. idempotencyKey is optional; if you send one and reuse it with different data, the call is refused (422), so retries cannot create a second request.

Templates (one folder each: claude-desktop, cursor, n8n): https://github.com/send21io/send21-examples

Assets: BTC on-chain and Lightning, USDC, EURC, SOL, ETH, and USDT on Solana and Ethereum only.

Questions I’d like input on from people building agents here:

  1. Is a wallet signature enough as the human approval step, or do you also want an approval record outside the wallet?
  2. For n8n-style flows, would you rather poll status or rely on webhooks only?

Happy to answer technical questions here, or at info@send21.io.

Your v2 header already answers half of it: the wallet signature authorizes that specific payment, but it’s not a durable approval record outside the wallet, and it doesn’t stop a replayed callback.

We learned this the hard way: our signed webhooks originally HMAC’d the raw body only, no timestamp or delivery id, so the signature proved origin but not freshness. Adding t and a delivery id is the part that turns it into an audit/replay record, not just proof the request came from you. I’d keep those two concepts separate in the docs.

Agreed, they’re two different jobs. The wallet signature authorizes the payment: that one transfer, nothing else. The V2 header protects the callback: the receiver rejects anything older than five minutes and dedupes on the delivery id, so a replayed webhook can’t mark an order paid twice. The draft itself is the record outside the wallet, because its amount, currency and receiver are fixed once it’s created, and the webhook ties the payment back to that draft. Good call on separating the two in the docs.

@capitaharlock A follow-up on keeping the two jobs apart. The webhook docs now state the split: the V2 signature covers the timestamp, the delivery id and the raw body, so a copied delivery can’t be replayed. The body-only signature stays only for existing integrations (send21 webhooks: events, payloads and signatures). We also added a durable receiver to the examples, because a dedupe set in memory forgets everything on restart. It stores X-Send21-Delivery and applies the order update in one SQLite transaction, and returns 2xx only after the commit: send21-examples/examples/webhook-receiver-sqlite at main · send21io/send21-examples · GitHub

When you added the timestamp and delivery id on your side, did you keep delivery ids in the same transaction as the business write, or in a separate store with its own cleanup?

- send21