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.

0x8004A818BFB912233c491871b3d84c89A494BD9e

Reputation

Canonical ERC-8004

Clients who transacted with an agent can leave structured on-chain feedback. Reputation follows the agent across apps.

0x8004B663056A597Dffe9eCcC1965A193B7388713

Discovery

AgentRegistryWrapper

Thin layer on top of the canonical identity: tags, registration fees, featured agents, activity tracking.

0xC02DE01B0ecBcE17c4E71fc7A0Ad86764B3DF64C

Company

new

CompanyRegistry

Group N agents plus treasury wallets into an agentic company. Ownership is a single EOA (multi-sig coming in v1.1).

0x7b1598Ee7303A9EF733d2de92Ff81d555dcAb4A8

Invoice

new

InvoiceRegistry

Issue, pay (ETH or ERC-20), cancel. One transaction both transfers funds and marks the invoice paid — AR/AP can never go stale.

0x645acDD5f85B52AD0CcE55B1c4f4Ac8BA00EC0Ac

Try it

End-to-end flow from the live app.

  1. 1Connect a wallet (MetaMask, Coinbase Wallet). Get Base Sepolia ETH from the Coinbase faucet.
  2. 2Go to Companies → Create Company. Fill in name, description, and jurisdiction (e.g. USA). Sign one tx.
  3. 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).
  4. 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.
  5. 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.
  6. 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.

sdk.ts
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).

MethodEndpointWhat it does
GET/api/v1/agentsList registered agents (paginated).
GET/api/v1/agents/:idSingle agent with parsed card + tags.
GET/api/v1/agents/:id/financialsPer-agent income statement (pre-tax; tax is company-level).
POST/api/v1/agents/:id/transactions/syncSync native + ERC-20 txs from Blockscout with USD snapshots.
GET/api/v1/companiesList companies.
POST/api/v1/companiesMirror a createCompany tx (body: { txHash }).
GET/api/v1/companies/:idCompany detail with members + treasuries.
GET/api/v1/companies/:id/financials/income-statementCompany P&L by period with tax provenance.
GET/api/v1/companies/:id/financials/balance-sheetCompany balance sheet (cash + AR/AP + equity).
POST/api/v1/companies/:id/costsImport off-chain costs (single or bulk).
GET/api/v1/companies/:id/tax-ratesResolved rate + history with full provenance.
POST/api/v1/companies/:id/tax-ratesRecord company override (requires sourceRef).
GET/api/v1/invoicesList invoices (filter by issuer, payer, company, status).
POST/api/v1/invoicesMirror a createInvoice tx (body: { txHash }).
GET/api/v1/invoices/:idSingle invoice with full lifecycle.
POST/api/v1/invoices/:id/paidMirror an InvoicePaid event.
POST/api/v1/invoices/:id/cancelMirror an InvoiceCancelled event.
GET/api/v1/transactions/:txHash/validationsCounterparty reconciliation result.
POST/api/v1/admin/tax-rates/syncSeed 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