Skip to content

refactor: replace @transmute with digitalbazaar#6230

Open
Pyatakov wants to merge 12 commits into
developfrom
refactor/replace-transmute-with-digitalbazaar
Open

refactor: replace @transmute with digitalbazaar#6230
Pyatakov wants to merge 12 commits into
developfrom
refactor/replace-transmute-with-digitalbazaar

Conversation

@Pyatakov

Copy link
Copy Markdown
Contributor

Description

Replace six abandoned @transmute/0.7.0-unstable.80 prereleases with actively maintained @digitalbazaar equivalents in common and mrv-sender. The transmute packages never reached a stable release and are no longer maintained.

  • Replace @transmute/vc.js with @digitalbazaar/vc; rename call sites (createVerifiableCredentialissue, createVerifiablePresentationsignPresentation, verifyVerifiableCredentialverifyCredential)
  • Replace @transmute/ed25519-signature-2018 with @digitalbazaar/ed25519-signature-2018 + @digitalbazaar/ed25519-verification-key-2018
  • Replace @transmute/credentials-context with @digitalbazaar/credentials-context
  • Replace @transmute/did-context with did-context (digitalbazaar, unscoped)
  • Replace @transmute/security-context with @digitalbazaar/security-context
  • Remove @transmute/jsonld-schema; vendor schemasToContext in-tree as common/src/helpers/jsonld-schema/schemas-to-context-impl.ts (Apache-2.0 source)
  • Vendor the https://w3id.org/security/bbs/v1 JSON-LD context, served for both its published URLs, to keep the existing BBS verification path resolvable without the transmute security-context alias
  • Add ambient type declarations for @digitalbazaar/* packages in common and mrv-sender
  • Adapt the Ed25519 verification document loader so credentials signed by the previous stack still verify: the digitalbazaar suite requires the suite context on the resolved verification method and authorizes by absolute assertionMethod id
  • Gate Encrypted Verifiable Credential (BbsBlsSignature2020) signing with a clear error pending the BBS cryptosuite migration; the Ed25519 path is unaffected
  • Extract the schema validation result into its own SchemaValidationResult class and type the @digitalbazaar/vc verification result
  • Add tests: Ed25519 sign/verify, backward-compatible verification of a credential from the previous stack, and tamper rejection; fidelity of the vendored schemasToContext and BBS context against the previous stack; property-embedding extraction and the schema.org/text @id@type rewrite

@Pyatakov Pyatakov requested review from a team as code owners June 15, 2026 14:54
@Pyatakov Pyatakov self-assigned this Jun 15, 2026
@github-actions

github-actions Bot commented Jun 15, 2026

Copy link
Copy Markdown

Test Results

  3 files   -  29  123 suites  +59   0s ⏱️ - 7m 39s
530 tests +495  530 ✅ +495  0 💤 ±0  0 ❌ ±0 
530 runs  +365  530 ✅ +365  0 💤 ±0  0 ❌ ±0 

Results for commit 3ceba1b. ± Comparison against base commit 7aa6ff0.

♻️ This comment has been updated with latest results.

@Pyatakov Pyatakov force-pushed the refactor/replace-transmute-with-digitalbazaar branch from 646710e to 1e97a64 Compare June 19, 2026 09:52
Pyatakov added 10 commits June 19, 2026 22:14
The @transmute/0.7.0-unstable.80 packages are abandoned prereleases
with no stable release. Replace them with actively maintained
@digitalbazaar equivalents. Vendor schemasToContext and the BBS
JSON-LD context in-tree to remove the last two transmute deps.

Signed-off-by: Alex Piatakov <alex.piatakov@swirldslabs.com>
The @digitalbazaar/ed25519-signature-2018 suite requires the resolved
verification method to carry the suite context and authorizes the
controller by absolute assertionMethod id. Guardian DID documents use
only the did/v1 context with relative assertionMethod refs, so Ed25519
credential verification failed under the new stack (no test caught it,
as the existing suite never calls verify).

Wrap the document loader in the Ed25519 verify branch to serve the suite
context, return the verification method as a key node carrying it, and
resolve assertionMethod refs to absolute ids. The BBS path is untouched.

Add a signing/verification test backed by a credential signed with the
previous stack to lock in backward compatibility.

Signed-off-by: Alex Piatakov <alex.piatakov@swirldslabs.com>
Migrating off @transmute removes the jsonld-signatures@7 that the
archived @mattrglobal BBS suites require, so BbsBlsSignature2020 signing
(used automatically for EVC schemas) breaks under the new stack with a
cryptic library error.

Gate EVC issuance at the schema->signature-type decision with a clear,
intentional error until the BBS cryptosuite migration restores the path
(tracked as a follow-up). Ed25519 issuance and verification are
unaffected.

Signed-off-by: Alex Piatakov <alex.piatakov@swirldslabs.com>
Add fidelity tests pinning the in-tree vendored schemasToContext and the
vendored bls12381-2020-v1 (BBS) context to the output the previous
@transmute implementation produced. Schema-context output is baked into
published credentials and BBS verification is canonicalization-sensitive,
so this catches silent drift in the vendored copies.

Signed-off-by: Alex Piatakov <alex.piatakov@swirldslabs.com>
- Extract the schema validation result class out of the vendored
  schemasToContext module into SchemaValidationResult (own file)
- Type the @digitalbazaar/vc verification result (VerificationResult)
- Rename the vc lib import alias from vcjs to vcLib to avoid clashing
  with the VCJS class
- Note that signPresentation expects an already-formed VP

Signed-off-by: Alex Piatakov <alex.piatakov@swirldslabs.com>
- Document the two-URL BBS context alias in the default loader
- Document the schema.org/text @id->@type rewrite in schemasToContext
- Test property-embedding extraction: homogeneous $comment maps
  correctly, a mixed embedding attribute throws
- Test the schema.org/text @id->@type rewrite

Signed-off-by: Alex Piatakov <alex.piatakov@swirldslabs.com>
Reference the verification result type through the vcLib namespace
import instead of a second named import (no-duplicate-imports).

Signed-off-by: Alex Piatakov <alex.piatakov@swirldslabs.com>
The vendored schemasToContext (ported from @transmute) detected a
property's embedding via its own attribute but always extracted using
the class's, crashing on a property whose embedding attribute differs
from the class's. Extract using the property's own attribute.

Output is byte-identical for schemas that use a single embedding
attribute throughout (all Guardian schemas) - the fidelity test still
matches the previous implementation. Updates the extraction test to
cover the mixed-attribute case.

Signed-off-by: Alex Piatakov <alex.piatakov@swirldslabs.com>
Signed-off-by: Alex Piatakov <alex.piatakov@swirldslabs.com>
Signed-off-by: Alex Piatakov <alex.piatakov@swirldslabs.com>
@Pyatakov Pyatakov force-pushed the refactor/replace-transmute-with-digitalbazaar branch from e01637d to 9d17c8e Compare June 19, 2026 21:15
Pyatakov added 2 commits June 19, 2026 23:04
The geojson test esmocked @transmute/jsonld-schema, removed by the
migration. Repoint the mock to the vendored schemas-to-context-impl.

Signed-off-by: Alex Piatakov <alex.piatakov@swirldslabs.com>
Drop the -impl suffix (a Java-ism); the jsonld-schema/ folder already
signals the vendored module, so index.ts reads as its entry point.

Signed-off-by: Alex Piatakov <alex.piatakov@swirldslabs.com>
@Pyatakov Pyatakov force-pushed the refactor/replace-transmute-with-digitalbazaar branch from a09e284 to 3ceba1b Compare June 19, 2026 22:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant