Skip to content
This repository was archived by the owner on May 24, 2026. It is now read-only.

Commit 87018cc

Browse files
committed
docs: align receipt verb and verification contract language
1 parent d0d7121 commit 87018cc

5 files changed

Lines changed: 20 additions & 16 deletions

File tree

EXAMPLES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ All examples in this file target:
1313
{
1414
"receipt": {
1515
"status": "success",
16+
"verb": "summarize",
1617
"result": {
1718
"summary": "..."
1819
},

QUICKSTART.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ Both SDKs return the same shape:
4747
{
4848
"receipt": {
4949
"status": "success",
50+
"verb": "summarize",
5051
"result": { "summary": "..." },
5152
"metadata": {
5253
"proof": {
@@ -86,4 +87,4 @@ verify_receipt(response["receipt"], public_key="ed25519:BASE64_PUBLIC_KEY")
8687
- Persist `response.receipt`.
8788
- Treat `response.runtime_metadata` as optional unsigned context.
8889
- Treat `receipt.metadata.receipt_id` as the receipt hash identifier.
89-
- Read the verb from `receipt.x402.verb`.
90+
- Read the verb from `receipt.verb`. Legacy/commercial payloads may expose `receipt.x402.verb` as a fallback.

README.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ console.log(result.valid);
2929

3030
## What this repo now treats as canonical
3131

32-
- **Requests**: Commons requests are built around one explicit envelope: top-level `x402.verb`, `x402.version`, `actor`, and the verb body.
32+
- **Requests**: Commons requests are built with an explicit verb + payload envelope, and receipts surface that canonical verb at top-level `receipt.verb`.
3333
- **Responses**: the signed artifact is always `response.receipt`.
3434
- **Unsigned runtime context**: optional execution details live in `response.runtime_metadata`.
35-
- **Verification**: verification recomputes the receipt hash from the unsigned receipt, checks `metadata.receipt_id === metadata.proof.hash_sha256`, then verifies the Ed25519 signature over the UTF-8 hash string.
36-
- **Verb semantics**: the verb is read from `receipt.x402.verb`.
35+
- **Verification**: verification recomputes the receipt hash from the unsigned receipt, checks it against `metadata.proof.hash_sha256`, and verifies the Ed25519 signature over the UTF-8 hash string. `metadata.receipt_id` is optional compatibility metadata; when present it should match the proof hash.
36+
- **Verb semantics**: the canonical verb is read from `receipt.verb`; `receipt.x402.verb` is legacy / commercial fallback only.
3737

3838
This repo no longer presents legacy blended envelopes as the primary contract. Legacy normalization remains only to accept older runtime responses that inlined `trace` beside the receipt.
3939

@@ -84,10 +84,7 @@ pip install commandlayer
8484
{
8585
"receipt": {
8686
"status": "success",
87-
"x402": {
88-
"verb": "summarize",
89-
"version": "1.1.0"
90-
},
87+
"verb": "summarize",
9188
"result": {
9289
"summary": "..."
9390
},
@@ -97,7 +94,7 @@ pip install commandlayer
9794
"alg": "ed25519-sha256",
9895
"canonical": "cl-stable-json-v1",
9996
"signer_id": "runtime.commandlayer.eth",
100-
"hash_sha256": "same-value-as-receipt_id",
97+
"hash_sha256": "sha256-of-unsigned-receipt",
10198
"signature_b64": "..."
10299
}
103100
}
@@ -160,6 +157,7 @@ Client methods now return a command response envelope:
160157
{
161158
"receipt": {
162159
"status": "success",
160+
"verb": "summarize",
163161
"result": {
164162
"summary": "..."
165163
},
@@ -207,8 +205,9 @@ Verification reads exactly the current receipt contract:
207205
2. remove `metadata.receipt_id` and the signed hash/signature fields,
208206
3. canonicalize with `cl-stable-json-v1`,
209207
4. recompute `sha256`,
210-
5. require `metadata.receipt_id === metadata.proof.hash_sha256`,
211-
6. verify the Ed25519 signature.
208+
5. compare the recomputed hash to `metadata.proof.hash_sha256`,
209+
6. if `metadata.receipt_id` is present, treat equality to the proof hash as a compatibility / diagnostic check,
210+
7. verify the Ed25519 signature.
212211

213212
## Legacy handling retained
214213

python-sdk/docs/verification.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ The verification helper validates the current receipt contract directly.
88
2. Remove `metadata.receipt_id` and the signed hash/signature fields.
99
3. Canonicalize with `cl-stable-json-v1`.
1010
4. Recompute `sha256`.
11-
5. Require `metadata.receipt_id == metadata.proof.hash_sha256`.
12-
6. Verify the Ed25519 signature over the UTF-8 hash string.
11+
5. Compare the recomputed hash to `metadata.proof.hash_sha256`.
12+
6. If `metadata.receipt_id` is present, treat equality to the proof hash as a compatibility / diagnostic check (not a hard requirement for `ok`).
13+
7. Verify the Ed25519 signature over the UTF-8 hash string.
1314

1415
## Helpers
1516

typescript-sdk/README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@ Current-line TypeScript SDK for the CommandLayer Commons receipt contract (`1.1.
66

77
- `response.receipt` is the signed receipt.
88
- `response.runtime_metadata` is optional unsigned execution context.
9-
- `receipt.metadata.receipt_id` is the receipt hash identifier and must match `receipt.metadata.proof.hash_sha256`.
10-
- The verb lives at `receipt.x402.verb`.
9+
- `receipt.metadata.proof.hash_sha256` is the signed/recomputed receipt proof hash.
10+
- The canonical verb lives at `receipt.verb`; `receipt.x402.verb` is legacy / commercial fallback only.
11+
- `receipt.metadata.receipt_id`, when present, should match the proof hash but is not required for verification `ok`.
1112

1213
## Install
1314

@@ -44,6 +45,7 @@ Client methods return:
4445
{
4546
"receipt": {
4647
"status": "success",
48+
"verb": "summarize",
4749
"result": {},
4850
"metadata": {
4951
"proof": {
@@ -117,5 +119,5 @@ npm run test:integration
117119
- `receipt.verb` is the canonical verb field returned by the runtime.
118120
- `receipt.metadata.receipt_id` is an identifier for the receipt instance.
119121
- `receipt.metadata.proof.hash_sha256` is the SHA-256 hash over the unsigned canonical receipt payload.
120-
- `verifyReceipt()` succeeds when the declared algorithm/canonicalization match, the recomputed payload hash matches `hash_sha256`, and the Ed25519 signature validates over that hash.
122+
- `verifyReceipt()` succeeds when the declared algorithm/canonicalization match, the recomputed payload hash matches `hash_sha256`, and the Ed25519 signature validates over that hash. Any `receipt_id_matches` output is compatibility/diagnostic metadata and is not required for `ok`.
121123
- Legacy receipts that still place the verb under `receipt.x402.verb` continue to parse, but that path is fallback-only.

0 commit comments

Comments
 (0)