Prototype v1 · Open Source
Fivefield

Fivefield Protocol

An open protocol for delegated purchases. By Kurt Traxl and Michael Brinkmann.

01 — The Problem

Who is liable when the agent orders wrong?

AI agents purchase on behalf of humans. But who is liable when the agent orders wrong? Who checks the budget? Who stops a manipulated order? Today there is no standard for this.

⚖

Unclear Liability

No protocol defines who is responsible when an agent makes erroneous transactions.

🔒

No Budget Guard

Agents can act beyond the authorized budget — no check before the charge.

🎭

Prompt Injection Risk

A manipulated merchant can lure the agent into unauthorized purchases.

0
Tests Passing
0
On-Chain Attack Tests
0
Liability Standards Today
02 — The Solution

A signed mandate — before every transaction.

👤
Principal
signs
📝
Mandate
authorizes
🤖
Agent acts
checks
🔍
Verifier
releases
💳
Payment Rail

A signed mandate defines exactly what the agent may do: what (categories), where (merchants), how much (per-order and total limit), until when (validity), which agent (agent key). Before every charge, a verifier checks automatically — no transaction without valid authorization.

Two approvals, one rule
1

Approval 1 — once per task

The user signs the five fields on a surface the agent does not control — banking app, card app, EUDI wallet, crypto wallet, or OS passkey (our approval page is a placeholder). The agent proposes the fields; only the user can sign them.

2

Approval 2 — on every order

Whoever releases the payment (PSP, issuer, large merchant, or the on-chain program) runs five comparisons: signature valid (includes agent key match), merchant allowed, category allowed, amount within limit, not expired. Deterministic, no LLM.

§

Why this is PSD2, not a new rule

A consumer is liable only for payments approved via strong customer authentication, bound to a payee and an amount. Merchant list = payee, amount limits = amount, passkey signature = SCA. Precedent: UK Open Banking Variable Recurring Payments.

The agent controls what is bought inside the five fields, and nothing else.

Liability Model
Situation Decision Liability
Mandate signature invalid REJECT None (never charge)
Agent not authorized / Attestation invalid / Replay REJECT Agent provider
Order outside constraints (budget, merchant, category) REJECT Agent provider
Order within constraints APPROVE Principal (normal purchase)
Goods wrong, faulty or not delivered — Merchant, consumer law unchanged
03 — Architecture

Three layers. One verifier.

From SDK to blockchain — the same verifier runs everywhere.

SDK

TypeScript SDK

Create, sign, verify mandates. Pure functions, no I/O. Runs in Node.js, Deno, browser and edge workers.

107 Tests
✓ Pure Functions
On-Chain

Solana / Anchor Program

Escrow, Ed25519 introspection, reputation tracking. PDA-based; upgrade authority to be burned after security audit.

13 Attack tests
✓ Passed
Rail-Adapter

Payment Rail Adapter

Card via issuer/PSP (mandate in Verifiable Intent). SEPA / Wero Request-to-Pay (planned). x402 (HTTP-native). Google AP2. Mastercard VI. Visa TAP (planned). Same verifier, every rail.

3 Adapters Built · 107 Tests Passing
✓ x402 · AP2 · VI built
04 — Security

20 on-chain tests, 8 of them attack scenarios.

🔑

Ed25519 Signatures

Principal, agent and merchant sign cryptographically. Forgery computationally infeasible.

🛡

Instruction Introspection

On-chain CPI attacks blocked. The verifier checks the signature directly in the Ed25519 precompile.

♻

Replay Protection

Attestation hash prevents replay of intercepted transactions.

🔒

Prompt as Hash

No plaintext on chain or at the merchant. Only a SHA-256 hash as evidence.

💸

Budget Tracking

Cumulative budget across multiple orders. On-chain state, tamper-proof.

⏱

Time Window Enforcement

Mandates expire. No transaction possible outside the signed time window.

05 — Privacy

