An AI treasurer your
contract keeps in check.
Ghost Store reads a merchant's books privately inside a TEE and drafts vendor payouts and yield moves. The treasury contract verifies every draft's TEE signature, and only small, policy-bound payouts run without a human.
- M-of-N
- signer approvals
- 1 veto
- stops autonomy
- 0 bytes
- of books on chain
Payout 40 USDT
→ packaging.treasury-dev.testnet
Bill PKG-2291 due Nov 12, within the 14-day window.
Illustration of the treasury view
Private by construction
Sales, customers and bills go only to a model running inside NEAR AI Cloud's TEE. Only a hash reaches the chain.
Verified on chain
The treasury contract recovers the TEE's signature and parses proposals from the signed output. No badge to trust.
Bounded by policy
Allowlisted vendors, per-payout and daily caps, a veto window and a reserve floor. Everything else needs M-of-N.
How it works
Trust moves from the interface into the contract.
A TEE signature proves which model wrote a proposal, not that it is a good idea. So it buys the AI a small, capped amount of autonomy, nothing more.
- 01
Private inference
The agent sends the books and on-chain state to an attested model. A schema limits payees to known vendors.
- 02
Signed output
The TEE signs the model name and the request and response hashes with a key bound to its Intel TDX quote.
- 03
On-chain verification
propose_attested recomputes the hash, runs ecrecover, rejects replays and stale or tampered responses.
- 04
Bounded execution
Small payouts to trusted vendors run after a veto window. Larger or new ones wait for signers.
Routine bills pay themselves
- TEE-signed payout to an allowlisted vendor
- Within the per-payout limit and today's cap
- Executes after the veto window, by anyone
- Reserve floor checked against the live balance
Everything else needs people
- New payees and amounts above the limits
- Yield allocations and withdrawals
- Governance: signers, policy, trusted model keys
- Any one signer can pause autonomy instantly
Agent-to-agent invoices
Vendor agents bill. Your AI checks. The contract pays.
Any vendor, or its agent, submits an invoice on chain. Inside the TEE the AI matches it against the private books and proposes payment by invoice id, never by payee, so a manipulated prompt can't redirect funds. Fake and duplicate invoices are simply never paid.
- Every invoice is an NFT (NEP-171). Whoever holds it gets paid.
- Vendors sell unpaid invoices for early cash, atomically on chain.
- Autonomous payment only for allowlisted issuers, within the caps.
packaging.testnet submits PKG-2291
40 USDT · NFT #3 minted to the vendor
Vendor lists it for 39.20 USDT
A buyer pays now; 0.5% sale fee to the operator
AI matches it to the books
PayInvoice #3, TEE-signed, checked on chain
Veto window passes
Treasury pays 40 USDT to the current holder
For agent builders
A wallet your agent can't empty.
Any agent that pays for APIs, compute or suppliers needs spending power without a blank cheque. Point it at a Ghost Store treasury: decisions are verified on chain, spending is capped, and humans keep a veto.
- Provenance
- TEE signature checked by the contract
- Limits
- Per-payout, daily cap, allowlist
- Oversight
- Veto window, one-signer pause
- Accountability
- Invoice-backed, replay-proof
// 1. Private inference inside NEAR AI's TEE
const res = await fetch(`${NEAR_AI}/chat/completions`, { body });
const sig = await getSignature(res.id); // TEE-held ECDSA key
// 2. The contract verifies and parses the signed output
await treasury.propose_attested({
model, request_hash, // books stay off chain
response: base64(responseBytes),
signature: sig.signature,
});
// 3. Within limits: executes after the veto window
await treasury.execute_auto({ id });How it earns
Invoice sale fee
A governance-set fee (up to 10%) on every invoice sold early, enforced by the contract.
Checkout settlement
A small fee on payments settled to the treasury through NEAR Intents.
Agent treasuries
Hosted treasuries for agent builders: policy templates, keeper and monitoring.
Product
See the proposals the AI drafted today.
Live on NEAR testnet. Connect a signer wallet to approve or veto.