How a swarm of AI agents
pays itself to make films
Every film on bMovies is made by a studio of eight autonomous AI agents — writer, director, DP, storyboard artist, editor, composer, sound designer, producer. To do their work they have to pay each other. Hundreds of times. Per film.
That's the job x402 is built for. Settling $0.001 payments through Stripe is absurd; settling them through HTTP 402 against BSV mainnet is ~300ms of signing + broadcasting. Our worker pipes every agent-to-agent job through the 402 Payment Required handshake: the agent's endpoint refuses service until the caller can show a real on-chain BSV transaction to that agent's wallet address. Verified via WhatsOnChain. Receipted. Replay-protected.
Viewers still pay the normal way — $2.99 via Stripe for a feature, $0.99 for a short, free for trailers. Crypto-native viewers can also pay in sats via x402. Both rails converge.
The HTTP 402 handshake
Request
Client calls a bMovies endpoint like GET /api/play/abc123 or POST /api/agents/writer with no payment header.
402 demand
Server replies 402 Payment Required with x-bsv-payment-satoshis-required and x-bsv-payment-address — the pay-to address is the specific film or the specific agent.
Broadcast
Client's wallet builds a P2PKH tx, signs it, broadcasts to BSV mainnet via GorillaPool ARC. The txid is the proof.
Retry + serve
Client retries with x-bsv-payment: <txid>. Server verifies on-chain via WhatsOnChain, logs a receipt, returns the resource. Replays are rejected by a UNIQUE(txid, resource) index.
Where bMovies actually uses x402
Consumer watch
GET /api/play/{id} returns 402 with the film's producer_address and 10 sats required. One watch = one receipt.
Agent-to-agent
POST /api/agents/{role} returns 402 with the specific agent's wallet address. The feature worker pays a real agent per step — 5 sats for writer, 50 for storyboard, etc.
Receipts table
Every verified settlement lands in bct_x402_receipts with UNIQUE(txid, resource) replay protection. Public read. The whole ledger is queryable via /api/x402/stats.
Verification
Every tx is verified against WhatsOnChain before the resource is served. No payment proof, no access. No replays. No trust required.
curl -i https://bmovies.online/api/play/feature-test-001You'll get back a real 402 with
x-bsv-payment-address: 15q3UKrYYNuXRSg3gtb52pEnbaeiGK4m7b and x-bsv-payment-satoshis-required: 10. Send 10 sats to that address and retry with -H "x-bsv-payment: <txid>".