Search projects, hackathons, sponsors and tech

    ← All projects

    toll

    AI agents that autonomously pay for the data they need. Smart and Tidy!

    Demo

    About

    Toll is a working machine-to-machine payment system: an AI agent that autonomously buys live on-chain data, per query, with its own wallet and its own on-chain spending policy. The pain point is real. Agents today cannot pay for things by themselves. The moment an agent needs data — a price feed, a lending market snapshot, any API — a human has to step in with API keys, subscriptions, or a credit card. That breaks autonomy completely: no agent can do useful work overnight if it needs a human to approve a two-cent purchase, and the subscription model forces users to hand merchants their email, card, and signup just to let an agent read data. Toll replaces all of that with pay-per-request: the agent sees a price, checks its own rules, pays, and moves on. No accounts, no keys, no checkout, no human in the loop. How it works: you give the agent a task in plain English. An LLM planner (any OpenAI-compatible model — we use Groq) reasons about what data it needs and picks from a catalog of six purchasable datasets: snapshot, history, deep-dive, price, risk-scan, and whale-watch, all live Aave V3 and Uniswap V3 data served through The Graph. Each dataset has a fixed price in tinybar. A deterministic x402 client signs and settles each purchase in HBAR on Hedera testnet via the Blocky402 facilitator, so every query emits a public HashScan receipt. The server answers HTTP 402 with a quote, verifies and settles, then returns the data. The planner buys incrementally — snapshot first, then deeper data only if needed — and stops when it has enough or when its budget runs out. Chatting with the model is always free; only chain data costs money, and policy refusals settle nothing. The standout piece is identity as authority. The agent owns an ENSv2 name on Sepolia (toll-agent-chad.eth), and that name IS its spending policy: dailyCap, maxPerRequest, allowedTools, and riskTier live as resolver text records, read live at every payment and enforced before any money moves. Tightening a cap is a Sepolia transaction — governance is on-chain, auditable by anyone on Etherscan, no restart required. The demo's best moment is the agent getting cut off mid-task because its own on-chain rules said stop. We wrote zero smart contracts ourselves; the resolver is ENS's audited code and we rent one instance of it — borrowing trust infrastructure instead of inventing it. The whole system is modular: the catalog, the model, the caps, and the subgraphs are all configurable, so anyone can point the same agent at their own resource server and it will research for them, paying its own way. Toll is our bet on the machine-to-machine economy: agents that pay for their own data, servers that get paid without ever holding user credentials, and policies that live on-chain where everyone can verify them.

    How it's made

    Two TypeScript packages, no build step (tsx), tested with vitest (43 tests), typechecked with tsc. The resource server is Express plus @x402/express and @x402/hedera on the server side: it quotes a fixed per-dataset price in tinybar, answers HTTP 402, and settles through an HTTPFacilitatorClient pointed at the Blocky402 testnet facilitator (we verified its routes carry no /v1 suffix). The agent is a TUI over a Groq-hosted LLM planner that outputs strict JSON actions; a separate deterministic buyer built on @x402/fetch wraps fetch with payment from config and signs with the payer's Hedera ECDSA key, so the LLM never touches money. A catalog file is the single source of truth for tools and prices on the agent side, mirroring the server's pricing schedule — any drift between them breaks the demo, so tests assert they match. Partner tech Hedera testnet carries every payment as a real HBAR transfer under the x402 exact scheme, which gave us per-query machine-to-machine settlement with receipts we open on HashScan during the demo — and notably the facilitator sponsors the submission fee, so our pitch ("you pay for data, never for gas") is literally visible in each transaction's transfer list. The Graph is the product's entire information layer: we query the canonical Aave V3 and Uniswap V3 subgraphs through the gateway, including the standard derivedETH-times-bundle trick for USD prices and ray-to-percent conversions for APY, so every number the agent reasons over is live indexed data, not a mock. ENSv2 on Sepolia is our authority plane: the agent's name holds its spending policy as resolver text records, read live through viem (getEnsAddress plus raw text-record reads against the node hash) and enforced in server middleware before settlement — identity, budget, and allowlist in one on-chain lookup. Hacky bits! HBAR isn't in the x402-hedera SDK's default asset table (USDC only), so we hand-registered the exact scheme for asset 0.0.0 on both client and server. The Sepolia payer key that funds policy writes and the Hedera-derived identity address the name points to are different wallets, which confused us for a day — the name's address never signs anything. Day-spend accounting is an in-memory ledger, fine for a demo, and the first version of our planner happily burned the whole daily budget buying redundant datasets, so we encoded price-first routing and anti-overbuy rules directly into its prompt. The TUI is Ink/React with a raw proof-log pane beside it, because we wanted judges to see formatted answers and unformatted receipts simultaneously.