Hestr overview
Hestr is the spending control layer for AI agents on Robinhood Chain. An owner creates an onchain mandate for an agent address: a payment token, a per-transaction limit, UTC daily and monthly budgets, approved recipients, permitted service IDs, an approval threshold and an expiry. The agent requests payments within that mandate; the HestrMandates contract checks every rule and reserves the amount in escrow; a provider delivers and records a receipt hash; the owner accepts, disputes, or lets the challenge period run; the contract settles or refunds.
Enforcement lives in the contract. The console, the API, the SDK and the MCP tools can explain, queue and relay, but none of them can move funds outside a mandate's rules.
What is in the repository
| Path | What it is |
|---|---|
apps/web |
Next.js app: landing page, console (/app/*), HTTP API (/api/*), docs (/docs) |
packages/contracts |
Foundry project: HestrMandates.sol, MockUSD.sol (local only), tests, deploy script, deployment manifests |
packages/protocol |
Shared TypeScript: chain config, generated ABI, EIP-712 types, the policy evaluator, state machine, Hestr escrow HTTP scheme |
packages/db |
Drizzle schema, SQL migrations, database client (PostgreSQL or PGlite) |
packages/sdk |
Agent SDK (HestrClient) and the hestr-agent CLI |
packages/mcp |
MCP server exposing the SDK as tools |
services/indexer |
Durable event indexer (confirmations, checkpoints, reorg handling, replayable projections) |
examples/provider |
Example paid service (deterministic text transformation) using the hestr-escrow/1 exchange |
scripts |
Local chain, deployment, dev database, dev stack, end-to-end tests |
Operating modes
| Mode | When | Behaviour |
|---|---|---|
| Local development | HESTR_CHAIN_ID=31337 with a deployed local contract |
Anvil, MockUSD test token, embedded PostgreSQL, example provider, demo agent, relayer. Real contracts, fake money. |
| Configured network | HESTR_CHAIN_ID=4663 (or another verified chain) with HESTR_CONTRACT_ADDRESS and a verified token |
Live reads and writes against that deployment. |
| Unconfigured | No contract address | Setup guidance only; every balance-dependent action is disabled; nothing is fabricated. |
The status bar in the console and GET /api/status always say which mode, chain, contract and index height are in effect.
Roles and keys
- Owner: a wallet. Creates, funds, revokes mandates; approves or rejects above-threshold requests by signing EIP-712 messages; accepts or disputes deliveries. Signs in to the console with Sign-In With Ethereum.
- Agent: a separate key. Signs payment requests (EIP-712) and authenticates to the API. It can never fund, approve, withdraw or change a policy. Never give an agent the owner wallet, a seed phrase, or a key that holds other funds.
- Provider: the service being paid. Receives escrowed settlements and submits delivery receipts from its own key.
- Resolver: an explicitly configured address that decides disputes (full or partial). It has no other power.
- Relayer (optional, server-side): pays gas to submit agent-signed authorizations. Never present in browser code.
What Hestr does not claim
- The contracts are tested, not audited. See Status.
- A delivery receipt hash proves that a delivery was recorded, not that the work was correct.
- Service IDs limit what can be paid for; they do not prove a provider performs that service.
- x402 is not integrated (see x402); the escrow exchange is Hestr's own scheme.
- Public chain data is public. Only application metadata is private.
- There is no affiliation with Robinhood. Robinhood Chain is the target network.