fix(spec): replace algorithm-class proxy with entropy-based checkout_hash requirement - #278
Conversation
…hash requirement Resolves the contradiction between specification.md §Payment Mandate (lines 155–157) and security_and_privacy_considerations.md §Rainbow Table Attacks (lines 140–148). The old text forbade deterministic signatures (e.g. Ed25519) as a proxy for the underlying security property. The S&P doc already correctly states the property: the Checkout JWT payload must contain sufficient entropy to make checkout_hash unpredictable per session, regardless of signature algorithm. The new text: - States the entropy property directly (payload-level high-entropy claim) - Accepts jti (RFC 7519 §4.1.7) or equivalent session identifier - Applies regardless of signature algorithm - Preserves all existing ECDSA implementations unchanged - Removes the forced dual-keypair cost for AP2 + WBA (Ed25519) integrators Closes google-agentic-commerce#268.
There was a problem hiding this comment.
Code Review
This pull request updates the specification in docs/ap2/specification.md to require a high-entropy claim (such as a jti) in the Checkout JWT payload to prevent rainbow-table attacks on checkout_hash, replacing the previous requirement of using a non-deterministic signature scheme. The reviewer suggested a minor phrasing improvement to clarify that the high-entropy claim makes the entire serialized Checkout JWT unpredictable, rather than just its payload, which aligns better with how the hash is computed.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Collapse 3-space list markers to 1 (MD030) and convert the Agent Authorization reference link to inline (MD052). Pre-existing violations surfaced because editing the file puts the whole file in lint scope. No content changes.
26d88f8 to
f1a7146
Compare
Pin actions/checkout and super-linter to release hashes, add a least privilege permissions block, set persist-credentials false, and disable Biome lint (ESLint still covers JS/TS). Matches the configuration proven green on PR 310.
specification.md previously carried roughly sixty lines of list-marker reformatting unrelated to the binding change. The upstream formatting is restored and MD030 is instead disabled in the markdownlint config, alongside the rules the repository already relaxes, because the repository's Markdown style uses three spaces after list markers. The one-line MD052 fix for the broken Agent Authorization Framework link is kept because the file fails lint without it. The checkout_hash entropy paragraph is reverted as well: it duplicates the proposal discussed in google-agentic-commerce#278 and is out of scope here. The surrounding checkout_hash architecture is left untouched, and the Cart-to-Payment Mandate Binding section is reworded to present the cart binding as a complement to the primary checkout_hash binding, to require hashing the raw received CartMandate JSON object before any schema-based parsing, and to require rejection by default when cart_mandate_hash is absent. Signed-off-by: AlgoVoi <chopmob@gmail.com>
What
Fixes the contradiction between
specification.md§Payment Mandate andsecurity_and_privacy_considerations.md§Rainbow Table Attacks, identified in #268.Before: The spec forbade deterministic signature schemes (e.g. Ed25519) as a proxy for the underlying security property.
After: The spec states the entropy property directly — the Checkout JWT payload MUST contain a high-entropy claim that makes
checkout_hashunpredictable per session, regardless of signature algorithm.Why
The S&P document already correctly states the underlying property. The spec text was using algorithm class as a proxy, which:
The fix text is the (b)-only formulation agreed in #268 between @igrigorik and @GarethCOliver.
Change
specification.mdlines 154–157 only. Single paragraph replacement. No structural changes.Existing ECDSA implementations are unaffected — they satisfy the requirement as-is (non-deterministic signature bytes provide the entropy).
Test gate
Closes #268.