Skip to content

fix(spec): replace algorithm-class proxy with entropy-based checkout_hash requirement#278

Open
chopmob-cloud wants to merge 4 commits into
google-agentic-commerce:mainfrom
chopmob-cloud:fix/checkout-jwt-entropy-requirement
Open

fix(spec): replace algorithm-class proxy with entropy-based checkout_hash requirement#278
chopmob-cloud wants to merge 4 commits into
google-agentic-commerce:mainfrom
chopmob-cloud:fix/checkout-jwt-entropy-requirement

Conversation

@chopmob-cloud

Copy link
Copy Markdown

What

Fixes the contradiction between specification.md §Payment Mandate and security_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_hash unpredictable 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:

  1. Contradicts the S&P document
  2. Forces AP2 + WBA (Ed25519) integrators to hold two keypairs for a single role
  3. Blocks Ed25519-native implementations that already satisfy the entropy requirement through payload claims

The fix text is the (b)-only formulation agreed in #268 between @igrigorik and @GarethCOliver.

Change

specification.md lines 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

  • No secrets in diff
  • Spec-only change — no code, no migrations

Closes #268.

…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.
@chopmob-cloud chopmob-cloud requested a review from a team as a code owner June 6, 2026 03:57

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread docs/ap2/specification.md Outdated
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Checkout JWT algorithm constraint forces dual keys under WBA (and conflicts with normative Security & Privacy guidance)

1 participant