Why not send the prompt?

✗ Naive Approach

The prompt contains personal intentions, preferences and context; sending it to the merchant or the blockchain would expose purchase behaviour permanently. And a sentence is not a rule: constraints can be checked deterministically, a prompt cannot.

"Buy me coffee, I prefer roast X,
max budget €30, I drink it daily..."
✓ Fivefield Approach

Only a SHA-256 hash of the prompt is transmitted — as cryptographic evidence for disputes. The verifier checks constraints, not intentions. Privacy by design.

traceHash: "a3f7c2e1b8d4f6a9e2c5..." (in attestation)
06 — Try the Verifier

Interactive Prototype

Click one of the commands to test the verifier live.

mandate.json Valid
{
  "version":    "1",
  "mandateId": "mnd_7f3a9c2b",
  "principal": {
    "scheme": "ed25519",
    "pubkey": "4mXp...kR9z"
  },
  "agent": {
    "scheme": "ed25519",
    "pubkey": "9nQr...mL2w"
  },
  "constraints": {
    "merchants":   ["merchant.kaffeeshop.at"],
    "categories":  ["food_beverage", "grocery"],
    "maxTotal":    5000,
    "currency":    "EUR",
    "maxOrders":   3
  },
  "validFrom":  1729382400,
  "validUntil": 1729987199,
  "nonce":      "a3f7c2e1b8d4",
  "signature":  "7xKm...4pNq"
}
order.json — Order Pending
{
  "orderId":     "ord_3a8f1c",
  "mandateId":   "mnd_7f3a9c2b",
  "merchant":    "merchant.kaffeeshop.at",
  "category":    "food_beverage",
  "amount":      1850,
  "currency":    "EUR",
  "items": [{
    "name":  "Kaffee Speciality 250g",
    "qty":   1,
    "price": 1850
  }],
  "totalSpent":  0,
  "timestamp":   1729424520,
  "attestation": "3zRt...8kWx"
}
$ verifier.verify
Waiting for verifier input...
Select a test mode above.
07 — Technical Details

Specification & Implementation

Mandate Schema
JSON Schema 2020-12
Canonical JSON
Keys recursively sorted, no whitespace, safe integers
Verifier
Pure function, no I/O, 18 violation codes
On-Chain
Anchor 0.30.1, Ed25519 Precompile, PDA-basiert
Signature Algorithm
Ed25519 (PKCS#8 + raw)
Test Coverage
107 tests (50 SDK · 7 x402 · 10 AP2 · 12 VI · 3 approve · 9 verifier · 6 shop · 4 E2E) · 20 on-chain tests, 8 of them attack scenarios
Prompt Hashing
SHA-256 (normalized UTF-8)
Payment Rails
Card via issuer/PSP (mandate in Verifiable Intent) · SEPA / Wero Request-to-Pay (planned) · x402 · Google AP2 · Mastercard VI · Visa TAP (planned)
Mandate Constraint Object
mandate.schema.json
"constraints": {
  "type":     "object",
  "required": ["currency", "maxTotal"],
  "properties": {
    "merchants":  { "type": "array",  "items": { "type": "string" } },
    "categories": { "type": "array",  "items": { "type": "string" } },
    "maxTotal":      {
      "type":        "integer",
      "minimum":     0,
      "description": "Max cumulative spend in minor units (cents)"
    },
    "currency":         { "type": "string",  "pattern": "^[A-Z]{3}$" },
    "maxOrders":  { "type": "integer", "minimum": 1 }
  }
}
08 — Pilot

Looking for one issuer, acquirer or PSP.

Eight weeks. Weeks 1–2: mandate signing in your app sandbox. Weeks 3–6: verifier in shadow mode next to your authorization, every agent transaction gets a verdict, nothing is declined. Weeks 7–8: measure out-of-scope rate, false declines, dispute time. Fivefield delivers integration, attack scenarios and reporting. The protocol stays open.