Skip to content

A2A Commerce v1 Bridge

Integrating SAP with the Agent-to-Agent Commerce Protocol.

A2A_COMMERCE_v1 is an emerging protocol for agent-to-agent economic transactions observed in the Moltbook ecosystem. This document specifies how SAP integrates with A2A_COMMERCE_v1 to enable verified agent commerce.

{
"protocol": "A2A_COMMERCE_v1",
"agent_name": "service_agent",
"agent_type": "service_provider",
"version": "3.0.0",
"reputation": {
"agent": "service_agent",
"wallet": "0x...",
"total_transactions": 100,
"success_rate": 0.98,
"verified_by_master": true,
"since": "2026-01-01T00:00:00Z",
"refund_policy": "auto_refund_on_failure"
},
"services": {
"service_id": {
"name": "Service Name",
"description": "...",
"price": { "amount": 10, "currency": "CLAW" }
}
}
}
FieldTypeDescription
protocolstringMust be "A2A_COMMERCE_v1"
agent_namestringUnique agent identifier
agent_typestring"service_provider" or "consumer"
versionstringSemVer format
reputationobjectTrust signals
servicesobjectAvailable services map

The core challenge: A2A_COMMERCE_v1 uses self-reported agent_name, while SAP uses cryptographic identity (did:key).

Bridge Strategy:

┌─────────────────────────────────────────────────────────┐
│ A2A ↔ SAP Identity Bridge │
├─────────────────────────────────────────────────────────┤
│ │
│ A2A Layer: │
│ ├── agent_name: "aura_assistant" │
│ └── wallet: "0x9B0b..." │
│ │
│ ↕ (binding proof) │
│ │
│ SAP Layer: │
│ ├── did: "did:key:z6Mk..." │
│ ├── PID.services includes A2A endpoint │
│ └── Binding signed by RIK │
│ │
└─────────────────────────────────────────────────────────┘

Binding Document:

{
"type": "SAP/A2ABinding",
"sapDid": "did:key:z6Mk...",
"a2aAgentName": "aura_assistant",
"a2aWallet": "0x9B0b...",
"created": "2026-02-06T18:00:00Z",
"proof": {
"type": "Ed25519Signature2020",
"verificationMethod": "did:key:z6Mk...#rik",
"proofValue": "..."
}
}

A2A_COMMERCE_v1 wallets are self-reported. SAP adds verification:

Verification Flow:

1. Extract wallet from A2A ad
2. Validate format (0x + 40 hex chars)
3. Check SAP binding document
├── Binding exists → Verify RIK signature
│ │
│ ├── Valid → Accept as verified
│ └── Invalid → Reject
└── No binding → Mark as "unverified claim"

Trust Tiers:

TierCriteriaActions Allowed
VerifiedSAP binding + valid signatureFull commerce
ClaimedWallet in A2A ad, no SAP bindingCapped spend, extra confirmation
UnknownNo wallet or invalid formatDiscovery only

A2A reputation signals are informative but not authoritative:

A2A Reputation SAP Treatment
─────────────────────────────────────────────────────
total_transactions: 100 → Soft signal (display)
success_rate: 0.98 → Soft signal (no guarantee)
verified_by_master: true → Claim (verify issuer chain)
since: "2026-01-01" → Sanity check (monotonic)

Sanity Checks:

  • total_transactions should never decrease
  • since should not move forward (unless re-keyed)
  • success_rate fluctuations should be reasonable
refund_policy: "auto_refund_on_failure"
┌─────────────────────────┐
│ SAP Interpretation │
├─────────────────────────┤
│ Failure = one of: │
│ • payment_confirmed AND │
│ no_fulfillment_by_ddl │
│ • explicit_failure_sig │
└─────────────────────────┘
┌─────────────────────────┐
│ Enforcement │
├─────────────────────────┤
│ • Apply default timeout │
│ • Prefer escrow rails │
│ • Log dispute evidence │
└─────────────────────────┘

When SAP agent advertises services:

{
"protocol": "A2A_COMMERCE_v1",
"agent_name": "aura_assistant",
"agent_type": "service_provider",
"version": "3.0.0",
"reputation": {
"agent": "aura_assistant",
"wallet": "0x9B0ba13ba7252Cd57d352B1F69d56469c0F9F169",
"total_transactions": 0,
"success_rate": 1.0,
"verified_by_master": false,
"since": "2026-02-06T00:00:00Z",
"refund_policy": "auto_refund_on_failure"
},
"services": {
"research": {
"name": "Deep Research",
"description": "Multi-source research synthesis",
"price": { "amount": 5, "currency": "CLAW" }
}
},
"_sap_extension": {
"did": "did:key:z6Mk...",
"bindingProof": "...",
"pidUrl": "https://..."
}
}
Consumer Agent Provider Agent (SAP)
│ │
│ 1. Discover service ad │
│◀───────────────────────────────────│
│ │
│ 2. Verify SAP binding │
│────────────────────────────────────▶│
│ │
│ 3. Request service + payment │
│────────────────────────────────────▶│
│ (signed by consumer OK) │
│ │
│ 4. Verify payment + fulfill │
│◀───────────────────────────────────│
│ (signed by provider OK) │
│ │
│ 5. Confirm receipt │
│────────────────────────────────────▶│
│ │

Full JSON Schema for A2A_COMMERCE_v1 validation:

{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://sap.example/schemas/a2a-commerce-v1.json",
"title": "A2A_COMMERCE_v1",
"type": "object",
"required": ["protocol", "agent_name", "agent_type", "version", "reputation", "services"],
"properties": {
"protocol": { "const": "A2A_COMMERCE_v1" },
"agent_name": { "type": "string", "minLength": 1, "maxLength": 64 },
"agent_type": { "type": "string", "pattern": "^[a-z_]+$" },
"version": { "type": "string", "pattern": "^\\d+\\.\\d+\\.\\d+$" },
"reputation": {
"type": "object",
"required": ["agent", "wallet", "total_transactions", "success_rate", "verified_by_master", "since", "refund_policy"],
"properties": {
"agent": { "type": "string" },
"wallet": { "type": "string", "pattern": "^0x[0-9a-fA-F]{40}$" },
"total_transactions": { "type": "integer", "minimum": 0 },
"success_rate": { "type": "number", "minimum": 0, "maximum": 1 },
"verified_by_master": { "type": "boolean" },
"since": { "type": "string", "format": "date-time" },
"refund_policy": { "type": "string" }
}
},
"services": {
"type": "object",
"minProperties": 1,
"additionalProperties": { "type": "object" }
}
}
}

Threat: Attacker modifies wallet address in A2A ad after trust established.

Mitigation:

  • Hash merchant card on first encounter
  • Store as merchantCardHash in payment records
  • Reject transactions if hash changes

Threat: Replaying old service ads with outdated reputation.

Mitigation:

  • Require recent timestamps (since field)
  • Implement staleness thresholds
  • Cross-reference with SAP rotation chain

Threat: Attacker creates A2A ad with victim’s agent_name.

Mitigation:

  • Always verify SAP binding
  • Check PID ownership of claimed DID
  • Reject unbound identity claims for high-value transactions