This repository describes how to transform legacy dids and did documents to qualified did:peer:2 and did:peer:3 dids and did documents.
In this transformation, the legacy did document is called legacyDidDocument
.
did
and assign it the initial string value did:peer:2
.authenticationFingerprints
.authentication
list from the legacyDidDocument
and for each of the entries perform the following steps:
type
property in the entry is Ed25519SignatureAuthentication2018
and the entry contains a publicKey
publicKey
property from the publicKey
list in the legacyDidDocument
to a value named resolvedLegacyAuthentication
.publicKey
, an error must be thrown and the process must be aborted, otherwise continue with step 2.4type
property is Ed25519Signature2018
, assign the value of the entry to resolvedLegacyAuthentication
and continue with step 2.4publicKeyBase58
property in resolvedLegacyAuthentication
and assign this to the the property fingerprint
.fingerprint
value to the authenticationFingerprints
list.publicKey
list from the legacyDidDocument
and for each of the entries perform the following steps:
type
property is not Ed25519Signature2018
ignore the entry and continue with the next entry.publicKeyBase58
property in the entry and assign this to the the property fingerprint
.fingerprint
already exists in the list authenticationFingerprints
ignore the entry and continue with the next entry.fingerprint
value to the authenticationFingerprints
list.authenticationFingerprints
list perform the following steps:
.V
and the fingerprint
to the did
property.service
list from the legacyDidDocument
and for each of the entries perform the following steps:
type
property is not IndyAgent
ignore the entry and continue with the next entry.service
and assign it the following properties (in alphabetical order). If your language does not support ordered objects, you can use
priority
based on the priority
property from the entry.r
based no the routingKeys
property from the entry.recipientKeys
based on the recipientKeys
property from the entry.s
based on the serviceEndpoint
property from the entry.t
based on the type
property from the entry.did:peer:2
service encoding algorithm from the spec and append the final value to the did
property.See the test vectors directory for examples of the transformation.
git clone https://github.com/TimoGlastra/legacy-did-transformation
cd legacy-did-transformation
yarn install
yarn convert <path-to-legacy-did-document>
IndyAgent
)?