🔒 Private checkout for the metered agent economy.
WhisperAPI lets AI agents pay for APIs and machine services on Solana without exposing provider choice, spend, or payment cadence on public rails. It uses MagicBlock Private Payments as the actual payment rail and wraps the flow in an x402-compatible 402 -> pay -> retry pattern.
The repo now supports both:
- a judge-friendly server-signed demo path
- a buyer-signed wallet path where the buyer key never leaves the client
Public machine payments leak too much:
- which provider an agent uses
- how much it pays
- how often it pays
That turns payments into competitive intelligence.
WhisperAPI fixes that by moving settlement through MagicBlock private payments while keeping the request flow legible for developers and judges.
WhisperAPI is:
- agentic commerce infrastructure
- a private payments project
- an x402-compatible payment wrapper for paid APIs
WhisperAPI is not:
- a private wallet
- a neobank
- a consumer payments app
flowchart LR
A[Agent / Client] -->|GET paid endpoint| B[WhisperAPI Server]
B -->|402 Payment Required| A
A -->|retry via Whisper checkout| B
B -->|build deposit| C[MagicBlock Private Payments API]
C -->|unsigned tx| B
B -->|sign + submit| D[Solana Base]
B -->|build private transfer| C
C -->|unsigned tx| B
B -->|sign + submit| E[MagicBlock PER]
E -->|private balance| F[Provider]
B -->|optional withdraw| C
C -->|unsigned tx| B
B -->|sign + submit| D
B -->|single-use receipt accepted| G[Live API Provider]
G -->|paid response| B
B -->|response| A
- An agent calls a paid endpoint.
- The endpoint returns
402 Payment Required. - The agent calls
POST /api/x402/payto mint a fresh private receipt. - WhisperAPI opens a private payment session.
- Buyer funds are deposited into MagicBlock private payments.
- A private transfer settles to the provider.
- The provider can withdraw back to Solana base balance.
- The agent retries the original request with a single-use receipt.
- The paid API response is returned.
npm install
npm startOpen:
- landing page:
http://localhost:3000 - live demo console:
http://localhost:3000/dashboard.html
With live devnet config:
npm run check:devnetThe dashboard includes a dedicated judge pass at http://localhost:3000/dashboard.html:
Run judge demoselects the strongest endpoint and executes the full private path- the checklist confirms
health,readiness, anddeposit -> private-transfer -> withdraw Copy proof summaryexports the receipt token and live transaction signatures for narration or submission notesRun client-signed flowuses a connected Solana wallet to sign the buyer-side payment steps locally
If WHISPER_ADMIN_TOKEN is set on a shared deployment, the dashboard now degrades cleanly and tells the reviewer why trace panels are protected instead of failing silently.
The verified devnet configuration is documented in docs/WORKING_MAGICBLOCK_CONFIG.md.
Core setup:
WHISPER_PAYMENT_MODE=magicblock-live
MAGICBLOCK_API_BASE=https://payments.magicblock.app
MAGICBLOCK_CLUSTER=devnet
MAGICBLOCK_EPHEMERAL_RPC_URL=https://devnet.magicblock.app
MAGICBLOCK_VALIDATOR=MTEWGuqxUpYZGFJQcp8tLN7x5v9BSeoFHYWQQ3n3xzo
MAGICBLOCK_MINT=4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU
SOLANA_RPC_URL=https://api.devnet.solana.com
WHISPER_SIGNER_SECRET=<buyer-secret>
WHISPER_PROVIDER_DESTINATION=<provider-pubkey>
WHISPER_PROVIDER_SECRET=<provider-secret>
WHISPER_PROVIDER_WITHDRAW=trueEnvironment template: .env.example
Routes:
GET /api/catalogGET /api/x402/supportedGET /api/integration/statusGET /api/statePOST /api/resetPOST /api/x402/payPOST /api/x402/pay/preparePOST /api/x402/pay/completePOST /api/demo/publicPOST /api/demo/privateGET /api/live/weatherGET /api/live/priceGET /vendor/solana-web3.iife.min.js
x402-compatible headers:
- request:
X-Payment,X-Payment-Receipt - response:
X-Payment-Response
Real x402-compatible path:
GET /api/live/...->402 Payment RequiredPOST /api/x402/pay-> fresh single-usereceiptTokenGET /api/live/...withX-Payment-Receipt->200 OK
No-custody wallet path:
POST /api/x402/pay/prepare-> unsigned buyer transactions- buyer wallet signs locally
POST /api/x402/pay/complete-> WhisperAPI submits the signed payment steps and mints a receiptGET /api/live/...withX-Payment-Receipt->200 OK
Judge/demo shortcut:
POST /api/demo/privateruns the whole402 -> pay -> retryloop for one-click demos
Verified on devnet on 2026-04-24:
- MagicBlock health checks
- mint initialization checks
- buyer base balance reads
- buyer private balance reads
- provider private balance reads
- live
deposit - live private
transfer - live provider
withdraw - real
POST /api/x402/payreceipt issuance - first receipt redeem succeeds
- replayed receipt is rejected with
402 - client-signed
prepare -> sign locally -> complete -> redeemflow works - paid response unlock after payment
- persisted receipts and sessions across restarts
- externalized dashboard runtime via
public/app.js
The demo currently uses live upstream data:
- weather via Open-Meteo
- price via CoinGecko
This keeps the product understandable in a hackathon setting while still proving a real private payment path.
whisperapi/
docs/
COLOSSEUM_SUBMISSION_README.md
DEMO_SCRIPT_3MIN.md
DEVNET_SETUP_CHECKLIST.md
WORKING_MAGICBLOCK_CONFIG.md
pitch-deck.html
REVIEW.md
public/
index.html
dashboard.html
styles.css
app.js
scripts/
check-devnet.js
src/
agent-demo.js
app-state.js
env-loader.js
paid-apis.js
payment-adapters.js
state-store.js
whisper-engine.js
.env.example
.gitignore
package.json
server.js
- Colosseum submission README
- 3-minute demo script
- Devnet setup checklist
- Working MagicBlock config
- Pitch deck
- Review notes
This repo is hackathon-ready, not mainnet-ready.
Known production gaps:
- server-signed demo mode still exists for the one-click judge path
- the preferred no-custody path is
prepare -> client sign -> complete - there is no delegated session-key policy engine yet, so wallet users still sign each prepared checkout flow
- admin/debug routes should be protected with
WHISPER_ADMIN_TOKENon shared deployments - state persistence is local, not a multi-user production datastore
For the MagicBlock Frontier track, WhisperAPI fits best as:
Agentic commerce / x402 APIsPrivate paymentsPrivacy-first infrastructure
- MagicBlock private payments template: https://docs.magicblock.gg/pages/templates/private-payments
- MagicBlock Private Payments API intro: https://docs.magicblock.gg/pages/private-ephemeral-rollups-pers/api-reference/per/introduction
- Solana x402 overview: https://solana.com/x402