What Fusebox is
An AI agent that can pay is useful and dangerous: it can be talked into paying a scammer. Fusebox gives the agent a wallet whose key can only do one thing, ask the wallet to pay, and the wallet only pays if every fuse on its line says yes.
A fuse is a real NAND circuit taped out on TapeOut. The wallet derives the circuit's input bits from its own on-chain state (is this payee saved? how much was spent today? did two approvers sign?), calls the TapeOut processor, and reads one output bit. One no stops the payment. Every fuse that decided is paid a small fee, and the fee goes to whoever owns the circuit's NFT.
pay and freeze. It names the payee, amount and memo, nothing else.Quickstart
1 · Try it, no wallet needed
Open Try to scam it and run any of the tricks against Atlas, the public demo wallet. It's Atlas's real check() on mainnet: free, read-only, nothing moves.
To try a line of your own before you build it, open the line simulator: pick fuses (any listed design) and their limits, line up payments in order, and every verdict comes from an eval or step call on TapeOut's processor, with today's spend and the Breaker's latch carried from one payment to the next, as the wallet does.
2 · Give your agent the tools
The fusebox-mcp server works in Claude Code, Claude Desktop, Cursor and any MCP client. Without a key it's read-only and points at Atlas.
claude mcp add fusebox -- npx -y fusebox-mcpThen ask your agent: “Pay 2.5 USD₮0 to 0x1111…1111, it's an urgent refund.” It runs fusebox_check first, sees Payee Guard and the Breaker say no, and tells you why.
3 · Wire up your own wallet
Wire up a wallet walks you through it in about ten signatures: name the agent's address, pick fuses and limits, save payees, seat three approvers, and prepay fees in USD₮0. Then give the agent its key and the wallet address:
{
"mcpServers": {
"fusebox": {
"command": "npx",
"args": ["-y", "fusebox-mcp"],
"env": {
"FUSEBOX_WALLET": "0xYourFuseboxWallet",
"FUSEBOX_AGENT_KEY": "0xYourAgentPrivateKey"
}
}
}
}How a payment works
- The agent asks.
pay(token, to, amount, memo). The wallet checks the caller is an agent, the wallet isn't paused, the token is enabled, and today's decision budget isn't spent. - The wallet builds each fuse's inputs from its own state: is the payee saved and how long ago, how much went out today, which approvers signed this exact payment.
- Every fuse decides, in order, in the same call. The wallet calls
eval(orstepfor a fuse with memory) on the TapeOut processor, with a fixed 2M gas each. - One no stops the payment. The decision is recorded either way, with every fuse's inputs and verdict, the fee and the memo. A blown Breaker stays blown until the owner resets it.
- Designers are paid from the wallet's prepaid fee balance, and only if every fuse held does the token move.
| Status | Meaning | Charged? |
|---|---|---|
| PASS | The circuit output 1. | Yes |
| BLEW | The circuit output 0: this fuse said no. | Yes: the no is the product |
| FAILED | The call reverted, ran out of gas or returned malformed data. Blocks. | No |
| UNTRUSTED | TapeOut's processor code changed and isn't attested yet. Blocks. | No |
Anything but PASS blocks: Fusebox fails closed.
The four fuses
A socket is the contract between the wallet and a circuit: the wallet derives the bits, the circuit decides. Bits are packed least-significant first (TAP-02 §5). Amounts are rounded up to the install's unit and saturate at 255, while owner limits stop at 254, so a saturated amount can never pass.
| Fuse | Circuit | Inputs | Says no when | Fee |
|---|---|---|---|---|
| Daily Cap | #15 · 108 NAND | 24: amount, spent today, cap | The payment would pass today's cap (UTC day) | 0.001 |
| Payee Guard | #16 · 79 NAND | 33: saved?, age (h), cooldown, amount, trial | The payee isn't saved, or is new and over the trial amount | 0.001 |
| Breaker | #17 · 10 NAND + 1 LATCH | 4: set, clear, attempt, suspect | A payment goes to a stranger: it latches and stays blown | 0.0005 |
| Two of Three | #18 · 46 NAND | 19: three approver bits, amount, threshold | Over the threshold without two approvals for that exact payment | 0.002 |
Fees are in USD₮0 per check; a payment checked by all four costs 0.0045. Every netlist is on TapeOut's processor, and the fuse market checks each one against the hash the registry pinned at listing.
Fees and budgets
- Prepaid. Fees come from the wallet's balance in the registry, not from the agent's spending money. If it can't cover the fuses, the payment reverts: no payment without paying the fuses.
- 90 / 10. Each fee goes 90% to the fuse's designer (whoever holds the circuit NFT when they claim) and 10% to Fusebox. The contract caps Fusebox's share at 20%.
- Blocked attempts pay too, within limits: FAILED and UNTRUSTED fuses are never charged.
- Daily budgets. At most 100 recorded decisions and 20 recorded blocks per UTC day by default (
setDailyLimits). Past them an attempt reverts and costs nothing, so a hijacked agent can't drain fees. - Price changes. The wallet passes the highest fee the owner accepted; a designer's raise only applies once the owner accepts it.
The wallet API
Pay from the agent's key, or dry-run first with check. ABIs are in the repo at web/lib/abi.ts.
import { createPublicClient, createWalletClient, http, parseUnits } from "viem";
import { privateKeyToAccount } from "viem/accounts";
import { xLayer } from "viem/chains";
import { fuseboxWalletAbi } from "./abi";
const WALLET = "0xYourFuseboxWallet";
const USDT0 = "0x779Ded0c9e1022225f8E0630b35a9b54bE713736";
const pub = createPublicClient({ chain: xLayer, transport: http() });
const agent = createWalletClient({ account: privateKeyToAccount(process.env.AGENT_KEY), chain: xLayer, transport: http() });
const amount = parseUnits("2.5", 6);
// dry run: which fuse would say no? status[i]: 0 PASS · 1 BLEW · 2 FAILED · 3 UNTRUSTED
const [allowed, status] = await pub.readContract({ address: WALLET, abi: fuseboxWalletAbi, functionName: "check", args: [USDT0, payee, amount] });
if (allowed) await agent.writeContract({ address: WALLET, abi: fuseboxWalletAbi, functionName: "pay", args: [USDT0, payee, amount, "Invoice INV-7795"] });| Who | Can call |
|---|---|
| Agent | pay, freeze |
| Approvers | approvePayment, revokeApproval, freeze |
| Owner | addPayee · removePayee · setAgent · setApprovers · addFuse · removeFuse · setFuseParams · setFuseMaxFee · setDailyLimits · setApprovalTtl · setToken · setPaused · freeze · unfreeze · withdrawFeeBalance · execute · transferOwnership |
| Anyone | check and every view |
Every owner call is in the app. Open the wallet's page and connect the owner's address: the owner console has Safety (freeze, reset, pause, daily budgets), Fuses (edit, remove, install from the market, accept a new fee), Payees, People (agents, approvers, the approval window), Money (fund or withdraw the wallet, top up or withdraw fees) and Ownership (a two-step handover the new owner accepts). Each write is simulated before you sign.
Alerts and exports. Every wallet publishes its decisions as an Atom feed at /api/wallet/<address>/feed (subscribe in Slack with /feed subscribe, an email digest or any reader) and its whole history as CSV at /api/wallet/<address>/csv. With the wallet's page open, the app can also raise a browser notification whenever a payment is stopped.
Approvers. Approvals is an inbox: connect an approver's address and it lists every payment an approval fuse stopped in any wallet where that address holds a seat, until a later decision pays it, with who has signed and a one-tap approve. Approvers can subscribe to /api/approvals/feed?approver=<address>. The SDK's pay() returns needsApproval.url when signatures alone would clear a payment, and the MCP tools say the same.
Fleets. My wallets shows every wallet you own at once: balances, fees left and how many decisions they cover, blown fuses, today's decisions and stops, and a status that flags low fees, a blown fuse or a missing agent. One button freezes every live agent.
Badges. /api/badge/<wallet> is an SVG for a README or a status page: the wallet's fuses and whether any is blown or the wallet is paused, read from X Layer and cached for five minutes. A wallet page's tools copy the Markdown for you.
MCP tools
| Tool | What it does |
|---|---|
fusebox_check | Dry-runs a payment against every fuse and returns each verdict with its reason. Free and read-only. |
fusebox_pay | Pays in USD₮0 through the fuses with the agent's key; reports paid or stopped, which fuse said no, the fee and the transaction. |
fusebox_status | The wallet's balance, fee balance, fuses (and whether any is blown), today's spend and decision counts. |
fusebox_preflight | Checks a payment against any line of TapeOut circuits for any wallet, with the context you supply; returns each verdict and the next latch state. Free and read-only. |
fusebox_fetch | Fetches a URL; if it asks for payment over x402, pays the price through the fuses (only if they all allow it) and returns the response. max_price caps it, dry_run only reports. |
| Variable | Default | Meaning |
|---|---|---|
FUSEBOX_WALLET | Atlas | The wallet the agent pays from |
FUSEBOX_AGENT_KEY | none (read-only) | The agent key you named in the wizard. It can only ask the wallet to pay. |
FUSEBOX_RPC | rpc.xlayer.tech | An X Layer RPC |
FUSEBOX_APP | fusebox-xlayer.vercel.app | Where approval links point and approver alerts are sent from |
TypeScript SDK
For agents and services that don't speak MCP, fusebox-sdk is a typed client built on viem. pay checks first and doesn't send a payment the fuses would refuse, since a refused payment is still recorded and its checks are still paid for.
npm install fusebox-sdk viemimport { Fusebox } from "fusebox-sdk";
const fb = new Fusebox({ wallet: "0xYourFuseboxWallet", account: process.env.FUSEBOX_AGENT_KEY });
const c = await fb.check("0x69dB…A6C4", "12.5"); // every fuse's verdict and why, free
const r = await fb.pay("0x69dB…A6C4", "12.5", "Invoice INV-7790");
if (!r.paid) console.log(r.summary); // "Not sent. Stopped: Daily Cap (…)"
const stop = fb.watch((d) => { if (!d.paid) notify(d); }); // decisions as they landAlso status(), history(), fetch(url) for paid APIs (below), preflight(...) for any wallet (below), requestApproval(to, amount, memo), pending(approver) and approve(to, amount) for approvers, and freeze(). Source and tests in sdk/.
Pay per call (x402)
Agents pay for APIs with x402: the server answers 402 with an offer, the agent pays and asks again with proof. With Fusebox the price is a payment like any other, so it goes through the wallet's fuses first: a scam price list is stopped like a scam invoice, and nothing moves. Two live demo sellers show both sides.
- The seller answers
402withPAYMENT-REQUIRED(x402 v2): afuseboxoption oneip155:196in USD₮0, the payee, the price, and a nonce it signed. - The agent's wallet runs the free
check(), thenpay()through the fuses withx402 <nonce>in the memo. - It retries with
PAYMENT-SIGNATURE: the wallet and the transaction. The seller checks that the factory made the wallet, that its Decision allowed this payee and price with that nonce, that USD₮0 moved, and that the transaction hasn't bought anything before. Then it serves the response with aPAYMENT-RESPONSEreceipt.
const { response, payment } = await fb.fetch("https://fusebox-xlayer.vercel.app/api/x402/prices", {}, { maxPrice: "0.05" });
console.log(payment?.summary); // "Paid 0.01 USD₮0 to 0x69dB… for …/prices (decision #7)."import { createPublicClient, http } from "viem";
import { xLayer, x402 } from "fusebox-sdk";
const client = createPublicClient({ chain: xLayer, transport: http() });
export async function GET(req: Request) {
const g = await x402.requirePayment(req, { payTo: "0xYou", price: "0.01", secret: process.env.X402_SECRET!, client,
markUsed: (tx) => db.insertIfAbsent("x402:" + tx) }); // one payment buys one response
if (!g.paid) return g.response; // 402: a fresh offer, or why it didn't count
return Response.json(await getData(), { headers: g.headers });
}Sellers on their own x402 stack can use the hosted facilitator for the scheme, in x402's shape: GET /api/x402/facilitator/supported, and POST /api/x402/facilitator/verify or /settle with { paymentPayload, paymentRequirements }. Settle marks the transaction used, so a payment settles once.
Why a scheme of its own: x402's exact scheme has the payer sign a token transfer off-chain. A Fusebox wallet is a contract that only pays through its fuses, so it can't sign one, and shouldn't: that signature would skip the fuses. Here the on-chain Decision is the proof.
Agent frameworks
fusebox-tools gives an agent the same four tools as the MCP server (fusebox_check, fusebox_pay, fusebox_status, fusebox_fetch) as native tools for the Vercel AI SDK, LangChain and ElizaOS, or as plain objects for anything else. Options fall back to FUSEBOX_WALLET, FUSEBOX_AGENT_KEY and FUSEBOX_RPC.
import { fuseboxTools } from "fusebox-tools/ai";
const { text } = await generateText({ model, tools: fuseboxTools(), stopWhen: stepCountIs(5),
prompt: "Pay Kano Cotton's invoice INV-7801: 0.05 USD₮0 to 0x69dB89385E8a69278a49335C432d0c70ec86A6C4" });import { fuseboxLangchainTools } from "fusebox-tools/langchain";
const agent = createReactAgent({ llm, tools: fuseboxLangchainTools() });import { fuseboxPlugin } from "fusebox-tools/eliza";
export const character = { name: "Ledger", plugins: [fuseboxPlugin],
settings: { secrets: { FUSEBOX_WALLET: "0xYourFuseboxWallet", FUSEBOX_AGENT_KEY: process.env.FUSEBOX_AGENT_KEY } } };A refused payment comes back as a result the model can read (which fuse said no and why), not an exception, and approval links are meant for a person. Source and tests in tools/.
Approver alerts
Two of Three only works if approvers hear about requests quickly. On Approvals, an approver turns on alerts for their phone or laptop with one signature (free: it proves the address is theirs). From then on a payment waiting on their seat arrives as a notification that opens that exact approval. Fusebox installs as an app (on iPhone, add it to the Home Screen first: iOS only delivers web push to installed apps).
- When an agent asks. The SDK's
pay()and the MCP'sfusebox_payalert the approvers themselves when signatures are all that stand in the way. The request is signed with the agent's key; Fusebox checks on X Layer that the signer is the wallet's agent and that the approval fuse really holds that payment before anything is sent. - Every hour. A sweep announces any open request in an approver's inbox that hasn't been announced yet, so a refused decision recorded on-chain is never missed. Each request is announced once.
Alerts are end-to-end encrypted web push (VAPID). The server stores each device's push subscription under the approver's address and nothing else; a device the push service reports gone is dropped.
Pre-flight for any wallet
Not every agent will move its money into a Fusebox wallet on day one. Pre-flight lets any agent, on any wallet, run a payment through a line of TapeOut circuits before it signs. Each verdict is the circuit's own eval (or step, for circuits with latches) on X Layer, read-only and free. A Fusebox wallet keeps the context on-chain; with pre-flight you send it: what was spent today, whether the payee is saved and since when, which approvers signed, and the latch state from your last call, which comes back updated so the Breaker remembers.
import { preflight } from "fusebox-sdk";
const r = await preflight({
line: [{ fuseId: 1, a: 50 }, { fuseId: 2, a: 24, b: 2 }, { fuseId: 3 }, { fuseId: 4, a: 20 }],
payment: { amount: "2.5" },
context: { spentToday: "10", payee: { saved: true, hoursSinceSaved: 72 }, approvals: 0, state: lastState },
});
if (!r.allowed) return; // "Stopped by Payee Guard (the payee isn't in the payee book)…"
lastState = r.state; // the Breaker remembers next time
await wallet.sendTransaction(…);Over HTTP it's POST /api/preflight with the same body (GET returns an example), and MCP agents get fusebox_preflight. Any listed fuse works, rivals and Studio designs included. Pre-flight is advisory: the agent can still sign without asking. When you want the circuits to be the only way money moves, that's what a Fusebox wallet is for.
Plain-English guardrails
The wizard's first decision, which fuses and what settings, is the hardest for someone new to it. On Wire up a wallet you can describe the agent instead (“it pays our three suppliers, never more than 80 a day, anything over 30 needs me and my partner”) and get a proposed line: each fuse on or off with its settings, a plain reason for each, and test payments that show the line working, including what it stops.
- Who proposes it. Claude Haiku 5.5 on NEAR AI Cloud, through a strict tool call; the answer is validated and clamped to what the circuits accept (8-bit settings). If the model is unavailable, Fusebox's rule reader proposes from the same description, and says so.
- Nothing is trusted blindly. “Test it on TapeOut's circuits” opens the line simulator with the proposal's own test payments, and TapeOut's processor decides each one. “Use this line” fills the wizard, including any payee or approver addresses you mentioned, and you still review every number before you sign.
Sell a fuse
- Design the circuit as NAND gates (plus LATCH bits if it needs memory) against one socket's pinout. The repo's circuits toolchain builds, simulates and exhaustively tests TAP-02 netlists, and passes TapeOut's official test vectors.
- Tape it out on an X Layer TapeOut processor: mint one transistor per gate and call
tapeout(netlist, nIn, nOut). You get the circuit NFT. - List it on the designers page, or call
registry.list(processor, circuitId, socket, netlistHash, fee, uri). The registry checks the pinout, the gate budget (512), the state rules and the netlist hash against the chain. - Earn on every decision, the no's included. Claim with
claim(fuseId, to). Sell the NFT and the income moves with it. Wallet owners install your fuse from the fuse market in one signature. - Or skip the toolchain. Fuse Studio builds the circuit from rules (OR across groups, AND within one, or N strikes for the Breaker socket), compiles it to NAND gates with the same toolchain, proves the bytes against the rule on every input (2^24 for the Daily Cap socket), then mints the transistors, tapes it out and lists it from your wallet. Built there, Daily Cap and Two of Three come out byte-identical to circuits #15 and #18.
- Describe it. A listing's
metadataURIholds a smallfusebox-fuse/1JSON (name, summary, description, rule). The designers page writes it on X Layer itself as adata:application/json;base64URI, so the description needs no host; an https link to the same JSON works too. Every fuse gets its own page, e.g. /app/fuse/1. - Play gate golf. The Studio's optimizer shrinks a rule's circuit (merging identical logic, folding constants, removing conditions another one already implies) and proves the smaller netlist gives the same answer on every input before it lets you tape it out. Fewer gates means fewer transistors to mint and less gas on every check, about 2,400 gas a gate. Fusebox's own eight circuits are already minimal; rules people write typically shrink by 5 to 75%.
- Try before you tape out. From the Studio, send a draft to the line simulator: it is compiled and evaluated in the browser from the same bytes TapeOut would store, next to listed fuses, on any sequence of payments. A draft is also a link you can share; it reopens in the Studio as designed.
- Run it like a product. From the designers page, change the fee (
setFee), delist it from new installs (setListed) or link a page that explains it (setMetadataURI). A lower fee applies to everyone at once; a higher one only to wallets whose owner accepts it.
Several designs can compete on one socket. The repo ships four rivals for the same sockets, exhaustively tested and rehearsed on a mainnet fork but not yet taped out on mainnet: Per-Payment Cap (no single payment over the cap), Strict Payee Book (no trial amount), Two-Strike Breaker (two latches: the first stranger is refused, the second blows it) and Lead Approver (seat 1 must be one of the two signers). A rival names its settings in its metadata, and the app labels them that way.
Duplicate-invoice checks, business hours only, per-payee caps, velocity limits: there's room for many more fuses.
Contracts
X Layer mainnet, chain 196. The registry, factory and Atlas have verified source on Sourcify (exact match).
| FuseRegistry | 0x852a278322667BB86A2665a38CbC5Bfd551B20d7 ↗ |
| FuseboxFactory | 0x192C099a18ed42612b6e74f243f8dF1EE0E3E7a5 ↗ |
| Atlas (demo wallet) | 0x0Db0457715a6445D8a65F820d717a6B39Be66800 ↗ |
| OrderGuard (TapeOut processor) | 0x57F319CF056F72F48cF1dbb670F2A3DB007Aa355 ↗ |
| USD₮0 | 0x779Ded0c9e1022225f8E0630b35a9b54bE713736 ↗ |
| Circuits | #15 Daily Cap · #16 Payee Guard · #17 Breaker · #18 Two of Three (fuse ids 1–4) |
Security
Unaudited. The contracts are live on mainnet and Atlas holds small balances on purpose. Highlights of the threat model (full table in ARCHITECTURE.md):
- Fake processors can't pass. The registry trusts a processor only by its runtime code hash, rechecked at every decision. If TapeOut upgrades its code, fuses read UNTRUSTED and payments stop, free, until the new code is attested.
- Prompt injection can't pick the inputs. The agent supplies payee, amount and memo; every bit a fuse sees is built on-chain.
- A stolen agent key still faces the caps, the payee book and approvals. The agent can freeze but never unfreeze.
- Approvals can't be replayed. Each is bound to the chain, wallet, approver set, token, payee and amount, and expires.
- Bad listings are refused: wrong pinout, a different netlist, over 512 gates, memory where it isn't allowed, or references to other circuits.
Remaining trust: TapeOut's factory owner can upgrade code (fails closed), USD₮0's issuer can freeze addresses, and the wallet owner is fully trusted.
Live health of everything Fusebox depends on (X Layer's RPCs, TapeOut's processor trust, Atlas's fees, the AI agent, the x402 sellers, alerts) is on the status page, and as JSON at /api/status.
FAQ
Does the agent ever see or control the fuses?
No. The agent's key can call pay and freeze. Fuses, limits, payees and approvers belong to the owner.
What does a payment cost?
Gas on X Layer (fractions of a cent) plus the fees of the fuses on the line. On Atlas, all four fuses together cost 0.0045 USD₮0.
Why do blocked payments pay fees?
Stopping the scam is the fuse's job. Daily budgets cap how much blocked attempts can cost.
Can I use my own circuit?
Yes: tape it out for one of the four sockets and list it. Wallets can install it straight away.
Is there a version with no server at all?
The DeWEB edition is one self-contained page that reads X Layer from your browser, built to be stored on-chain at 15.2.272.tape and served by TapeKit.