diff --git a/README.md b/README.md index cb25e2f..57508d7 100644 --- a/README.md +++ b/README.md @@ -11,9 +11,9 @@ writer semantics independently in TypeScript. ## Version and Core release -The package asset binding is `0.0.3-rc.4`, built against the published -`malt-core v0.0.10-rc.4` release at commit -`0d7b166d58d1c2e21ead96de9c66968caf630374`. +The package asset binding is `0.0.3`, built against the published +`malt-core v0.0.10` release at commit +`aaa78737c35f82fe91bb3f749cfddbcb7953ed2b`. [`malt-core.lock.json`](./malt-core.lock.json) binds that tag, commit, Go module checksums. The `malt.ts-core-lock/v2` lock binds Core source only; Core WASM assets are not required. This repository exclusively owns WASM entrypoints, @@ -101,7 +101,7 @@ from committing source. `verifyAuthenticationLocally({request, result, ...options})` verifies the caller-selected Root, label steps and binding/range operation through Core. -`malt.authentication/3` also authenticates early path absence. Labels are +`malt.authentication/5` also authenticates early path absence. Labels are base64-encoded opaque bytes. `encodeIndexLabel(bigint)` serializes Direct indices as eight unsigned big-endian bytes, and `encodeKeyLabel(Uint8Array)` serializes Direct 32-byte keys. `deriveCoordinate({profile, label})` executes @@ -164,7 +164,7 @@ session snapshot compatibility APIs. Worker readiness requires the complete current ABI. There are no forwarding aliases or optional old-runtime exports. The `malt-core.lock.json` and packaged binary assets identify the published -Core `v0.0.10-rc.4` release. Its current host and batch APIs are bound to the +Core `v0.0.10` release. Its current host and batch APIs are bound to the exact release tag, source commit, and module checksums. Source integration checks remain separate from this published release binding. @@ -184,7 +184,7 @@ current contracts to the exact release selected by the lock. ### WASM ownership and archives Core provides the Go SDK, cryptographic parameter metadata, and portable -`conformance/authentication-v1.json` corpus. All JavaScript/WASM runners live +`conformance/authentication-v3.json` corpus. All JavaScript/WASM runners live in this repository; tests never execute a Core-owned browser build or runner. `make test-wasm` tests the pinned published Core release. For a proposed Core source change, use the explicit non-release `scripts/test-core-source.sh`. @@ -198,3 +198,9 @@ See [WASM release assets](docs/wasm-release-assets.md). `maltCoreRelease` exposes the Core version, commit, `moduleSum`, and `goModSum`. The former Core WASM manifest/asset-set properties are removed. Consumers use this package's asset checksums and build provenance for the WASM it distributes. + +The package uses root-only Positional metadata: `count` plus an optional +opaque `payload_cid`. Range bounds are element indices, and non-root vectors +have no reserved metadata slot. Application JSON decoding stays in consumers. +The packaged verifier and writer assets are built from the exact audited Core +release above and pass its `authentication-v3.json` conformance corpus. diff --git a/assets/verifier/PROVENANCE.json b/assets/verifier/PROVENANCE.json index 0b8850c..0ada1f6 100644 --- a/assets/verifier/PROVENANCE.json +++ b/assets/verifier/PROVENANCE.json @@ -1,13 +1,13 @@ { "schema": "malt.ts-verifier.provenance/v1", "source_repository": "https://github.com/DeWebProtocol/malt-ts.git", - "build_inputs_sha256": "9073c0f81dbe9baf8b0ee06e58b9c666a6f724fae3d07ae22b65d5735cd4c1b2", + "build_inputs_sha256": "610e2e0b50304b981e485d3e5f92db4b4552783a90671d1a26716d78d6d47396", "core": { "module_path": "github.com/dewebprotocol/malt-core", - "module_version": "v0.0.10-rc.4", + "module_version": "v0.0.10", "source_repository": "https://github.com/DeWebProtocol/malt-core.git", - "source_commit": "0d7b166d58d1c2e21ead96de9c66968caf630374", - "module_sum": "h1:BpA7vH0LwKTmipTlAUu97CniBXTxBT9f5AQWV8UFbmY=", + "source_commit": "aaa78737c35f82fe91bb3f749cfddbcb7953ed2b", + "module_sum": "h1:HgzuUot+AAKiLz20KdeUlnVDCVFHxfjQc7unsQOqm7Q=", "go_mod_sum": "h1:o6L8K9vJp5hyrVo3fUtSsj0rvNpcboOcOb3nQwnR/gs=" }, "target": "js/wasm", diff --git a/assets/verifier/SHA256SUMS b/assets/verifier/SHA256SUMS index 5d40b27..a4ee8eb 100644 --- a/assets/verifier/SHA256SUMS +++ b/assets/verifier/SHA256SUMS @@ -1,3 +1,3 @@ -62d7bc0d24a4d3aa8fd9ce799e35545667a17885736da5c13a2f43a80e448fe6 malt-verifier.wasm +adfb131464ba9c9f19292569c1e5ea3c34a29f5c7f5eef5bf288f994d917c037 malt-verifier.wasm 0c949f4996f9a89698e4b5c586de32249c3b69b7baadb64d220073cc04acba14 wasm_exec.js -af3da7057b4535514f38da2f4e2404b5be3141f034530b7d1326694a65fcc3d8 PROVENANCE.json +d5bc936fbbcf740fc41d6936be8b9ee9dc64e7a6d8ccf1c90d6726cd1b70ba32 PROVENANCE.json diff --git a/assets/verifier/malt-verifier.wasm b/assets/verifier/malt-verifier.wasm index 6b034c7..2278ab1 100644 Binary files a/assets/verifier/malt-verifier.wasm and b/assets/verifier/malt-verifier.wasm differ diff --git a/assets/writer/PROVENANCE.json b/assets/writer/PROVENANCE.json index d0f38a6..7e22d73 100644 --- a/assets/writer/PROVENANCE.json +++ b/assets/writer/PROVENANCE.json @@ -1,13 +1,13 @@ { "schema": "malt.ts-writer.provenance/v1", "source_repository": "https://github.com/DeWebProtocol/malt-ts.git", - "build_inputs_sha256": "9073c0f81dbe9baf8b0ee06e58b9c666a6f724fae3d07ae22b65d5735cd4c1b2", + "build_inputs_sha256": "610e2e0b50304b981e485d3e5f92db4b4552783a90671d1a26716d78d6d47396", "core": { "module_path": "github.com/dewebprotocol/malt-core", - "module_version": "v0.0.10-rc.4", + "module_version": "v0.0.10", "source_repository": "https://github.com/DeWebProtocol/malt-core.git", - "source_commit": "0d7b166d58d1c2e21ead96de9c66968caf630374", - "module_sum": "h1:BpA7vH0LwKTmipTlAUu97CniBXTxBT9f5AQWV8UFbmY=", + "source_commit": "aaa78737c35f82fe91bb3f749cfddbcb7953ed2b", + "module_sum": "h1:HgzuUot+AAKiLz20KdeUlnVDCVFHxfjQc7unsQOqm7Q=", "go_mod_sum": "h1:o6L8K9vJp5hyrVo3fUtSsj0rvNpcboOcOb3nQwnR/gs=" }, "target": "js/wasm", diff --git a/assets/writer/SHA256SUMS b/assets/writer/SHA256SUMS index 7f94a17..8ba09bf 100644 --- a/assets/writer/SHA256SUMS +++ b/assets/writer/SHA256SUMS @@ -1,8 +1,8 @@ -3c225d43c827ab97dbcb4cf9212681a85f5b616500fe57ec9b10bbd1620d9369 malt-writer-kzg.wasm -8f038c50d481c20aef0f9f443eefc49f812b870fe39cf2ff721dcacad6e76ce4 malt-writer-ipa-direct.wasm -494a397d319fa4f0782606257fdc62acd335a1d2c93374dec9df8c19332a1fc0 malt-writer-ipa-compact.wasm -b8d6f2e3f475a97cd26f4c5b98d1763a8f2483718e3dc569bedcaa70caf6cf8e malt-writer-ipa-fast.wasm +d8509c24c079323c784d7f5632073abfed194763201e5477fd92868d4fdf5083 malt-writer-kzg.wasm +cf21fbf61aedc64dfd671a0660c3f5afa442411a0d08731c9dfdf1703eb8228f malt-writer-ipa-direct.wasm +e02dcde26245b1f8df0825f38b0c426f6ea355179f66e3191456fe6007d58f7c malt-writer-ipa-compact.wasm +4461eeeb9699321fe8de944772c588ad101db8feb1645ad84d231a804e004fe6 malt-writer-ipa-fast.wasm 6311876a80f3c9333f20e6a8ae8b55b7235b1f7411d6ae2224bc90b55fe779a2 malt-writer-worker.mjs 968657d9a8818feb23b6463aca609478c81423a93a8b0dc453705ad009214db0 malt-writer-workers.mjs 0c949f4996f9a89698e4b5c586de32249c3b69b7baadb64d220073cc04acba14 wasm_exec.js -30c5326992667cd32e53a7fa45a4b0403582195f3bbda20e96e3bcb6310182f4 PROVENANCE.json +82500f2f8585b10defd691727f6a925bd3535893acb4ad643315e44d86b1bf0b PROVENANCE.json diff --git a/assets/writer/malt-writer-ipa-compact.wasm b/assets/writer/malt-writer-ipa-compact.wasm index cbb1258..269b122 100644 Binary files a/assets/writer/malt-writer-ipa-compact.wasm and b/assets/writer/malt-writer-ipa-compact.wasm differ diff --git a/assets/writer/malt-writer-ipa-direct.wasm b/assets/writer/malt-writer-ipa-direct.wasm index e62554a..015f0c2 100644 Binary files a/assets/writer/malt-writer-ipa-direct.wasm and b/assets/writer/malt-writer-ipa-direct.wasm differ diff --git a/assets/writer/malt-writer-ipa-fast.wasm b/assets/writer/malt-writer-ipa-fast.wasm index 3f16ddc..558d1f1 100644 Binary files a/assets/writer/malt-writer-ipa-fast.wasm and b/assets/writer/malt-writer-ipa-fast.wasm differ diff --git a/assets/writer/malt-writer-kzg.wasm b/assets/writer/malt-writer-kzg.wasm index 40454f6..8b1c476 100644 Binary files a/assets/writer/malt-writer-kzg.wasm and b/assets/writer/malt-writer-kzg.wasm differ diff --git a/go.mod b/go.mod index a828f24..1ec049b 100644 --- a/go.mod +++ b/go.mod @@ -2,7 +2,7 @@ module github.com/dewebprotocol/malt-ts go 1.26.0 -require github.com/dewebprotocol/malt-core v0.0.10-rc.4 +require github.com/dewebprotocol/malt-core v0.0.10 require ( github.com/bits-and-blooms/bitset v1.24.6 // indirect diff --git a/go.sum b/go.sum index 3df2b43..1913354 100644 --- a/go.sum +++ b/go.sum @@ -6,8 +6,8 @@ github.com/crate-crypto/go-kzg-4844 v1.1.0 h1:EN/u9k2TF6OWSHrCCDBBU6GLNMq88OspHH github.com/crate-crypto/go-kzg-4844 v1.1.0/go.mod h1:JolLjpSff1tCCJKaJx4psrlEdlXuJEC996PL3tTAFks= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dewebprotocol/malt-core v0.0.10-rc.4 h1:BpA7vH0LwKTmipTlAUu97CniBXTxBT9f5AQWV8UFbmY= -github.com/dewebprotocol/malt-core v0.0.10-rc.4/go.mod h1:o6L8K9vJp5hyrVo3fUtSsj0rvNpcboOcOb3nQwnR/gs= +github.com/dewebprotocol/malt-core v0.0.10 h1:HgzuUot+AAKiLz20KdeUlnVDCVFHxfjQc7unsQOqm7Q= +github.com/dewebprotocol/malt-core v0.0.10/go.mod h1:o6L8K9vJp5hyrVo3fUtSsj0rvNpcboOcOb3nQwnR/gs= github.com/ipfs/go-cid v0.6.2 h1:VuGwJd+KJTaMJ4S4d5EEf9SXc17YUblS5axCbocn9YE= github.com/ipfs/go-cid v0.6.2/go.mod h1:Xhwg8NzHeK9xPCEZkCw4idzPiuNMpX3fARuI5Iwj1Lo= github.com/klauspost/cpuid/v2 v2.3.0 h1:S4CRMLnYUhGeDFDqkGriYKdfoFlDnMtqTiI/sFzhA9Y= diff --git a/malt-core.lock.json b/malt-core.lock.json index 4421c6b..c0f166f 100644 --- a/malt-core.lock.json +++ b/malt-core.lock.json @@ -1,9 +1,9 @@ { "schema": "malt.ts-core-lock/v2", "module_path": "github.com/dewebprotocol/malt-core", - "module_version": "v0.0.10-rc.4", + "module_version": "v0.0.10", "source_repository": "https://github.com/DeWebProtocol/malt-core.git", - "source_commit": "0d7b166d58d1c2e21ead96de9c66968caf630374", - "module_sum": "h1:BpA7vH0LwKTmipTlAUu97CniBXTxBT9f5AQWV8UFbmY=", + "source_commit": "aaa78737c35f82fe91bb3f749cfddbcb7953ed2b", + "module_sum": "h1:HgzuUot+AAKiLz20KdeUlnVDCVFHxfjQc7unsQOqm7Q=", "go_mod_sum": "h1:o6L8K9vJp5hyrVo3fUtSsj0rvNpcboOcOb3nQwnR/gs=" } diff --git a/node-tests/malt-writer-workers.mjs b/node-tests/malt-writer-workers.mjs index 638dbbf..7545dce 100644 --- a/node-tests/malt-writer-workers.mjs +++ b/node-tests/malt-writer-workers.mjs @@ -139,8 +139,8 @@ test("request errors keep the selected Worker alive", async () => { const bootstrap = writer.createAuthentication("kzg", new Uint8Array([1])); const bootstrapRequest = await worker.nextRequest(); assert.equal(bootstrapRequest.method, "createAuthentication"); - worker.respond(bootstrapRequest, { result: '{"profile":"malt.authentication/2"}' }); - assert.equal(await bootstrap, '{"profile":"malt.authentication/2"}'); + worker.respond(bootstrapRequest, { result: '{"profile":"malt.authentication/4"}' }); + assert.equal(await bootstrap, '{"profile":"malt.authentication/4"}'); const invalidLoad = writer.importAuthentication("kzg", new Uint8Array([1])); const invalidRequest = await worker.nextRequest(); diff --git a/package-lock.json b/package-lock.json index d6823bb..1ebc145 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@dewebprotocol/malt", - "version": "0.0.3-rc.4", + "version": "0.0.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@dewebprotocol/malt", - "version": "0.0.3-rc.4", + "version": "0.0.3", "license": "Apache-2.0", "devDependencies": { "happy-dom": "20.11.1", diff --git a/package.json b/package.json index 7e9faad..62ae662 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@dewebprotocol/malt", - "version": "0.0.3-rc.4", + "version": "0.0.3", "description": "Stable TypeScript and browser WASM SDK for MALT", "type": "module", "license": "Apache-2.0", diff --git a/scripts/build-wasm-release.sh b/scripts/build-wasm-release.sh index ee2546c..6930220 100755 --- a/scripts/build-wasm-release.sh +++ b/scripts/build-wasm-release.sh @@ -65,7 +65,7 @@ cp "${temporary}/assets/verifier/"* "${verifier_staging}/" cp "${temporary}/assets/writer/"* "${writer_staging}/" pin="$("${build_source}/scripts/resolve-core.sh")" IFS=$'\t' read -r _ _ core_module_dir _ _ <<<"${pin}" -authentication_corpus_sha256="$(sha256sum "${core_module_dir}/conformance/authentication-v2.json" | awk '{print $1}')" +authentication_corpus_sha256="$(sha256sum "${core_module_dir}/conformance/authentication-v3.json" | awk '{print $1}')" chmod 0644 "${verifier_staging}/"* "${writer_staging}/"* ( @@ -136,7 +136,7 @@ MANIFEST_PATH="${temporary}/WASM-RELEASE.json" node -e ' target: "js/wasm", archive_format: "ustar+gzip", conformance_corpora: { - authentication: {schema: "malt.conformance.authentication/2", sha256: process.env.AUTHENTICATION_CORPUS_SHA256}, + authentication: {schema: "malt.conformance.authentication/3", sha256: process.env.AUTHENTICATION_CORPUS_SHA256}, }, codegen_environment: {CGO_ENABLED: "0", GOEXPERIMENT: "none", GOWASM: "", GOFIPS140: "off"}, components: {verifier: component("VERIFIER"), writer: component("WRITER")} diff --git a/scripts/check-wasm-release.sh b/scripts/check-wasm-release.sh index 15442b9..325384f 100755 --- a/scripts/check-wasm-release.sh +++ b/scripts/check-wasm-release.sh @@ -27,7 +27,7 @@ fi expected_go_version="go${go_directive}" pin="$("${repo_root}/scripts/resolve-core.sh")" IFS=$'\t' read -r _ _ core_module_dir _ _ <<<"${pin}" -expected_authentication_corpus_sha256="$(sha256sum "${core_module_dir}/conformance/authentication-v2.json" | awk '{print $1}')" +expected_authentication_corpus_sha256="$(sha256sum "${core_module_dir}/conformance/authentication-v3.json" | awk '{print $1}')" expected_commit="$(git -C "${repo_root}" rev-parse HEAD)" expected_epoch="$(git -C "${repo_root}" show -s --format=%ct HEAD)" expected_build_inputs="$("${repo_root}/scripts/build-wasm.sh" --print-source-digest)" @@ -84,7 +84,7 @@ AUTHENTICATION_CORPUS_SHA256="${expected_authentication_corpus_sha256}" node -e const version = /^v[0-9]+\.[0-9]+\.[0-9]+(?:[.-][0-9A-Za-z.-]+)?$/ const expectedCodegen = {CGO_ENABLED: "0", GOEXPERIMENT: "none", GOWASM: "", GOFIPS140: "off"} const expectedCorpora = { - authentication: {schema: "malt.conformance.authentication/2", sha256: process.env.AUTHENTICATION_CORPUS_SHA256}, + authentication: {schema: "malt.conformance.authentication/3", sha256: process.env.AUTHENTICATION_CORPUS_SHA256}, } const toolchain = /^go version (go[0-9]+\.[0-9]+\.[0-9]+) ([a-z0-9]+)\/([a-z0-9]+)$/.exec(manifest.go_toolchain || "") if (manifest.schema !== "malt.ts-wasm-release/v1" || diff --git a/scripts/run-authentication-batch-wasm.mjs b/scripts/run-authentication-batch-wasm.mjs index c497cd9..0ed2438 100644 --- a/scripts/run-authentication-batch-wasm.mjs +++ b/scripts/run-authentication-batch-wasm.mjs @@ -30,20 +30,20 @@ const next = JSON.parse(await globalThis.maltUpdateAuthentication(json(base), js // Both complete and retained no-op updates must stay materializable. const unchanged = JSON.parse(await globalThis.maltUpdateAuthentication(json(next), json(state))) const retained = JSON.parse(await globalThis.maltImportAuthentication(json(next))) -const noOpHandle = JSON.parse(await globalThis.maltApplyAuthentication(new TextEncoder().encode(retained.handle), json({ profile: 'malt.authentication-delta/1', changes: [] }))) +const noOpHandle = JSON.parse(await globalThis.maltApplyAuthentication(new TextEncoder().encode(retained.handle), json({ profile: 'malt.authentication-delta/2', changes: [] }))) const noOp = JSON.parse(await globalThis.maltExportAuthentication(new TextEncoder().encode(noOpHandle.handle))) for (const candidate of [unchanged, noOp]) { assert.equal(candidate.root, next.root) assert.equal(candidate.previous, next.previous) - const noOpBatch = { profile: 'malt.authentication-batch/1', transaction_id: 'no-op', base: next.root, root: next.root, candidates: [candidate] } + const noOpBatch = { profile: 'malt.authentication-batch/2', transaction_id: 'no-op', base: next.root, root: next.root, candidates: [candidate] } const noOpDigest = await globalThis.maltValidateAuthenticationBatch(json(noOpBatch)) - assert.equal(await globalThis.maltValidateAuthenticationReceipt(json(noOpBatch), json({ profile: 'malt.authentication-receipt/1', transaction_id: noOpBatch.transaction_id, base: next.root, root: next.root, digest: noOpDigest, durable_boundary: 'wasm-test/no-op' })), next.root) + assert.equal(await globalThis.maltValidateAuthenticationReceipt(json(noOpBatch), json({ profile: 'malt.authentication-receipt/2', transaction_id: noOpBatch.transaction_id, base: next.root, root: next.root, digest: noOpDigest, durable_boundary: 'wasm-test/no-op' })), next.root) } await globalThis.maltCloseAuthentication() -const batch = { profile: 'malt.authentication-batch/1', transaction_id: 'wasm-batch', base: base.root, root: next.root, candidates: [base, next] } +const batch = { profile: 'malt.authentication-batch/2', transaction_id: 'wasm-batch', base: base.root, root: next.root, candidates: [base, next] } const digest = await globalThis.maltValidateAuthenticationBatch(json(batch)) assert.match(digest, /^[a-f0-9]{64}$/) -const receipt = { profile: 'malt.authentication-receipt/1', transaction_id: batch.transaction_id, base: batch.base, root: batch.root, digest, durable_boundary: 'wasm-test/0' } +const receipt = { profile: 'malt.authentication-receipt/2', transaction_id: batch.transaction_id, base: batch.base, root: batch.root, digest, durable_boundary: 'wasm-test/0' } assert.equal(await globalThis.maltValidateAuthenticationReceipt(json(batch), json(receipt)), next.root) for (const field of ['transaction_id', 'base', 'root', 'digest', 'durable_boundary']) { await assert.rejects(() => globalThis.maltValidateAuthenticationReceipt(json(batch), json({ ...receipt, [field]: '' }))) diff --git a/scripts/run-authentication-router-smoke.mjs b/scripts/run-authentication-router-smoke.mjs index 560d6ad..c18f1dd 100644 --- a/scripts/run-authentication-router-smoke.mjs +++ b/scripts/run-authentication-router-smoke.mjs @@ -33,13 +33,13 @@ const writer = await createBrowserMaltWriter({ const bytes = value => new TextEncoder().encode(value) const json = value => bytes(JSON.stringify(value)) const state = { - descriptor: { layout: 2, derivation_profile: 3, vc_profile: 2 }, + descriptor: { layout: 3, derivation_profile: 3, vc_profile: 2 }, entries: [{ label: encodeIndexLabel('0'), target: { '/': 'bafkqaaa' } }] } try { const base = JSON.parse(await writer.createAuthentication('ipa', json(state))) const next = JSON.parse(await writer.applyAuthentication('ipa', bytes(base.handle), json({ - profile: 'malt.authentication-delta/1', + profile: 'malt.authentication-delta/2', changes: [{ label: encodeIndexLabel('0'), before: 'bafkqaaa', after: 'bafkreigh2akiscaildcw4535x7k5vfhq56bqddhziq3p4mwfmlz4vfu2ta' }] }))) assert.notEqual(next.root, base.root) diff --git a/scripts/run-authentication-wasm.mjs b/scripts/run-authentication-wasm.mjs index 75e3803..fdb2fc7 100644 --- a/scripts/run-authentication-wasm.mjs +++ b/scripts/run-authentication-wasm.mjs @@ -22,7 +22,7 @@ while (typeof globalThis[name] !== 'function') { await new Promise(resolve => setTimeout(resolve, 10)) } const corpus = JSON.parse(await readFile(corpusPath, 'utf8')) -assert.equal(corpus.schema, 'malt.conformance.authentication/2') +assert.equal(corpus.schema, 'malt.conformance.authentication/3') if (kind === 'verifier') { const derive = (profile, bytes) => JSON.parse(globalThis.maltDeriveCoordinate(profile, bytes)) for (const index of [0n, 42n, 9007199254740993n, 18446744073709551615n]) { @@ -55,7 +55,7 @@ if (kind === 'verifier') { const candidate = JSON.parse(await globalThis[name](new TextEncoder().encode(JSON.stringify(state)))) const expected = corpus.vectors.find(v => v.id === `profile-${id}.opaque-label`) assert.equal(candidate.root, expected.verification.request.root) - assert.equal(candidate.profile, 'malt.authentication/2') + assert.equal(candidate.profile, 'malt.authentication/4') assert(candidate.nodes.length > 0) await assert.rejects(() => globalThis[name]('{}')) state.descriptor.derivation_profile = 255 diff --git a/scripts/run-retained-writer-wasm.mjs b/scripts/run-retained-writer-wasm.mjs index 6a66a81..0d8987d 100644 --- a/scripts/run-retained-writer-wasm.mjs +++ b/scripts/run-retained-writer-wasm.mjs @@ -30,7 +30,7 @@ const json = value => text(JSON.stringify(value)) const first = 'bafkqaaa' const second = 'bafkreigh2akiscaildcw4535x7k5vfhq56bqddhziq3p4mwfmlz4vfu2ta' const state = { - descriptor: { layout: 2, derivation_profile: 3, vc_profile: backend === 'ipa' ? 2 : 1 }, + descriptor: { layout: 3, derivation_profile: 3, vc_profile: backend === 'ipa' ? 2 : 1 }, entries: Array.from({ length: 256 }, (_, i) => ({ label: encodeIndexLabel(String(i)), target: { '/': first } })) @@ -39,7 +39,7 @@ const base = JSON.parse(await globalThis.maltCreateAuthentication(json(state))) assert.equal(typeof base.handle, 'string') assert.equal(base.nodes, undefined) const delta = { - profile: 'malt.authentication-delta/1', + profile: 'malt.authentication-delta/2', changes: [{ label: encodeIndexLabel('255'), before: first, after: second }] } const next = JSON.parse(await globalThis.maltApplyAuthentication(text(base.handle), json(delta))) diff --git a/scripts/run-verifier-conformance.sh b/scripts/run-verifier-conformance.sh index e3474e2..54ceda7 100755 --- a/scripts/run-verifier-conformance.sh +++ b/scripts/run-verifier-conformance.sh @@ -22,6 +22,6 @@ fi for backend in all kzg ipa; do node "${repo_root}/scripts/run-authentication-wasm.mjs" verifier \ "${verifier_root}/malt-verifier.wasm" "${verifier_root}/wasm_exec.js" \ - "${malt_module_dir}/conformance/authentication-v2.json" "${backend}" + "${malt_module_dir}/conformance/authentication-v3.json" "${backend}" done printf 'malt-ts verifier passes the MALT %s conformance corpus.\n' "${malt_version}" diff --git a/scripts/run-writer-conformance.sh b/scripts/run-writer-conformance.sh index 0d5995f..62b044e 100755 --- a/scripts/run-writer-conformance.sh +++ b/scripts/run-writer-conformance.sh @@ -31,7 +31,7 @@ for profile in kzg direct compact fast; do wasm="${writer_root}/malt-writer-ipa-${profile}.wasm" profile_arg="${profile}" if [[ "${profile}" == kzg ]]; then backend=kzg; wasm="${writer_root}/malt-writer-kzg.wasm"; profile_arg=; fi - node "${repo_root}/scripts/run-authentication-wasm.mjs" writer "${wasm}" "${writer_root}/wasm_exec.js" "${malt_module_dir}/conformance/authentication-v2.json" "${backend}" + node "${repo_root}/scripts/run-authentication-wasm.mjs" writer "${wasm}" "${writer_root}/wasm_exec.js" "${malt_module_dir}/conformance/authentication-v3.json" "${backend}" node "${repo_root}/scripts/run-retained-writer-wasm.mjs" "${wasm}" "${writer_root}/wasm_exec.js" "${backend}" "${profile_arg}" node "${repo_root}/scripts/run-authentication-batch-wasm.mjs" "${wasm}" "${writer_root}/wasm_exec.js" "${backend}" "${profile_arg}" done diff --git a/scripts/run-writer-worker-smoke.mjs b/scripts/run-writer-worker-smoke.mjs index fd59e9f..c8a0895 100644 --- a/scripts/run-writer-worker-smoke.mjs +++ b/scripts/run-writer-worker-smoke.mjs @@ -61,15 +61,15 @@ try { const state = { descriptor: { layout: 1, derivation_profile: 4, vc_profile: backend === 'ipa' ? 2 : 1 }, entries: [] }; const base = JSON.parse(await writer.createAuthentication(backend, json(state))); const next = JSON.parse(await writer.applyAuthentication(backend, bytes(base.handle), json({ - profile: 'malt.authentication-delta/1', changes: [{ label: 'ZmlsZQ==', after: 'bafkqaaa' }] + profile: 'malt.authentication-delta/2', changes: [{ label: 'ZmlsZQ==', after: 'bafkqaaa' }] }))); assert.notEqual(next.root, base.root); const exported = JSON.parse(await writer.exportAuthentication(backend, bytes(next.handle))); const imported = JSON.parse(await writer.importAuthentication(backend, json(exported))); assert.equal(imported.root, next.root); - const batch = { profile: 'malt.authentication-batch/1', transaction_id: 'worker-smoke', base: base.root, root: next.root, candidates: [exported] }; + const batch = { profile: 'malt.authentication-batch/2', transaction_id: 'worker-smoke', base: base.root, root: next.root, candidates: [exported] }; const digest = await writer.validateAuthenticationBatch(backend, json(batch)); - const receipt = { profile: 'malt.authentication-receipt/1', transaction_id: batch.transaction_id, base: batch.base, root: batch.root, digest, durable_boundary: 'worker-smoke/0' }; + const receipt = { profile: 'malt.authentication-receipt/2', transaction_id: batch.transaction_id, base: batch.base, root: batch.root, digest, durable_boundary: 'worker-smoke/0' }; assert.equal(await writer.validateAuthenticationReceipt(backend, json(batch), json(receipt)), next.root); await assert.rejects(writer.validateAuthenticationReceipt(backend, json(batch), json({ ...receipt, root: base.root }))); // Queued export completes before close invalidates every retained handle. diff --git a/scripts/test-core-source.sh b/scripts/test-core-source.sh index 74cce27..df278de 100755 --- a/scripts/test-core-source.sh +++ b/scripts/test-core-source.sh @@ -41,14 +41,14 @@ cp "${go_root}/lib/wasm/wasm_exec.js" "${output}/writer/wasm_exec.js" cp "${go_root}/lib/wasm/wasm_exec.js" "${output}/verifier/wasm_exec.js" cp "${repo_root}/assets/writer/malt-writer-worker.mjs" "${repo_root}/assets/writer/malt-writer-workers.mjs" "${output}/writer/" node "${repo_root}/scripts/run-authentication-wasm.mjs" verifier "${output}/verifier/malt-verifier.wasm" \ - "${output}/verifier/wasm_exec.js" "${core_root}/conformance/authentication-v2.json" all + "${output}/verifier/wasm_exec.js" "${core_root}/conformance/authentication-v3.json" all for profile in kzg direct compact fast; do backend=ipa wasm="${output}/writer/malt-writer-ipa-${profile}.wasm" profile_arg="${profile}" if [[ "${profile}" == kzg ]]; then backend=kzg; wasm="${output}/writer/malt-writer-kzg.wasm"; profile_arg=; fi node "${repo_root}/scripts/run-authentication-wasm.mjs" writer "${wasm}" "${output}/writer/wasm_exec.js" \ - "${core_root}/conformance/authentication-v2.json" "${backend}" + "${core_root}/conformance/authentication-v3.json" "${backend}" node "${repo_root}/scripts/run-retained-writer-wasm.mjs" "${wasm}" "${output}/writer/wasm_exec.js" "${backend}" "${profile_arg}" node "${repo_root}/scripts/run-authentication-batch-wasm.mjs" "${wasm}" "${output}/writer/wasm_exec.js" "${backend}" "${profile_arg}" done diff --git a/src/release.mjs b/src/release.mjs index 298af1a..a1e3655 100644 --- a/src/release.mjs +++ b/src/release.mjs @@ -1,8 +1,8 @@ -export const maltTSVersion = '0.0.3-rc.4' +export const maltTSVersion = '0.0.3' export const maltCoreRelease = Object.freeze({ - version: 'v0.0.10-rc.4', - commit: '0d7b166d58d1c2e21ead96de9c66968caf630374', - moduleSum: 'h1:BpA7vH0LwKTmipTlAUu97CniBXTxBT9f5AQWV8UFbmY=', + version: 'v0.0.10', + commit: 'aaa78737c35f82fe91bb3f749cfddbcb7953ed2b', + moduleSum: 'h1:HgzuUot+AAKiLz20KdeUlnVDCVFHxfjQc7unsQOqm7Q=', goModSum: 'h1:o6L8K9vJp5hyrVo3fUtSsj0rvNpcboOcOb3nQwnR/gs=' }) diff --git a/src/verifier.mjs b/src/verifier.mjs index c19d08c..6fac6bd 100644 --- a/src/verifier.mjs +++ b/src/verifier.mjs @@ -1,4 +1,4 @@ -export const authenticationPathVerifierProfile = "malt.authentication/3" +export const authenticationPathVerifierProfile = "malt.authentication/5" export const defaultVerifierRuntimeURL = '/verifier/wasm_exec.js' export const defaultVerifierWASMURL = '/verifier/malt-verifier.wasm' diff --git a/test/authentication.test.mjs b/test/authentication.test.mjs index a9a1df1..edf3c7d 100644 --- a/test/authentication.test.mjs +++ b/test/authentication.test.mjs @@ -2,7 +2,7 @@ import { encodeIndexLabel } from '../src/coordinate.mjs' import { describe, it, expect } from 'vitest' import { createAuthenticationVerification, verifyAuthenticationLocally } from '../src/index.mjs' -const profile = 'malt.authentication/3' +const profile = 'malt.authentication/5' const request = { profile, root: 'caller-root', operation: 'binding', steps: [], label: encodeIndexLabel('18446744073709551615') } const result = { profile, resolved: 'caller-root', traversal: { steps: [] } } @@ -37,7 +37,7 @@ describe('typed authentication bridge', () => { }) it('binds path absence to the new request profile without reinterpreting steps', async () => { - const profile = 'malt.authentication/3' + const profile = 'malt.authentication/5' const q = { ...request, profile, operation: 'resolve', label: undefined, steps: ['bWlzc2luZw=='] } const proof = { profile, resolved: '', absent_step: '0', traversal: { results: [] } } @@ -46,14 +46,14 @@ it('binds path absence to the new request profile without reinterpreting steps', return JSON.stringify({ profile, valid: true }) } } expect((await verifyAuthenticationLocally({ request: q, result: proof, provider })).valid).toBe(true) - expect((await verifyAuthenticationLocally({ request: q, result: { ...result, profile: 'malt.authentication/2' }, provider })).valid).toBe(false) + expect((await verifyAuthenticationLocally({ request: q, result: { ...result, profile: 'malt.authentication/4' }, provider })).valid).toBe(false) }) it('rejects the retired query profile before calling WASM', async () => { let called = false const checked = await verifyAuthenticationLocally({ - request: { ...request, profile: 'malt.authentication/2' }, - result: { ...result, profile: 'malt.authentication/2' }, + request: { ...request, profile: 'malt.authentication/4' }, + result: { ...result, profile: 'malt.authentication/4' }, provider: { authentication() { called = true; throw new Error('unexpected call') } } }) expect(checked.valid).toBe(false) diff --git a/test/fixtures/portable-verifier-runtime.mjs b/test/fixtures/portable-verifier-runtime.mjs index ab9dca4..8ac292b 100644 --- a/test/fixtures/portable-verifier-runtime.mjs +++ b/test/fixtures/portable-verifier-runtime.mjs @@ -5,7 +5,7 @@ globalThis.Go = class { run() { globalThis.maltVerifierLoadedBackend = 'all' globalThis.maltDeriveCoordinate = () => '{"kind":"index","index":"0"}' - globalThis.maltVerifyAuthentication = () => '{"profile":"malt.authentication/3","valid":true}' + globalThis.maltVerifyAuthentication = () => '{"profile":"malt.authentication/5","valid":true}' globalThis.maltVerifierReady = true return new Promise(() => {}) } diff --git a/test/public-api.ts b/test/public-api.ts index b0e0034..35b788c 100644 --- a/test/public-api.ts +++ b/test/public-api.ts @@ -16,7 +16,7 @@ void maltWasmAssetsDirectory() void versionedWasmAssetsPlugin() const lease = createBrowserVerifierLease() void loadBrowserVerifier({ lease }).then(() => releaseBrowserVerifier(lease)) -void verifyAuthenticationLocally({ request: { profile: 'malt.authentication/3', root: 'root', operation: 'resolve', steps: [] }, result: {} }) +void verifyAuthenticationLocally({ request: { profile: 'malt.authentication/5', root: 'root', operation: 'resolve', steps: [] }, result: {} }) void createBrowserMaltWriter({ ipaPreference: 'auto' }) void createBrowserMaltWriter({}).then(async writer => { @@ -34,5 +34,5 @@ void createBrowserMaltWriter({}).then(async writer => { }) // @ts-expect-error retired query profiles are not accepted by the public verifier -const retiredQuery: import("../types/verifier").AuthenticationRequest = { profile: "malt.authentication/2", root: "root", operation: "resolve", steps: [] } +const retiredQuery: import("../types/verifier").AuthenticationRequest = { profile: "malt.authentication/4", root: "root", operation: "resolve", steps: [] } void retiredQuery diff --git a/test/verifier-worker.test.mjs b/test/verifier-worker.test.mjs index 57344e6..8684085 100644 --- a/test/verifier-worker.test.mjs +++ b/test/verifier-worker.test.mjs @@ -26,7 +26,7 @@ it('starts with only typed exports and rejects the retired artifact operation', worker.postMessage({ type: 'verify', id: 2, kind: 'authentication', json: '{}' }) expect((await current)[0]).toEqual({ type: 'result', id: 2, - result: '{"profile":"malt.authentication/3","valid":true}' + result: '{"profile":"malt.authentication/5","valid":true}' }) } finally { await worker.terminate() diff --git a/test/verifier.test.mjs b/test/verifier.test.mjs index 4d2f994..7770025 100644 --- a/test/verifier.test.mjs +++ b/test/verifier.test.mjs @@ -9,12 +9,12 @@ function typedRoot(codec, size) { function verification(from) { return JSON.stringify({ request: { - profile: 'malt.authentication/3', + profile: 'malt.authentication/5', root: from, operation: 'resolve', steps: ['ZG9jcw=='] }, result: { - profile: 'malt.authentication/3', + profile: 'malt.authentication/5', resolved: from, traversal: { results: [] } } }) @@ -304,7 +304,7 @@ describe('browser verifier workers', () => { it('passes an absent typed binding and the unchanged selected input to Core', async () => { const { verifyAuthenticationLocally } = await import('../src/verifier.mjs') - const q = { profile: 'malt.authentication/3', root: typedRoot(0x300104, 48), steps: [], operation: 'binding', label: 'bWlzc2luZw==' } + const q = { profile: 'malt.authentication/5', root: typedRoot(0x300104, 48), steps: [], operation: 'binding', label: 'bWlzc2luZw==' } const result = { profile: q.profile, resolved: q.root, binding: { present: false }, traversal: { results: [] } } const provider = { authentication: vi.fn(async (json) => { expect(JSON.parse(json)).toEqual({ request: q, result }) @@ -320,7 +320,7 @@ describe('browser verifier workers', () => { let receiver = 'not-called' function provider() { receiver = this - return JSON.stringify({ profile: 'malt.authentication/3', valid: true }) + return JSON.stringify({ profile: 'malt.authentication/5', valid: true }) } const result = await verifyAuthenticationLocally({ diff --git a/test/writer.test.mjs b/test/writer.test.mjs index 6457848..fabd339 100644 --- a/test/writer.test.mjs +++ b/test/writer.test.mjs @@ -696,7 +696,7 @@ it('routes retained authentication operations without sending a complete base ag }) const state = new TextEncoder().encode('{}') const internalHandle = new TextEncoder().encode('1') - const delta = new TextEncoder().encode('{"profile":"malt.authentication-delta/1","changes":[]}') + const delta = new TextEncoder().encode('{"profile":"malt.authentication-delta/2","changes":[]}') const created = JSON.parse(await writer.createAuthentication('kzg', state)) const handle = new TextEncoder().encode(created.handle) await writer.applyAuthentication('kzg', handle, delta) diff --git a/types/release.d.ts b/types/release.d.ts index d4a2b2d..a318d77 100644 --- a/types/release.d.ts +++ b/types/release.d.ts @@ -1,8 +1,8 @@ -export declare const maltTSVersion: '0.0.3-rc.4' +export declare const maltTSVersion: '0.0.3' export interface MaltCoreRelease { - readonly version: 'v0.0.10-rc.4' - readonly commit: '0d7b166d58d1c2e21ead96de9c66968caf630374' + readonly version: 'v0.0.10' + readonly commit: 'aaa78737c35f82fe91bb3f749cfddbcb7953ed2b' readonly moduleSum: string readonly goModSum: string } diff --git a/types/verifier.d.ts b/types/verifier.d.ts index 4eb8f99..c2781ce 100644 --- a/types/verifier.d.ts +++ b/types/verifier.d.ts @@ -43,7 +43,7 @@ export declare function releaseBrowserVerifier(lease: VerifierLease): void /** uint64 decimal strings and base64 bytes follow the normative Core schema. */ export type AuthenticationLabel = string export interface AuthenticationRequest extends JSONRecord { - profile: 'malt.authentication/3' + profile: 'malt.authentication/5' root: string steps?: AuthenticationLabel[] | null operation: 'resolve' | 'binding' | 'range' @@ -51,7 +51,7 @@ export interface AuthenticationRequest extends JSONRecord { start?: string end?: string } -export declare const authenticationPathVerifierProfile: 'malt.authentication/3' +export declare const authenticationPathVerifierProfile: 'malt.authentication/5' export declare function createAuthenticationVerification(options: { request: AuthenticationRequest; result: JSONRecord }): JSONRecord