2026-11-27 16:21 UTC

MoneySwitch adds per-agent spending controls to self-hosted x402 payments

state: expiredheat: lowuncertainty: mediumrelevance: mediumagent-payments x402 usdc agent-commerce self-hosteddongsheng123132hecare

What is this?

MoneySwitch is an open-source, self-hosted wallet service that lets AI agents request x402 API payments through HTTP using per-agent keys rather than exposing the wallet’s private key. Its controls include spending limits, host restrictions, human approval thresholds, revocation and per-key transaction records. The repository describes testnet support and optional real-USDC payments on Monad and Base mainnets; Solana Devnet support is also listed, with live settlement still unverified. The supplied evidence documents a working scripted testnet demo, not production-scale use or broad adoption.

Why it matters

MoneySwitch is a practical wallet-and-policy layer for x402 agent payments, addressing a real integration concern: agents need to make paid API calls without receiving the wallet’s private key. Per-agent budgets, host restrictions, approvals and transaction records make it more controlled than giving an agent unrestricted wallet access. But this is an early, self-hosted project—not evidence that agent commerce is established: the demonstrated payments use valueless testnet tokens, real mainnet settlement is optional, and adoption evidence is minimal.

Current assessment

The repository describes an AGPL-licensed, self-hosted HTTP service where agents use per-agent MoneyKeys to request x402 payments; the wallet’s private key stays on the server. Administrators can set daily, total and per-request limits, restrict destination hosts, require human approval above a threshold, revoke keys, and inspect per-key payment records. The project supports USDC on Monad and Base testnets and, when explicitly enabled, their mainnets; it also lists Solana Devnet support, but says a live Devnet settlement remains unverified. Its October 9, 2026 demo is described as two scripted clients making real Monad testnet transactions with test USDC that has no monetary value. The Show HN post appeared October 15 and had one point in the supplied result; this indicates a launch/discovery signal, not meaningful adoption. What is new and useful is the concrete permissions and approval layer around agent-initiated x402 calls, plus self-hosting for the payer. This may help developers experimenting with paid API calls decide how to limit an agent’s authority, but the evidence does not establish production readiness, security under adversarial conditions, live mainnet use, or broad demand. Operators would control and fund the wallet; the project warns that running it to hold or spend other people’s funds can create legal obligations. Treat it as an early infrastructure experiment, and verify deployment isolation, security and live-chain behavior before risking real funds.

Measured heat

no measured readings yet — the hourly heat pass fills this in

How the heat travelled

