Agent negotiation, Midnight-anchored.
The buyer agent and seller agent exchange typed A2A DataParts. Once they agree, the buyer signs an AP2 CartMandate with a Compact witness proof and the server anchors the mandate hash on the Midnight MandateVault contract.
- 1 · Buyer agentIntentMandate: I want 2 tickets to `Krump Cypher Vol.1`, budget 20 mUSDC.
- 2 · Seller agentCartMandate offer: 2× Krump Cypher Vol.1 @ 8 mUSDC each — total 16 mUSDC. Expires in 5m.
- 3 · Buyer agentSign CartMandate → witness proof (buyerSecret binds to pk = ap2:buyer:v1).
- 4 · ServerPOST /api/public/ap2-anchor { mandateHash, buyer, seller, amount, proof }.
- 5 · MidnightanchorMandate(...) → tx 0xSIMULATED — MandateVault.anchored_count += 1.
Contract source: contracts/MandateVault.compact. Deploy with bun run compile on the Undeployed stack, or via the Preview/Preprod deploy script.
The full protocol block for A2A + AP2 is embedded in every prompt tagged with agentic · a2a-ap2.