docs(signatures): make example signature values raw r||s as the spec requires - #590
Conversation
…requires
signatures.md mandates fixed-width raw r||s encoding for ECDSA signature
values ("MUST use fixed-width raw r||s encoding"), but the worked examples
showed values beginning ME[UQ]C... — the base64 of a DER SEQUENCE, the exact
encoding the normative text forbids. An implementer copying the examples'
shape produces signatures a conformant verifier rejects.
Replaces the seven example values in signatures.md, checkout-mcp.md,
checkout-rest.md, and order-rest.md with a genuine ES256 raw r||s value
(64 bytes, 88 base64 chars), preserving each instance's truncation style.
The instance in order.md is deliberately left to avoid overlapping Universal-Commerce-Protocol#568,
which edits the same example block.
Fixes Universal-Commerce-Protocol#569.
|
Thanks for this documentation fix @vishkaty ! I see there are others examples fix worthy, like
Can you take a look and add them in this PR? |
…alues Extends the sweep per review: the response-signing examples used a second DER shape (MFQCIH..., a 0x30-led SEQUENCE) that the first pass's pattern missed — now swept by decoding every example signature value's leading byte rather than pattern-matching. Fixes checkout-mcp.md, checkout-rest.md, and signatures.md's response-signing example, and aligns the stale keyid="merchant-2025" with the merchant-2026 used by every sibling example. order.md's instance remains deferred to avoid overlapping Universal-Commerce-Protocol#568.
|
Good catch — thank you! Both fixed, plus one more the first pass missed: those response-signing examples use a second DER shape ( The only DER-shaped value now remaining anywhere in docs/ is order.md's — left deliberately since #568 edits that same example block; it can pick up the value fix on whichever lands second. |
|
Thanks for the reviews here @damaz91 @jingyli 🙏 This one's approved by both of you and every check is green — the only thing left |
Corrects several places where documentation examples contradict the schemas or the normative signing requirements: - Replace nonexistent message paths: buyer.json has no shipping_address property and no schema defines selected_fulfillment_option. Point validation messages at the real fields (fulfillment.methods[].selected_destination_id and fulfillment.methods[].groups[].selected_option_id). - Order webhook example: the payload is the plain order snapshot per order.md itself and rest.openapi.json (no event_id/created_time fields); event identity travels in the Webhook-Id/Webhook-Timestamp headers, which the example now includes. Also cover ucp-agent in Signature-Input as signatures.md requires when UCP-Agent is present, and replace the last remaining DER-encoded ECDSA example signature with the raw r||s value used everywhere else (follow-up to Universal-Commerce-Protocol#590). - Playground: emit the webhook simulation as headers + order body instead of injecting event_id/created_time into the payload. - split-payments: capabilities is an object keyed by reverse-domain name (ucp.json), not an array; this was the only array-form example in the tree. - discount: totals is an array, so $.totals.shipping cannot address the shipping total (and 'shipping' is not a well-known total type); use a JSONPath filter on type=='fulfillment' in both the doc table and the allocation path description in discount.json. - checkout-rest signed request example: cover ucp-agent in Signature-Input, matching the canonical example in signatures.md and its coverage verification pseudocode. - checkout-a2a: use 'kind' consistently for A2A message parts; four examples mixed 'type' and 'kind' between adjacent parts. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011MnLq8ZJ3uAvzoEWxBLuYM
Fixes #569: signatures.md mandates fixed-width raw
r||sencoding for ECDSA signature values, but the worked examples show values beginningMEUC…/MEQC…— the base64 of a DERSEQUENCE, the exact encoding the normative text forbids (§ Signature value encoding). An implementer copying the examples' shape produces signatures a conformant verifier rejects.What changed
Replaces the seven example signature values across
signatures.md(4),checkout-mcp.md(1),checkout-rest.md(1), andorder-rest.md(1) with a genuine ES256 rawr||svalue (a real P-256 signature: 64 bytes → 88 base64 chars, decodes to no ASN.1 structure), preserving each instance's truncation style (…).The eighth instance, in
order.md, is deliberately not touched here — #568 edits the same example block (addingucp-agentto its covered components), and overlapping diffs would conflict; it can pick up the value fix on whichever lands second.Example values only; no normative text changes.