payment_policy
ap2
cartmandate
hash-chain
keccak256
verifiable-credential
mcp:build_ap2_cartmandate_hashchain

AP2 CartMandate Hash-Chain Builder

Builds an illustrative Google AP2 CartMandate Verifiable Digital Credential (VDC) skeleton whose credentialSubject carries a deterministic hash-chain over an ordered list of cart line items: link_0 = keccak256(canon({index:0,item})), link_i = keccak256(canon({index:i,item,prev:link_(i-1)})), cart_root = the final link. Reuses this repo's existing RFC 8785/JCS canonicalization (cgCanon) and the already-vendored @noble/hashes keccak256 bundle -- no new vendoring, no hand-rolled canonicalization or hashing. Stands beside art-16 (Google AP2 Mandate Builder) as a new node -- art-16's flat CheckoutMandate/PaymentMandate shape has no line-item array to chain over. An intact chain proves the ordered cart_items list was not altered after the chain was built; it does NOT prove human authorisation, delivery, settlement, or that item prices are correct or current. Given a prior chain's per-item links (claimed_links) and a possibly tampered cart_items, the kernel recomputes and reports whether the chain is intact plus the earliest divergent index, never a thrown exception. Zero network calls; never a facilitator, proxy, gateway, or settlement relay.

Tool URL: https://ainumbers.co/chaingraph/art-595-ap2-cartmandate-hashchain-builder.html

post/v1/tools/build_ap2_cartmandate_hashchain

Request

  • Base URL: https://ainumbers.co
  • URL: https://ainumbers.co/v1/tools/build_ap2_cartmandate_hashchain
  • Auth: none declared

Request body

agent_idstring
subjectstring
merchantstring
stagestring

Response

Successful tool execution result

vdcobject nullable
vdc_typestring
cart_rootstring nullable
chain_lengthnumber
chain_linksstring[]
cart_chain_intactboolean nullable
first_divergent_indexnumber nullable
notestring
reasonsstring[]

Changes

No recorded changes to this operation across all 1 revision of this API.