Publish DID
When a DID serves as an identity identifier, it's usually necessary to publish this DID first so that the verifier can analyze and verify it conveniently. The publication of DIDs includes initial creation and updating:
Create: to publish the newly created DID to the ID sidechain for the first time
Update: to update the previously published DID
The DID SDK will automatically construct the corresponding ID transaction according to the state of DID in the chain. The constructed ID transaction needs to be signed with the valid key of DID, which means that only the controller of this DID can publish it to the chain. Here's an example of creating and publishing a new DID:
By default, the published DID is signed by the default authentication key corresponding to this DID. In the above example, the transaction is signed by the default key - this is also the mode used by most applications. If a DID sets multiple authentication keys and specifies one to sign the transaction, then the ID of the target key can be specified in the publishing method, and the PrivateKey corresponding to this key is required to be in the DIDStore where DIDDocument is located. For example:
The publish operation when updating DID is the same as that when creating DID. The DID SDK will automatically process the transaction type according to the DID status on the chain. Below is an example of updating a published DID document object:
The publication of customized DIDs is similar to that of ordinary DIDs, and the published transaction can be signed by the valid authentication key or declared authentication key of any controller. For example:
The publish operation in the above example is similar to the publishing of ordinary DID. Alternatively, you can specify the valid authentication key of the current controller to sign the transaction.
Transfer the document and publish it to the chain
Create TransferTicket in the first place
Parameter did: for DID to be transferred
to: did that accepts the transfer (to whom)
storePassword: local private key/encrypted password
Every DID document has a validity period. In principle, the DID will be invalid after it expires, so it's necessary to update the DID document, prolong the validity period, and publish it before the expiration. Besides, the deactivated DID is permanently invalid, which cannot be updated or published.
Last updated