▶ Demo video (YouTube) · Code, proofs and verification: github.com/fraserbrownirl/bursar-near · Agent briefing (llms.txt)
Qwen3.5-9B with a small computer compiled into its weights. Bursar pays through NEAR Intents, and the last two checks before anything is signed run inside those weights; each check writes a receipt that anyone can replay.
The wallet killer. A payment agent that handles blockchain payments and it can't be talked into paying the wrong person, because it checks every payment with a computer compiled into its own weights. Signing things we didn't understand was always the barrier that wallets would never overcome.
In this demo Bursar is paying for x402 services on Solana mainnet from its own prepaid wallet, funded by its owner. Before anything is signed, the model calls a RISC-V computer that lives inside its weights to decode the exact amount, token, recipient and fee. Bursar's rules then decide APPROVE or STOP. A hostile server can lie in its 402, swap the recipient, or change one character of an address, and Bursar stops it every time.
Few expected chat bots to replace Google search so quickly. Personal agents will replace blockchain wallets. Increasingly they are starting to pay for things themselves, through x402 and agent wallets but without Bursar they are prone to:
Bursar takes a third path. Exact checks happen inside the model, on your machine. A small computer is compiled into the model's layers, so the check can't be swapped, downloaded or poisoned at runtime.
| Result | |
|---|---|
| Real payment on Solana mainnet | Paid 0.005 USDC to citable.run, a live x402 service. Wallet USDC 0.178198 → 0.173198. Transaction |
| Attack 1: price × 1000 | STOP: amount exceeds the per-payment limit |
| Attack 2: recipient swapped after the first request | STOP: recipient differs from the known payee |
| Attack 3: one character of the address changed | STOP: recipient differs from the known payee |
| Exact values computed in the model's weights, live on a Mac | USDC token accounts, amounts, fees, in 2–5 s each (token accounts about 55 s) |
x402 server ──402──▶ bursar CLI ──tool call──▶ Bursar-9B
│ │ Qwen3.5-9B + a RISC-V computer
│ │ compiled into its layers
│◀── exact result ────────┘
│
rules: known payee? under limit?
│
APPROVE ─┴─ STOP
│
sign with keychain key (model never sees it)
│
PAYMENT-SIGNATURE ──▶ merchant's facilitator settles on mainnet
bursar pay <url> requests the resource and gets an x402 402 Payment Required.TransferChecked of the right mint and amount, to the payee's token account.sol ui 5000 6 → 0.005) and to compute the fee. The CLI never computes these itself; it prints each tool call and its result.PAY 0.005 USDC on Solana to 6nWr…MWzK. From 0.005 USDC. Fee 0.000010001 SOL. APPROVEPAYMENT-SIGNATURE, and the merchant's facilitator (named in the 402's feePayer) settles.$ bursar pay "https://citable.run/v1/keyword-suggest?seed=solana&limit=3"
402 payTo: 6nWrWRTqrqpqbu5MsMW8mPDpZjKLwPb9Wf8BdMwNMWzK
402 amount: 5000
402 network: solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp
402 feePayer: CjNFTjvBhbJJd2B5ePPMHRLx1ELZpa8dwQgGL727eKww (named by the merchant)
tool call: sol x402 check @tx @to @mint 5000 6
computed in-weights: ok
794 ms firmware check (emulator)
tool call: sol ui 5000 6
computed in-weights: 0.005
2881 ms live (model, Mac)
tool call: sol fee 2 20000 1
computed in-weights: 10001
3057 ms live (model, Mac)
tool call: sol ui 10001 9
computed in-weights: 0.000010001
4556 ms live (model, Mac)
PAY 0.005 USDC on Solana to 6nWrWRTqrqpqbu5MsMW8mPDpZjKLwPb9Wf8BdMwNMWzK. From 0.005 USDC. Fee 0.000010001 SOL. APPROVE
HTTP 200
https://explorer.solana.com/tx/2MSFP4BiqvhsxmwJUE9S2iqB8k2sZFAV7fK7rPCDKnxbPeSwfkFFQPp7QYuTHDtbiUNuBmT4aXtecxaMuQ3hiCGo
Full transcript: docs/runs/pay-citable.txt.
tool call: sol ata 6nWrWRTqrqpqbu5MsMW8mPDpZjKLwPb9Wf8BdMwNMWzK usdc
computed in-weights: 7uQVdgRUNggcsJSbKA5oCRkiCrxLErUoQxueyV9PM48f
55155 ms live (model, Mac)
It's computed once and cached; pay reads the cached account.
bursar demo --attack N starts a local x402 merchant that tampers with its own 402. Full transcript: docs/runs/attacks.txt.
Attack 1: price inflated 1,000×. The transaction is well formed and matches the inflated 402, so the transaction check alone passes it. The exact amount is 10 USDC, so the limit stops it.
tool call: sol x402 check @tx @to @mint 10000000 6
computed in-weights: ok
1062 ms firmware check (emulator)
tool call: sol ui 10000000 6
computed in-weights: 10
2566 ms live (model, Mac)
PAY 10 USDC on Solana to EeBmvKUq8yJJYawMaZtma8kF4apAkwmgpPVKtf8j73hW. From 10 USDC. Fee 0.000010001 SOL. STOP: amount exceeds the per-payment limit
Attack 2: recipient swapped after the first request.
PAY 0.01 USDC on Solana to 6Dw9wiuYMCYSTNCMjhFWjbNhPa3QiaCLFXSWch9tqn6V. From 0.01 USDC. Fee 0.000010001 SOL. STOP: recipient differs from the known payee
Attack 4: one character of the payee address changed. A person skimming the address would miss it; an exact comparison doesn't.
PAY 0.01 USDC on Solana to 2GipSsuSzrp5rWbWW7FQzpvT3K54iG3ovXwWJPuUyjUQ. From 0.01 USDC. Fee 0.000010001 SOL. STOP: recipient differs from the known payee
Requirements: Node 20+, macOS (for the keychain), and Bursar-9B.
npm install
npm run bursar -- init # create the wallet; key goes to the macOS keychain
npm run bursar -- add citable 6nWrWRTqrqpqbu5MsMW8mPDpZjKLwPb9Wf8BdMwNMWzK
npm run bursar -- pay "https://citable.run/v1/keyword-suggest?seed=solana&limit=3"
npm run bursar -- demo --attack 1 # also 2 and 4
npm test
Fund the wallet with a little USDC and SOL first. Bursar-9B needs its runtime, a decoding loop that runs the computer inside the model on Apple Silicon. That runtime isn't public yet.
Apache-2.0.
chip.safetensors 198 MBsnapshot.safetensors 20 MBQwen/Qwen3.5-9B