DCKA-5494 normalize cheqd DID documents from universal resolver so BB…#538
Merged
Merged
Conversation
…S+ keys are verifiable The universal resolver fallback returns cheqd offchain (BBS+) keys as JSON-stringified blobs in assertionMethod instead of proper objects in verificationMethod, leaving publicKeyBase58 unreachable for BBS+ verification. Normalize resolved documents before caching to lift these inline keys into verificationMethod, matching the on-chain resolver behaviour.
maycon-mello
force-pushed
the
DCKA-5494-fix-uniresolver-bbs-keys
branch
from
May 29, 2026 18:11
b296e25 to
f1b106a
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Normalizes DID documents returned by the universal resolver so that cheqd offchain BBS+ keys—delivered as JSON-stringified blobs inside verification relationship arrays—are lifted into verificationMethod objects, matching the on-chain resolver's shape. This fixes downstream consumers (e.g., jsonld.frame) that need to read publicKeyBase58 from a real verification method.
Changes:
- Adds
normalizeDIDDocumenthelper that unwraps double-JSON-stringified verification method blobs from relationship arrays intoverificationMethod, replacing the inlined entry with the method'sid. - Applies the normalization in
CachedDIDResolverfor both initial resolve and background refresh paths so cached values are consistent. - Adds integration tests verifying BBS+ keys are reachable via both the fallback (universal) and on-chain resolvers.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/wasm/src/services/blockchain/normalize-did-document.ts | New normalization helper that lifts inline BBS+ verification methods out of relationship arrays. |
| packages/wasm/src/services/blockchain/cached-did-resolver.ts | Wraps resolver results with normalizeDIDDocument on resolve and background refresh. |
| integration-tests/did-resolution.test.ts | Adds tests asserting BBS+ key reachability through both resolver paths. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
mike-parkhill
approved these changes
Jun 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.