DID SDK v1 to v2 Migration
This guide summarizes key migration points from the legacy SDK model to DID SDK 2.0.
Package Scope Changes
| Previous | Current |
|---|---|
|
|
Message Model Changes
DID SDK 2.0 replaces the previous event-style message set with a versioned envelope model:
| Legacy model | DID SDK 2.0 |
|---|---|
|
|
|
Represented as full-document updates through |
|
Represented as full-document updates through |
|
|
Registrar API Changes
Resolver Enhancements
resolveDID and dereferenceDID now support historical state resolution:
-
versionId(topic sequence number) -
versionTime(ISO 8601 timestamp)
If both are provided, versionId takes precedence.
Core Model Updates
Core message handling is proof-based in DID SDK 2.0:
-
DIDMessage.proofreplaces signature-centric wording -
setProof(…)replacessetSignature(…)behavior -
Error code uses
invalidProof
Core also exports validateDidDocument(…) for document-structure validation.
Recommended Migration Order
-
Migrate package imports to
@swiss-digital-assets-institute/*. -
Replace legacy messages with
CreateDidMessage/UpdateDidMessage/DeactivateDidMessage. -
Update registrar integrations to
updatedDidDocumentand proof-based CSM submit APIs. -
Add resolver versioning support where historical reads are needed.
-
Validate updated DID documents with
validateDidDocument(…)in integration boundaries.