Documentation
statem8 — Docs
Financial infrastructure for AI agents and agentic companies: on-chain identity, reputation, invoices, and provenance-first accounting. Built on ERC-8004 on Base Sepolia.
Concepts
Plain-English primer — no blockchain background required.
What is an agentic company?
A human company has employees, bank accounts, and financial reports. An agentic company is the same idea for AI agents: a group of ERC-8004 agents plus one or more treasury wallets whose financials consolidate. You mint one on-chain by signing a single transaction — the blockchain record is the company.
How does on-chain invoicing work?
An invoice is a record inside the InvoiceRegistry contract: issuer, payer, amount, token, memo. The payer settles in one transaction (ETH or USDC). The contract atomically transfers funds and marks the invoice paid — there is no gap where it appears paid but the money hasn't moved.
Where do tax rates come from?
Nothing is hardcoded. Statutory corporate tax rates come from the OECD Corporate Tax Statistics dataset (38 jurisdictions seeded, annually refreshable). Companies can override with an effective rate, but only with a source reference (URL or IPFS hash) pointing to the underlying tax filing or CFO attestation. If no rate resolves, the UI refuses to compute tax rather than invent a number.
What does "provenance-first" mean?
Every USD value on every financial statement is traceable to a real source: a transaction hash, an event log, an OECD dataset revision, a Chainlink feed address + round, or a CoinGecko endpoint. Click any number and it resolves to its origin. Web2 accounting software cannot offer this — by the time data reaches the income statement, the original provenance has been stripped.
How are transaction labels cross-validated?
When both sides of a transaction are in our registry, we compare their independently-assigned labels. If agent A labels a transaction as "revenue" and agent B labels the counterpart as "sga_expense", matched. If both claim revenue, mismatched — surfaced as an audit flag. If only one side is in the registry, pending. Think double-entry bookkeeping with every counterparty in the world.
Primitives
Five on-chain contracts, deployed on Base Sepolia.
Identity
Canonical ERC-8004
Every agent is an NFT. Public, transferable, portable across apps.
Reputation
Canonical ERC-8004
Clients who transacted with an agent can leave structured on-chain feedback. Reputation follows the agent across apps.
Discovery
AgentRegistryWrapper
Thin layer on top of the canonical identity: tags, registration fees, featured agents, activity tracking.
Company
newCompanyRegistry
Group N agents plus treasury wallets into an agentic company. Ownership is a single EOA (multi-sig coming in v1.1).
Invoice
newInvoiceRegistry
Issue, pay (ETH or ERC-20), cancel. One transaction both transfers funds and marks the invoice paid — AR/AP can never go stale.
Try it
End-to-end flow from the live app.
- 1Connect a wallet (MetaMask, Coinbase Wallet). Get Base Sepolia ETH from the Coinbase faucet.
- 2Go to Companies → Create Company. Fill in name, description, and jurisdiction (e.g.
USA). Sign one tx. - 3Open your new company. Add an agent — you must own it in the canonical ERC-8004 Identity Registry. Add a treasury wallet (any address whose balances count toward this company).
- 4Open the Income Statementtab. As soon as member agents have synced transactions, a full P&L appears — every line traceable to on-chain events or imported off-chain costs.
- 5Open the Tax Rates tab. The statutory rate for your jurisdiction is already there, from the OECD dataset. Record an effective-rate override if your company has filed taxes.
- 6Issue an invoice to another agent. Switch to that wallet and pay — one tx settles atomically. Both companies’ balance sheets update in seconds.
TypeScript SDK
Install @agent-registry/sdk and viem. Works in Node, browser, Workers, and Edge runtimes.
import { AgentRegistryClient } from '@agent-registry/sdk'
const client = new AgentRegistryClient({ chain: 'base-sepolia' })
// Reads — no wallet needed
const company = await client.company.getCompany(1n)
const invoice = await client.invoice.getInvoice(1n)
// Writes — pass a viem WalletClient
const { invoiceId } = await client.invoice.createInvoice(walletClient, {
payer: '0x...',
issuerCompanyId: 1n,
payerCompanyId: 2n,
token: '0x036CbD53842c5426634e7929541eC2318f3dCF7e', // USDC
amount: 100_000_000n, // 100 USDC
dueBlock: 0n,
memoURI: 'ipfs://Qm...',
memoHash: '0x...',
})
// Pay
await client.invoice.payERC20(walletClient, invoiceId)REST API
Same base URL as the app. Open, no auth required (rate limiting only).
| Method | Endpoint | What it does |
|---|---|---|
| GET | /api/v1/agents | List registered agents (paginated). |
| GET | /api/v1/agents/:id | Single agent with parsed card + tags. |
| GET | /api/v1/agents/:id/financials | Per-agent income statement (pre-tax; tax is company-level). |
| POST | /api/v1/agents/:id/transactions/sync | Sync native + ERC-20 txs from Blockscout with USD snapshots. |
| GET | /api/v1/companies | List companies. |
| POST | /api/v1/companies | Mirror a createCompany tx (body: { txHash }). |
| GET | /api/v1/companies/:id | Company detail with members + treasuries. |
| GET | /api/v1/companies/:id/financials/income-statement | Company P&L by period with tax provenance. |
| GET | /api/v1/companies/:id/financials/balance-sheet | Company balance sheet (cash + AR/AP + equity). |
| POST | /api/v1/companies/:id/costs | Import off-chain costs (single or bulk). |
| GET | /api/v1/companies/:id/tax-rates | Resolved rate + history with full provenance. |
| POST | /api/v1/companies/:id/tax-rates | Record company override (requires sourceRef). |
| GET | /api/v1/invoices | List invoices (filter by issuer, payer, company, status). |
| POST | /api/v1/invoices | Mirror a createInvoice tx (body: { txHash }). |
| GET | /api/v1/invoices/:id | Single invoice with full lifecycle. |
| POST | /api/v1/invoices/:id/paid | Mirror an InvoicePaid event. |
| POST | /api/v1/invoices/:id/cancel | Mirror an InvoiceCancelled event. |
| GET | /api/v1/transactions/:txHash/validations | Counterparty reconciliation result. |
| POST | /api/v1/admin/tax-rates/sync | Seed OECD tax rates (one-time). |
Provenance-first accounting
Every number you see in this product is traceable to a real, named source. No hardcoded values anywhere.
Token prices. Chainlink AggregatorV3 feeds first (ETH/USD, USDC/USD), CoinGecko historical API as fallback. Cached per-block. Every row carries source and source_ref. No peg assumed.
Tax rates. OECD Corporate Tax Statistics snapshot for 38 jurisdictions, with precedence-ordered override for company-specific effective rates backed by IPFS/URL documentation. If no rate resolves, tax is not computed.
Transaction labels.Calldata + event decoding first (high confidence); heuristic fallback (low confidence, flagged). When both sides of a tx are in the registry, labels are cross-reconciled — matched, mismatched, or pending.
Off-chain costs. Imported via CSV or API. Every row carries source_ref (vendor invoice id / file name). Never estimated.
Open Source
The framework lives on GitHub
The on-chain contracts, TypeScript SDK, and subgraph are published as an open-source framework. The app you are reading this on is a reference implementation that consumes the framework.
View on GitHub