Skip to content

feat(did): complete DID document management and VC issuance endpoints#413

Merged
DevMuhdishaq merged 1 commit into
StelTade:mainfrom
devwums:feat/did-verifiable-credentials-399
Jun 24, 2026
Merged

feat(did): complete DID document management and VC issuance endpoints#413
DevMuhdishaq merged 1 commit into
StelTade:mainfrom
devwums:feat/did-verifiable-credentials-399

Conversation

@devwums

@devwums devwums commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Summary

Completes the DID & Verifiable Credentials system by wiring up the missing controller endpoints and building W3C-compliant DID document resolution.

Changes

did.controller.ts

  • POST /api/did/register - register a new DID with its secp256k1 public key and return a W3C DID document
  • GET /api/did/document/:did - resolve any registered DID to its W3C Core-compliant document
  • POST /api/did/credentials/issue - issue a KYC verifiable credential (delegates to VcIssuerService)
  • PATCH /api/did/credentials/:id/revoke - revoke an active credential
  • Grouped endpoints by concern (DID document management / authentication / credentials / ZKP)

did-auth.service.ts

egisterDid(did, publicKey) - persists the DID document, throws ConflictException on duplicate registration

esolveDidDocument(did) - returns
ull if the DID is unknown (controller maps this to 404)

  • �uildW3cDocument() - private helper that constructs the W3C DID document with @context, �erificationMethod, �uthentication, and �ssertionMethod fields (EcdsaSecp256k1VerificationKey2019)

Acceptance criteria addressed

  • ? Users can create and manage DID identities (POST /register, GET /document/:did)
  • ? KYC credentials are issued as verifiable credentials (POST /credentials/issue)
  • ? ZKP verification enables privacy-preserving checks (existing POST /verify-proof, unchanged)
  • ? DID-based authentication works alongside traditional JWT (existing challenge/verify flow, unchanged)
  • ? DID documents are available on standard resolvers (W3C DID Core format returned by GET /document/:did)

closes #399

- Add POST /api/did/register to anchor a DID with its public key and return a W3C DID document
- Add GET /api/did/document/:did to resolve a W3C Core-compliant DID document
- Add POST /api/did/credentials/issue to issue KYC verifiable credentials
- Add PATCH /api/did/credentials/:id/revoke to revoke credentials
- Expose buildW3cDocument helper in DidAuthService with @context, verificationMethod, authentication, and assertionMethod fields
- Group controller endpoints by concern (document management, auth, credentials, ZKP)
@DevMuhdishaq
DevMuhdishaq merged commit fb1d0dc into StelTade:main Jun 24, 2026
1 of 3 checks passed
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.

DID & Verifiable Credentials System

2 participants