Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 13 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ writer semantics independently in TypeScript.

## Version and Core release

The package asset binding is `0.0.6`, built against the published
`malt-core v0.0.11-rc.4` release at commit
`595f1e05aa86b0339addaa0f0e2ac6672faa8e00`.
The package asset binding is `0.0.7`, built against the published
`malt-core v0.0.12-rc.2` release at commit
`0c5dc0029bd89180f1ff9c8f87857c17aef6a094`.
[`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,
Expand Down Expand Up @@ -107,12 +107,11 @@ indices as eight unsigned big-endian bytes, and `encodeKeyLabel(Uint8Array)`
serializes Direct 32-byte keys. `deriveCoordinate({profile, label})` executes
Core derivation in the verifier Worker and returns a key or a bigint index.
JavaScript performs no label hashing or application path normalization.
Map layout 4 authenticates exact original label bytes and targets; distinct
labels at the same full coordinate are errors. Layout 1 is rejected without a
compatibility reader. Rebuild old Map state and its dependent parent Roots;
List remains layout 3 and Root V=0 is unchanged. Core rc.4 includes rc.3's
empty-cell scalar-zero encoding; roots and proofs from rc.2 or earlier must
be regenerated from original inputs, including dependent parent Roots.
Map layout 1 authenticates original label bytes and targets. Distinct labels at
the same full coordinate are errors. List layout 2 authenticates contiguous
indices. Both use Root V=0. When upgrading from layouts 4/3, rebuild both
kinds of tree from the original inputs, then rebuild dependent parents and
regenerate proofs. Complete candidates use `malt.authentication/6`.

`prepareAuthentication(backend, stateJSON)` builds a complete candidate.
`updateAuthentication(backend, candidateJSON, stateJSON)` verifies a complete
Expand Down Expand Up @@ -154,12 +153,12 @@ cancels pending operations; a subsequent request creates a new generation.
### Materialization batches and receipts

`validateAuthenticationBatch(backend, batchJSON)` verifies all candidates and
returns Core's digest of the exact `malt.authentication-batch/2` batch.
returns Core's digest of the exact `malt.authentication-batch/3` batch.
Candidates appear before parents and lineage successors. A bootstrap batch
includes its newly constructed base.

`validateAuthenticationReceipt(backend, batchJSON, receiptJSON)` checks the
`malt.authentication-receipt/2` transaction ID, base, final Root, digest and
`malt.authentication-receipt/3` transaction ID, base, final Root, digest and
durable boundary. It returns the final Root without modifying retained state.
Receipts acknowledge persistence; they neither prove a portable state
transition nor publish a head or grant client trust. Applications own durable
Expand All @@ -172,7 +171,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.11-rc.4` release. Its current host and batch APIs are bound to the
Core `v0.0.12-rc.2` 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.

Expand All @@ -192,7 +191,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-v3.json` corpus. All JavaScript/WASM runners live
`conformance/authentication-v4.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`.
Expand All @@ -211,4 +210,4 @@ The package uses root-only List 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.
release above and pass its `authentication-v4.json` conformance corpus.
10 changes: 5 additions & 5 deletions assets/verifier/PROVENANCE.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"schema": "malt.ts-verifier.provenance/v1",
"source_repository": "https://github.com/DeWebProtocol/malt-ts.git",
"build_inputs_sha256": "1df72aa516dc33125758c7491cbe493fb885a9bcc2effce57a302c52406ad861",
"build_inputs_sha256": "0c02f8be81cb7945052893c3e036a69f571be5b26b30478b1be9503df1be9734",
"core": {
"module_path": "github.com/dewebprotocol/malt-core",
"module_version": "v0.0.11-rc.4",
"module_version": "v0.0.12-rc.2",
"source_repository": "https://github.com/DeWebProtocol/malt-core.git",
"source_commit": "595f1e05aa86b0339addaa0f0e2ac6672faa8e00",
"module_sum": "h1:txnIBdjlVnQkPMUs6xxNwIEOoZxpQdJbmPDXkZbzgvM=",
"go_mod_sum": "h1:uAbiKECccmR8MlDotFWLdAgp+JFStdSn2SqA6ILEXhA="
"source_commit": "0c5dc0029bd89180f1ff9c8f87857c17aef6a094",
"module_sum": "h1:5KqS5FXrRkBHki+PO4dgDS2A5MlcgDQD9CBKHuuGAk0=",
"go_mod_sum": "h1:r3h6vMg1XN43S1N31hBrROPGP/w1+H5G4q3wiC3qL80="
},
"target": "js/wasm",
"exports": [
Expand Down
4 changes: 2 additions & 2 deletions assets/verifier/SHA256SUMS
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
fdc3af9dce8de3b322de1cad208c750351fe068892363ab1f8937486c062bf77 malt-verifier.wasm
033ca9d13ca8e9f3a869906e81ede973f24a609ff5425522cbd27e3fd6a3dd8a malt-verifier.wasm
0c949f4996f9a89698e4b5c586de32249c3b69b7baadb64d220073cc04acba14 wasm_exec.js
7be58669bd890583d02be4e621c828287b3aa72d18d06d912035e3ce73369622 PROVENANCE.json
5edabd01a0cbf30e6bd2e9001e120810e536a8c11a12f25e427a2c5124ff9131 PROVENANCE.json
Binary file modified assets/verifier/malt-verifier.wasm
Binary file not shown.
10 changes: 5 additions & 5 deletions assets/writer/PROVENANCE.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"schema": "malt.ts-writer.provenance/v1",
"source_repository": "https://github.com/DeWebProtocol/malt-ts.git",
"build_inputs_sha256": "1df72aa516dc33125758c7491cbe493fb885a9bcc2effce57a302c52406ad861",
"build_inputs_sha256": "0c02f8be81cb7945052893c3e036a69f571be5b26b30478b1be9503df1be9734",
"core": {
"module_path": "github.com/dewebprotocol/malt-core",
"module_version": "v0.0.11-rc.4",
"module_version": "v0.0.12-rc.2",
"source_repository": "https://github.com/DeWebProtocol/malt-core.git",
"source_commit": "595f1e05aa86b0339addaa0f0e2ac6672faa8e00",
"module_sum": "h1:txnIBdjlVnQkPMUs6xxNwIEOoZxpQdJbmPDXkZbzgvM=",
"go_mod_sum": "h1:uAbiKECccmR8MlDotFWLdAgp+JFStdSn2SqA6ILEXhA="
"source_commit": "0c5dc0029bd89180f1ff9c8f87857c17aef6a094",
"module_sum": "h1:5KqS5FXrRkBHki+PO4dgDS2A5MlcgDQD9CBKHuuGAk0=",
"go_mod_sum": "h1:r3h6vMg1XN43S1N31hBrROPGP/w1+H5G4q3wiC3qL80="
},
"target": "js/wasm",
"exports": [
Expand Down
10 changes: 5 additions & 5 deletions assets/writer/SHA256SUMS
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
b9a9de50f0dc945454f0e3f7e77b720d885747398cca3cf6b7ea4e80b4abfb86 malt-writer-kzg.wasm
e5432d306116fa54c21ebd78fcf320f2a6cef6f63259e2600573aa9dba0381b5 malt-writer-ipa-direct.wasm
e78d4fc1ac43c3e1b8bef261b7c8aa1b23442976e13fea28f33af1b9744702ab malt-writer-ipa-compact.wasm
8d57eada1383a1f65ab678434d721f9dd5f4f4cd43024231234f2c413cb7d14d malt-writer-ipa-fast.wasm
c58f5cbd99e10696d40eceab73d3b73ac611e803a91e9d380353d24fcabd30c2 malt-writer-kzg.wasm
0988b89dcd34b49467eb67bd4196e8bf35560f4e08faefeb416e4d9b904a9d58 malt-writer-ipa-direct.wasm
16e853f8fed1e56a732bacbf5d8d56be21948f73e1ea2127b9d12ec6070dc7bc malt-writer-ipa-compact.wasm
adc75674e1a6551e5a65782ebb90ff87968418b61906027e8da8cc5925f72fee malt-writer-ipa-fast.wasm
6311876a80f3c9333f20e6a8ae8b55b7235b1f7411d6ae2224bc90b55fe779a2 malt-writer-worker.mjs
968657d9a8818feb23b6463aca609478c81423a93a8b0dc453705ad009214db0 malt-writer-workers.mjs
0c949f4996f9a89698e4b5c586de32249c3b69b7baadb64d220073cc04acba14 wasm_exec.js
4440c9b6048ed8b77eba3030c81c1fa669359e558f0938ce50dc90479e0e92d3 PROVENANCE.json
0af41b0801049ead574a91853763465bbedf19c0e049cc96b6db781253e70569 PROVENANCE.json
Binary file modified assets/writer/malt-writer-ipa-compact.wasm
Binary file not shown.
Binary file modified assets/writer/malt-writer-ipa-direct.wasm
Binary file not shown.
Binary file modified assets/writer/malt-writer-ipa-fast.wasm
Binary file not shown.
Binary file modified assets/writer/malt-writer-kzg.wasm
Binary file not shown.
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module github.com/dewebprotocol/malt-ts

go 1.26.8

require github.com/dewebprotocol/malt-core v0.0.11-rc.4
require github.com/dewebprotocol/malt-core v0.0.12-rc.2

require (
github.com/bits-and-blooms/bitset v1.25.0 // indirect
Expand All @@ -19,7 +19,7 @@ require (
github.com/multiformats/go-varint v0.1.0 // indirect
github.com/spaolacci/murmur3 v1.1.0 // indirect
golang.org/x/crypto v0.57.0 // indirect
golang.org/x/sync v0.24.0 // indirect
golang.org/x/sys v0.49.0 // indirect
golang.org/x/sync v0.25.0 // indirect
golang.org/x/sys v0.50.0 // indirect
lukechampine.com/blake3 v1.4.1 // indirect
)
12 changes: 6 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ github.com/consensys/gnark-crypto v0.22.0 h1:RYH7FX1/zkmNrSiABo70HAqew41SRUsoluK
github.com/consensys/gnark-crypto v0.22.0/go.mod h1:HL8XflRG4cvau1PEG3CWBTD2kkzUzdlqZF6BBgy57F8=
github.com/crate-crypto/go-kzg-4844 v1.1.0 h1:EN/u9k2TF6OWSHrCCDBBU6GLNMq88OspHHlMnHfoyU4=
github.com/crate-crypto/go-kzg-4844 v1.1.0/go.mod h1:JolLjpSff1tCCJKaJx4psrlEdlXuJEC996PL3tTAFks=
github.com/dewebprotocol/malt-core v0.0.11-rc.4 h1:txnIBdjlVnQkPMUs6xxNwIEOoZxpQdJbmPDXkZbzgvM=
github.com/dewebprotocol/malt-core v0.0.11-rc.4/go.mod h1:uAbiKECccmR8MlDotFWLdAgp+JFStdSn2SqA6ILEXhA=
github.com/dewebprotocol/malt-core v0.0.12-rc.2 h1:5KqS5FXrRkBHki+PO4dgDS2A5MlcgDQD9CBKHuuGAk0=
github.com/dewebprotocol/malt-core v0.0.12-rc.2/go.mod h1:r3h6vMg1XN43S1N31hBrROPGP/w1+H5G4q3wiC3qL80=
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=
Expand Down Expand Up @@ -34,10 +34,10 @@ go.yaml.in/yaml/v3 v3.0.5 h1:N6y/pJk8buWs9NY5ERU2HSMfm+IuD/OtfdAnq6kESPw=
go.yaml.in/yaml/v3 v3.0.5/go.mod h1:HVTZu1O7/Vkt2N+BFy8Zza+lnLsABggaTM2ZpNIGuKg=
golang.org/x/crypto v0.57.0 h1:3ZVCjf8Ggz7zneR/EHRVx68Ctf+2pmIMP2UFhh9cC6M=
golang.org/x/crypto v0.57.0/go.mod h1:Fdz0i5U6CoizGwLda9DttjSk6qlZo25zYNtR+ycvuZA=
golang.org/x/sync v0.24.0 h1:iqiDrGoDgyuvAKrhLQthUEzU/R378N78gXbBjxed7oA=
golang.org/x/sync v0.24.0/go.mod h1:sUUOizhqBxiL6pEWpqNLUiaJn1ShEbZ6BBqskPbjZm0=
golang.org/x/sys v0.49.0 h1:XbzkgYJHdqh/8m2Uu0W/dQv8nktxx4BFHp1M0gROTXA=
golang.org/x/sys v0.49.0/go.mod h1:hNLxWAXmnKAxqDtdwIYC4bM9oQPEecfsnNMuSxOs3og=
golang.org/x/sync v0.25.0 h1:dJnifr0nMV8/SBnBvdo4eSGGnrc3O4FFx6IqvtLcmRs=
golang.org/x/sync v0.25.0/go.mod h1:sUUOizhqBxiL6pEWpqNLUiaJn1ShEbZ6BBqskPbjZm0=
golang.org/x/sys v0.50.0 h1:dkKZEFTEKaLr1sjhs0WiKqoi8Jj5nHbS3Njmx1UoMJs=
golang.org/x/sys v0.50.0/go.mod h1:hNLxWAXmnKAxqDtdwIYC4bM9oQPEecfsnNMuSxOs3og=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
lukechampine.com/blake3 v1.4.1 h1:I3Smz7gso8w4/TunLKec6K2fn+kyKtDxr/xcQEN84Wg=
Expand Down
8 changes: 4 additions & 4 deletions malt-core.lock.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"schema": "malt.ts-core-lock/v2",
"module_path": "github.com/dewebprotocol/malt-core",
"module_version": "v0.0.11-rc.4",
"module_version": "v0.0.12-rc.2",
"source_repository": "https://github.com/DeWebProtocol/malt-core.git",
"source_commit": "595f1e05aa86b0339addaa0f0e2ac6672faa8e00",
"module_sum": "h1:txnIBdjlVnQkPMUs6xxNwIEOoZxpQdJbmPDXkZbzgvM=",
"go_mod_sum": "h1:uAbiKECccmR8MlDotFWLdAgp+JFStdSn2SqA6ILEXhA="
"source_commit": "0c5dc0029bd89180f1ff9c8f87857c17aef6a094",
"module_sum": "h1:5KqS5FXrRkBHki+PO4dgDS2A5MlcgDQD9CBKHuuGAk0=",
"go_mod_sum": "h1:r3h6vMg1XN43S1N31hBrROPGP/w1+H5G4q3wiC3qL80="
}
4 changes: 2 additions & 2 deletions node-tests/malt-writer-workers.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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/4"}' });
assert.equal(await bootstrap, '{"profile":"malt.authentication/4"}');
worker.respond(bootstrapRequest, { result: '{"profile":"malt.authentication/6"}' });
assert.equal(await bootstrap, '{"profile":"malt.authentication/6"}');

const invalidLoad = writer.importAuthentication("kzg", new Uint8Array([1]));
const invalidRequest = await worker.nextRequest();
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dewebprotocol/malt",
"version": "0.0.6",
"version": "0.0.7",
"description": "Stable TypeScript and browser WASM SDK for MALT",
"type": "module",
"license": "Apache-2.0",
Expand Down
4 changes: 2 additions & 2 deletions scripts/build-wasm-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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-v3.json" | awk '{print $1}')"
authentication_corpus_sha256="$(sha256sum "${core_module_dir}/conformance/authentication-v4.json" | awk '{print $1}')"

chmod 0644 "${verifier_staging}/"* "${writer_staging}/"*
(
Expand Down Expand Up @@ -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/3", sha256: process.env.AUTHENTICATION_CORPUS_SHA256},
authentication: {schema: "malt.conformance.authentication/4", sha256: process.env.AUTHENTICATION_CORPUS_SHA256},
},
codegen_environment: {CGO_ENABLED: "0", GOEXPERIMENT: "none", GOWASM: "", GOFIPS140: "off"},
components: {verifier: component("VERIFIER"), writer: component("WRITER")}
Expand Down
4 changes: 2 additions & 2 deletions scripts/check-wasm-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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-v3.json" | awk '{print $1}')"
expected_authentication_corpus_sha256="$(sha256sum "${core_module_dir}/conformance/authentication-v4.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)"
Expand Down Expand Up @@ -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/3", sha256: process.env.AUTHENTICATION_CORPUS_SHA256},
authentication: {schema: "malt.conformance.authentication/4", 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" ||
Expand Down
10 changes: 5 additions & 5 deletions scripts/run-authentication-batch-wasm.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ assert.equal(globalThis.maltWriterLoadedBackend, backend)
assert.equal(globalThis.maltWriterLoadedProfile, profile)
for (const name of ['maltComputeClientRootV1', 'maltWriterBootstrapSessionV1', 'maltWriterLoadSessionV1', 'maltWriterPrepareSessionV1', 'maltWriterValidateReceiptV1']) assert.equal(globalThis[name], undefined)
const json = value => new TextEncoder().encode(JSON.stringify(value))
const state = { descriptor: { layout: 4, derivation_profile: 4, vc_profile: backend === 'ipa' ? 2 : 1 }, entries: [] }
const state = { descriptor: { layout: 1, derivation_profile: 4, vc_profile: backend === 'ipa' ? 2 : 1 }, entries: [] }
const base = JSON.parse(await globalThis.maltPrepareAuthentication(json(state)))
state.entries.push({ label: 'ZmlsZQ==', target: { '/': 'bafkqaaa' } })
const next = JSON.parse(await globalThis.maltUpdateAuthentication(json(base), json(state)))
Expand All @@ -35,15 +35,15 @@ const noOp = JSON.parse(await globalThis.maltExportAuthentication(new TextEncode
for (const candidate of [unchanged, noOp]) {
assert.equal(candidate.root, next.root)
assert.equal(candidate.previous, next.previous)
const noOpBatch = { profile: 'malt.authentication-batch/2', transaction_id: 'no-op', base: next.root, root: next.root, candidates: [candidate] }
const noOpBatch = { profile: 'malt.authentication-batch/3', 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/2', 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/3', 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/2', transaction_id: 'wasm-batch', base: base.root, root: next.root, candidates: [base, next] }
const batch = { profile: 'malt.authentication-batch/3', 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/2', transaction_id: batch.transaction_id, base: batch.base, root: batch.root, digest, durable_boundary: 'wasm-test/0' }
const receipt = { profile: 'malt.authentication-receipt/3', 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]: '' })))
Expand Down
2 changes: 1 addition & 1 deletion scripts/run-authentication-router-smoke.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const writer = await createBrowserMaltWriter({
const bytes = value => new TextEncoder().encode(value)
const json = value => bytes(JSON.stringify(value))
const state = {
descriptor: { layout: 3, derivation_profile: 3, vc_profile: 2 },
descriptor: { layout: 2, derivation_profile: 3, vc_profile: 2 },
entries: [{ label: encodeIndexLabel('0'), target: { '/': 'bafkqaaa' } }]
}
try {
Expand Down
Loading
Loading