10-08 13:00⭐ origin echo-reconstructedMoneySwitch: a programmable, self-hosted Web3 cloud wallet for AI bots. Give each agent a MoneyKey with spending rules (daily/total/per-requ
dongsheng123132 / hecare on github (echo) · attributed from hn.story.50099082
—
10-15 04:17first on hacker news · published · +159.3hShow HN: MoneySwitch – AI agents pay x402 APIs in USDC (self-hosted)
hfshfg
—
10-15 04:17amplified on hacker news 👑hn.story.50099082
hfshfg
peak 1 · 1 comments · 98% of case engagement
10-15 04:20our radar first saw it · +159.3hdiscovery anchor: hn.story.50099082—

Evidence (2) — ⭐ canonical anchor

sourceobjectauthorscorecomments
🟧 hnShow HN: MoneySwitch – AI agents pay x402 APIs in USDC (self-hosted)
Retrieved article excerpt

Open article · Retrieved 2026-10-15T04:22:56.741274+00:00

# MoneySwitch

**A programmable, self-hosted Web3 cloud wallet for AI bots.**

[Website](https://moneyswitch.dev) · [Watch the demo](https://moneyswitch.dev/videos/technical-demo/) · [Try it](https://moneyswitch.dev/pilot/) · [Contribute a PR](https://github.com/dongsheng123132/moneyswitch/blob/main/CONTRIBUTING.md#first-pr) · [中文](https://github.com/dongsheng123132/moneyswitch/blob/main/README.zh-CN.md)

[MoneySwitch: a programmable Web3 cloud wallet for AI bots. Your cloud. Your wallet. Your rules.](https://moneyswitch.dev)

Your agents run across laptops, desktops and cloud servers. Give each one a **MoneyKey** with its own spending rules, connected to one wallet service on your own server. The AI calls an HTTP API; the wallet's private key stays on the server.

- **One key per agent:** daily, total and per-request limits, allowed hosts, expiry and revocation.
- **Human control:** payments at or above a configured approval threshold wait for approval; hard spending limits still apply.
- **Traceable payments:** per-key bills, payment outcomes and transaction links for compatible x402 services, using USDC on Monad or Base.

## Watch it work

Click either preview to watch in your browser. No sign-in is needed.

|  |  |
| --- | --- |
| [Watch the real MoneySwitch testnet demo: keys, payments, human approval, bills and revocation](https://moneyswitch.dev/videos/technical-demo/) [**▶ Product demo · 2:02**](https://moneyswitch.dev/videos/technical-demo/) Two MoneyKeys, a direct payment, a human-approved payment, transaction records and key revocation. | [Watch the MoneySwitch pitch: a cloud wallet for AI bots, created by hecare](https://moneyswitch.dev/videos/pitch/) [**▶ Why a cloud wallet? · 1:38**](https://moneyswitch.dev/videos/pitch/) The multi-device agent problem, the product and its creator, 贺去病 / hecare. |

The product demo is a real Dashboard recording on **Monad testnet**, with two scripted HTTP clients making real testnet payments. Test USDC has no monetary value. Both videos have English narration and captions. [Video library](https://moneyswitch.dev/videos/) · [Download MP4s](https://github.com/dongsheng123132/moneyswitch/releases/tag/metropolis-videos-2026-10-09)

## How the cloud wallet fits together

```
flowchart TB
    A["Laptop agent A"] -->|MoneyKey A| W
    B["Desktop agent B"] -->|MoneyKey B| W
    C["Cloud agent C"] -->|MoneyKey C| W
    W["MoneySwitch<br/>Your cloud wallet<br/>Limits + signing"]
    H["Human owner"] -->|"Keys + approvals"| W
    W -->|"x402 + USDC<br/>Monad / Base"| S["Compatible APIs"]
    W --> L["Per-key bills<br/>Status + tx links"]
    classDef wallet fill:#ede9fe,stroke:#7c3aed,color:#29134f,stroke-width:2px
    classDef human fill:#ecfccb,stroke:#65a30d,color:#254000
    class W wallet
    class H human
```

 Loading

The owner controls the deployment and funds. Agents receive spending keys, not wallet private keys. Keep the wallet service isolated from the agents' operating-system permissions; see the [self-hosting guide](https://github.com/dongsheng123132/moneyswitch/blob/main/deploy/README.zh-CN.md).

## Inside the Dashboard

Actual v0.7.6 screens from the October 9, 2026 testnet demo. Click a screenshot to inspect it at full size. The cover above is a concept illustration; the screens below are the running product.

**1. Give each agent its own budget and approval rules.**

[Keys page showing separate MoneyKeys for Agent A and Agent B, spending limits and approval settings](https://github.com/dongsheng123132/moneyswitch/blob/main/docs/media/dashboard-keys.png)

**2. Review a payment that reaches its approval threshold.**

[Approvals page showing a pending 0.01 test USDC payment with Approve and Deny controls](https://github.com/dongsheng123132/moneyswitch/blob/main/docs/media/dashboard-approval.png)

**3. See which agent paid, how much and the resulting transaction.**

[Bills page showing two settled Monad testnet payments, totaling 0.02 test USDC, with transaction links](https://github.com/dongsheng123132/moneyswitch/blob/main/docs/media/dashboard-bills.png)

## Try it, report it, open a PR

| Start here | What to do |
| --- | --- |
| [Testnet trial guide](https://moneyswitch.dev/pilot/) | Deploy your instance, issue a testnet key and make your first test payment. |
| [Send trial feedback](https://github.com/dongsheng123132/moneyswitch/issues/new?template=early-feedback.yml) | Tell us what you tried, what happened and what would make it useful. |
| [Make your first PR](https://github.com/dongsheng123132/moneyswitch/blob/main/CONTRIBUTING.md#first-pr) | Follow the fork → change → test → PR steps. Docs, integration instructions and focused fixes are welcome. |
| [Get articles, images and videos](https://moneyswitch.dev/media/) | Find the official media kit for sharing MoneySwitch. |

**One MoneySwitch spends for one payer.** You on your own machine, a company issuing keys to its staff's AIs, a company running its own bots: each is one payer, and every coin in the wallet belongs to whoever deployed the server. The administrator issues the keys; there is no sign-up and there are no user accounts.

[SPEC.md](https://github.com/dongsheng123132/moneyswitch/blob/main/SPEC.md) is the authoritative specification. Setup and payment details follow below.

## Run it

Node.js 22+ and pnpm.

```
pnpm install --frozen-lockfile
pnpm build
node apps/server-pkg/dist/cli.js --data-dir ./data
```

The first start prints an administrator token and a one-time sign-in link (valid 30 minutes, single use). Open the link: it signs you in and lands on the Wallet page. Set `MONEYSWITCH_PUBLIC_URL` to the address people will reach the server at; approval links and the skill text use it (without it they name the server's own listen address, `http://127.0.0.1:4020` by default, never a request's `Host` header). Lost the administrator token? On the server itself, as the user that runs it: `moneyswitch-server reset-admin-token` (Docker: `docker compose exec server node /app/dist/cli.js reset-admin-token`; from source: `pnpm admin:reset-token -- --data-dir <dir>`); see [docs/security.md](https://github.com/dongsheng123132/moneyswitch/blob/main/docs/security.md).

The Dashboard has four pages and a login:

| Page | What you do |
| --- | --- |
| **Wallet** | Create the wallet. Write down the 12 words (shown once) and tick "I wrote them down". Send it a little USDC. It unlocks itself after a restart. Balances come in two groups, "Mainnet · real money" and "Testnet · test tokens, no value" (only the kinds you enable), each with its own funding note. |
| **Keys** | Issue one key per AI. First choose its network type: **testnet** (test tokens, no value) or **mainnet** (real USDC: you must tick "this key spends real money"). A testnet key pays only on testnets and a mainnet key only on mainnets, never both. Then the daily, total and per-request limits, allowed hosts, approval line, expiry. The key and its skill paragraph (which says which type it is) are shown once; paste the paragraph into the AI. Every root key also gets a **confirmation code** for the person who will use it: 4 to 6 digits that you type (their own choice, if you like), or a random 4-digit one when you leave it empty. It is shown once, next to the key, and is never in the skill paragraph: it is for a person, not for the AI. "Set confirmation code" on a key's row replaces it at any time (and unlocks it); resetting the key's secret leaves it alone. A key issued before v0.7.4 has none until you set one, and the list says so ("No confirmation code · only the administrator can approve"). Limits and network type are fixed once a key is issued: to change them, revoke the key and issue a new one. The allowed hosts can only be widened, by approving a new host (below). The list marks every key Testnet or Mainnet; a key issued before v0.7.2 shows "Legacy key" with the chains it really pays on (see the Networks section; revoking it and issuing a new one is recommended). |
| **Approvals** | Approve or deny a payment that is over a key's approval line, or a request to a host that is not on a key's list: approving a new host adds it to that key's allowed hosts. You, the administrator, see and decide everything here. The person who holds a key does not need to sign in: the approval link opens for them, shows that one request, and the key's confirmation code approves or denies it. |
| **Bills** | Every payment: time, key, amount, URL, chain (marked mainnet or testnet), transaction hash, charged yes / no / maybe. The totals are one per kind, mainnet and testnet never added together; filter by mainnet / testnet; the CSV ends with a `network_kind` column. |

The AI pays with `POST /v1/fetch`. Over the approval line the answer is `approval_required` with an `approval_id` and an `approve_url` (`{MONEYSWITCH_PUBLIC_URL}/approvals?id=…`). The skill tells the AI to hand the link to the person who gave it the key and to poll `GET /v1/approvals/:id` every 15 seconds. The link carries no token and opens without a login: it shows that one request (site or amount, chain, key name), and the person types the key's confirmation code to approve or deny it. The code is the root key's (a child key has none of its own), five wrong codes in total since it was last set lock it (a right code does not take them back) until you set a new one, and you can always approve after signing in. A code that is too easy to guess (1111, 1234, 4321, 2580, ...) is refused when you set it. The key itself can never approve: the AI holds it, and never has the code. After approval the AI repeats the request with the `approval_id`. A request to an http(s) host that is not on the key's list gets the same answer, before anything is sent to that host. Approving it adds that `host:port` to the key's allowed hosts for good, and the AI repeats the request as it was, without an `approval_id`; the price is then checked as usual and can ask once more. The name is looked up once, when you approve: one that resolves to a private address (or one of this machine's own), or whose lookup fails or times out, is refused and stays waiting. Child keys, other protocols and literal private, loopback or special-use addresses get `HOST_NOT_ALLOWED` instead, and a key has at most 5 new hosts waiting (`RATE_LIMITED`). An approval expires after 10 minutes. There are no push channels.

`GET /skill.md` serves the generic skill, without a key. Skill + key is the integration; the plain HTTP call is the only other way in.

### First payment on a testnet

When the instance enables Monad testnet (a mainnet enabled next to it does not matter), the form for a **testnet** key offers "allow the test payment endpoint" (ticked by default; it adds `app.moneyswitch.dev:443` to the allowed hosts). A mainnet key is never offered it. The skill then asks the AI to make one test payment to `https://app.moneyswitch.dev/x402-testnet/check` and report the transaction hash. That endpoint is a test receiver on Monad testnet; the money has no value.

## Deploy on your own server

[Docker Compose and HTTPS](https://github.com/dongsheng123132/moneyswitch/blob/main/deploy/README.zh-CN.md): persistent volume, Caddy, health check, backup, rollback. **Do not run the server and the AI on the same machine under the same system user**: the AI could edit the database and get around the limits. Run one server writer per SQLite volume. Outbound requests follow `MONEYSWITCH_PROXY` (`off`, `auto` or a proxy URL), then `HTTPS_PROXY` / `HTTP_PROXY` / `ALL_PROXY`, then the Windows system proxy.

## Networks and payment outcomes

Monad testnet (`eip155:10143`), Base Sepolia (`eip155:84532`), Solana Devnet (`solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1`), Monad mainnet (`eip155:143`), Base mainnet (`eip155:8453`). Testnets only by default: set `MONEYSWITCH_NETWORKS` to an explicit list and `MONEYSWITCH_DEFAULT_NETWORK` to a member of it; choosing a mainnet means real USDC. Each chain accepts only its own USDC. No swaps, no bridg
hfshfg11
🟧 echo.github ⭐MoneySwitch: a programmable, self-hosted Web3 cloud wallet for AI bots. Give each agent a MoneyKey with spending rules (daily/total/per-requdongsheng123132 / hecare——

Interpretation history

Decision trace