This document is for maintainers and advanced integrators. Start with README.md or QUICKSTART.md if you are adopting the SDK.
- One receipt truth: the signed canonical payload is
receipt. - Runtime metadata stays separate: execution context lives in optional
runtime_metadataand is not part of the receipt hash. - One version story: both published SDK packages track CommandLayer Commons v1.1.0 and are versioned at
1.1.0in this repo. - Compatibility is explicit: SDK clients normalize older blended runtime responses, but docs only teach the current envelope.
typescript-sdk/: npm package, CLI, JS verification helpers.python-sdk/: PyPI package and Python verification helpers.test_vectors/: shared receipt fixtures used across SDKs.runtime/tests/: cross-SDK protocol checks run against the built TypeScript package.- root docs: public landing page, quickstart, examples, and release guide.
The signed payload includes:
status,resultorerror,metadata.proofwithalg,canonical,signer_id,hash_sha256, andsignature_b64.
Commons receipts should not add payment metadata. A retained x402 block is legacy / commercial-only compatibility and is not part of the Commons happy path.
Unsigned context can include:
trace_id,- timing fields,
- runtime provider metadata,
- request IDs.
Clients normalize runtime responses into:
{
"receipt": { ...canonical signed receipt... },
"runtime_metadata": { ...optional unsigned context... }
}The TypeScript and Python SDKs should stay aligned on:
- method names,
- request body shaping,
- default runtime URL,
- receipt verification semantics,
- ENS resolution flow,
- major error messages where practical,
- shared test vectors.
If one SDK intentionally diverges, document it in that package README and in release notes.
Both SDKs use the same verification contract:
- strip
receipt_idif present and remove the signed hash/signature fields from the receipt, - canonicalize with
cl-stable-json-v1, - recompute
sha256, - compare against
metadata.proof.hash_sha256, - verify the Ed25519 signature over the UTF-8 hash string,
- treat
metadata.receipt_idas optional / opaque, - optionally discover the signing key via ENS.
The npm package owns the primary commandlayer CLI.
The CLI should remain:
- installable with
npm install -g @commandlayer/sdk, - aligned with SDK examples,
- useful for CI smoke tests,
- capable of verifying saved receipts.
When protocol versions change:
- update package versions and protocol constants,
- update root docs and per-package READMEs,
- regenerate or update shared fixtures,
- run both SDK test suites plus the optional cross-SDK
runtime/testslane, - confirm release instructions in
DEPLOYMENT_GUIDE.mdstill match reality.