An x402-compatible HTTP payment protocol that lets autonomous AI agents pay for APIs with private, sub-second settlements on Solana.
Built on MagicBlock Private Ephemeral Rollups (Intel TDX TEE) β amounts and intent stay encrypted, settlements stay verifiable.
π Live Dashboard β Β· πΊ Demo Video Β· π Solana Explorer
Autonomous AI agents now spend real money on APIs β oracles, LLMs, data feeds. Every payment they make on a public chain leaks:
- π΅οΈ Counterparties (which seller, which buyer)
- πΈ Amounts (exact pricing & spend velocity)
- π― Intent (which API endpoint, what data)
Competitors, MEV bots, and indexers can reverse-engineer your agent's strategy from the chain. Privacy is the unsolved primitive blocking real agentic commerce.
Ohlarr is x402 + Private Ephemeral Rollups stitched together as a drop-in middleware:
// Seller side β 1 line.
app.use(ohlarr({ programId, sellerPubkey, per, price: 1000n }));
// Buyer agent β 1 line.
const data = await client.fetch('https://api.example.com/v1/oracle/BTC-USD');The seller's HTTP API returns HTTP 402 Payment Required with an Ohlarr challenge. The buyer agent signs a settlement transaction inside MagicBlock's PER (running on Intel TDX), retries with X-PAYMENT, and gets the data β all in one round-trip, sub-second.
The base Solana chain sees only opaque commits. Permission-key holders see everything.
Visit ohlarr.com/dashboard:
| ποΈβπ¨οΈ Public Solana Observer | π Authorized Ohlarr View |
|---|---|
| Real tx signatures, instruction names, PER commit hashes | Same events, but decrypted: buyer β seller, API path, lamports |
from: ββββββββ amount: ββββββ lamports |
from: AWXy...yRct β 867u...BdzW 4,449 lamports |
Two buttons that prove it's real:
- π€ Watch AI Agent Buy β runs a full x402 flow on devnet (HTTP 402 β sign β settle β 200 with BTC price). Modal shows the live HTTP transcript with explorer links.
- β‘ Run Real Tx β executes a fresh deposit + settle on Solana devnet, shows up in the LIVE stream.
Every transaction is verifiable on Solana Explorer.
βββββββββββββββββββββββββββββββ
β AI Agent (LangChain/MCP) β
ββββββββββββββββ¬βββββββββββββββ
β HTTP request
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββ
β Seller API (any HTTP server) + ohlarr SDK β
ββββββββββββββ¬βββββββββββββββββββββββββββββββββ
β 402 Payment Required
β + X402Challenge
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββ
β Buyer signs Settle ix on Solana devnet PER β
β βΈ MagicBlock Private Ephemeral Rollup β
β βΈ Intel TDX TEE @ devnet-tee.magicblock.app β
β βΈ Permission Program: ACLseo...XQnp1 β
ββββββββββββββ¬βββββββββββββββββββββββββββββββββ
β X-PAYMENT: <receipt>
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββ
β Seller verifies β returns paid resource β
βββββββββββββββββββββββββββββββββββββββββββββββ
On-chain: opaque PER commit hash (everyone)
Off-chain (TEE): full plaintext state (Permission members only)
| Layer | Tech |
|---|---|
| Smart contract | Anchor 0.31.1 (programs/ohlarr_payments) β escrow vaults, payment channels, nonce-monotonic settlement |
| Privacy runtime | MagicBlock Private Ephemeral Rollup on Intel TDX TEE |
| Permissions | MagicBlock Permission Program (ACLseoPoyC3cBqoUtkbjZ4aDrkurZW86v19pXz2XQnp1) |
| Wire protocol | Coinbase x402 β HTTP 402 Payment Required |
| SDK | TypeScript (@ohlarr/sdk) β OhlarrClient, ohlarrMiddleware, PerSession |
| Hash | BLAKE3 canonical request hashing |
| Frontend | Next.js 14, Tailwind, framer-motion |
| Deploy | GitHub Actions β Solana devnet, Vercel for web |
ohlarr/
βββ programs/ohlarr_payments/ # Anchor program (Rust)
βββ packages/sdk/ # @ohlarr/sdk TypeScript SDK
βββ apps/web/ # Next.js 14 dashboard (ohlarr.com)
β βββ app/
β β βββ page.tsx # Landing + live stats banner
β β βββ dashboard/page.tsx # Dual-view privacy demo
β β βββ api/
β β βββ x402/oracle/btc-usd/ # Live x402 endpoint
β β βββ agent-buy/ # AI agent demo flow
β β βββ demo/ # Real devnet tx trigger
β β βββ stats/ # Live program stats
β βββ hooks/use-program-events.ts # Real on-chain event hook
β βββ lib/solana.ts # Devnet connection, PDAs, parsers
βββ apps/seller-demo/ # Express seller using middleware
βββ apps/buyer-agent/ # Node agent using OhlarrClient
βββ .github/workflows/ # Auto-deploy to devnet
Just visit ohlarr.com. The program is already deployed:
- Program ID:
CmHUW6WAUcobsYCHpK2cSgjcYU5KqbW8MDXunK5SzdLA - Network: Solana devnet
- PER endpoint:
devnet-tee.magicblock.app
Click "Watch AI Agent Buy" to see a real agent perform an end-to-end x402 purchase on devnet. The modal shows the full HTTP/chain transcript with verifiable links.
# Without payment β 402
curl -i https://ohlarr.com/api/x402/oracle/btc-usd
# Response:
# HTTP/2 402
# WWW-Authenticate: OhlarrX402
# {
# "scheme": "ohlarr-x402-v1",
# "network": "solana-devnet",
# "amount": { "lamports": 1000 },
# "payTo": "CmHUW6WAUcobsYCHpK2cSgjcYU5KqbW8MDXunK5SzdLA",
# ...
# }git clone https://github.com/thesithunyein/ohlarr
cd ohlarr
pnpm install
pnpm --filter @ohlarr/web dev
# β http://localhost:3000The repo ships with a GitHub Action that deploys to devnet on push:
# Set the DEPLOYER_KEYPAIR secret in your repo, then:
gh workflow run deploy-devnet.yml3-min demo: Problem β Solution β Live demo β Tech stack
πΊ Watch on YouTube β (coming soon)
Built for the Superteam Earn / Colosseum Hackathon Privacy Track sponsored by MagicBlock, Superteam MY, and SNS.
This project addresses the bounty's core thesis directly:
| Bounty Criterion | Ohlarr |
|---|---|
| Effective use of PER / Private Payments API | Settlements run inside the PER on Intel TDX TEE; uses ephemeral_rollups_sdk macros (#[ephemeral], #[delegate], #[commit]) |
| Working demo | Live at ohlarr.com β real devnet program + real settlements + real x402 endpoint |
| Quality of architecture | Clean separation: program / SDK / middleware / agent β drop-in for any Express/Next.js app |
| Real-world problem | Agents leak strategy via on-chain payment metadata. We fix that. |
| Novel UX | Side-by-side dual-view dashboard makes privacy visceral |
| Standards-compliant | x402 spec verbatim β works with LangChain, CrewAI, MCP out of the box |
- The base Solana chain only ever sees opaque PER state commitments β no plaintext amounts, identities, or API paths.
- Settlements are nonce-monotonic and balance-checked inside the program; replay-resistant.
- Request hashes use canonical JSON + BLAKE3 to prevent malleability.
- The TEE attestation chain is rooted in Intel SGX/TDX β see MagicBlock docs for the trust model.
- Demo keypairs in
.env.local.exampleare devnet-only and rotated regularly.
MIT β see LICENSE.
Built with π by @thesithunyein Β· Owns ohlarr.com