From 93a42680fd64cf1a888c3f07f403013d46d743ba Mon Sep 17 00:00:00 2001 From: Greg Soucy Date: Fri, 22 May 2026 14:24:38 -0400 Subject: [PATCH] =?UTF-8?q?rename=20erc8211.merkle.v1=20=E2=86=92=20erc821?= =?UTF-8?q?1.composable.v1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Replace ERR_UNSUPPORTED_MERKLE_VERIFICATION with ERR_MERKLE_AUTHORIZATION_DEFERRED - Add comment: ERC-8211 composable execution canonicalization recognized; Merkle authorization verification is deferred pending companion ERC - Update test: canonicalization string, error code, and test description --- src/compat.ts | 8 +++++--- test/compat.test.ts | 6 +++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/compat.ts b/src/compat.ts index 44d57c3..7337e1e 100644 --- a/src/compat.ts +++ b/src/compat.ts @@ -191,7 +191,7 @@ export function verifyCommandLayerReceipt( errors.push("ERR_MISSING_SIGNATURE_KID"); } - const allowed = opts.allowedCanonicals ?? [CANONICAL_METHOD, "erc8211.merkle.v1"]; + const allowed = opts.allowedCanonicals ?? [CANONICAL_METHOD, "erc8211.composable.v1"]; if (typeof proof.canonicalization === "string" && !allowed.includes(proof.canonicalization)) { errors.push("ERR_UNSUPPORTED_CANONICALIZATION"); } @@ -221,8 +221,10 @@ export function verifyCommandLayerReceipt( let canonical = ""; if (checks.schema) { - if (proof.canonicalization === "erc8211.merkle.v1") { - errors.push("ERR_UNSUPPORTED_MERKLE_VERIFICATION"); + if (proof.canonicalization === "erc8211.composable.v1") { + // ERC-8211 composable execution canonicalization recognized. + // Merkle authorization verification is deferred pending the companion Merkle authorization ERC. + errors.push("ERR_MERKLE_AUTHORIZATION_DEFERRED"); return { ok: false, status: "INVALID", checks, errors }; } canonical = buildCanonicalProof(receipt); diff --git a/test/compat.test.ts b/test/compat.test.ts index 97558c3..1b5a9a6 100644 --- a/test/compat.test.ts +++ b/test/compat.test.ts @@ -172,14 +172,14 @@ describe("canonical CLAS proof envelope", () => { assert.ok(result.errors.includes("ERR_MALFORMED_SIGNATURE_ARRAY")); }); - test("erc8211 canonicalization is recognized but not falsely verified", () => { + test("erc8211 composable canonicalization is recognized, Merkle authorization verification deferred", () => { const signed = signCommandLayerReceipt(baseReceipt, { privateKeyPem: kp.privateKeyPem, kid: "testKid" }); const recognized = verifyCommandLayerReceipt( - { ...signed, metadata: { ...signed.metadata!, proof: { ...signed.metadata!.proof!, canonicalization: "erc8211.merkle.v1" } } }, + { ...signed, metadata: { ...signed.metadata!, proof: { ...signed.metadata!.proof!, canonicalization: "erc8211.composable.v1" } } }, { publicKeyPemOrDer: kp.publicKeyPem } ); assert.equal(recognized.status, "INVALID"); - assert.ok(recognized.errors.includes("ERR_UNSUPPORTED_MERKLE_VERIFICATION")); + assert.ok(recognized.errors.includes("ERR_MERKLE_AUTHORIZATION_DEFERRED")); assert.ok(!recognized.errors.includes("ERR_UNSUPPORTED_CANONICALIZATION")); const unsupported = verifyCommandLayerReceipt(