DID

JavaScript Decentralized Identity APIs

Get DID list

NameParameters DescriptionResponse

getDIDList(address)

address: wallet address

data: a list of DID

Create a DID

NameParameters DescriptionResponse

createDID(address)

address: wallet address

  • DID: user DID (new one if none existed)

  • message: message to be signed

  • updated:updated time

Query DID information

NameParameters DescriptionResponse

queryDIDDetail(DID)

did: DID string

  • controllers: DID controller information

  • public_keys: device public key

  • current_public_key: public key

Save DID information

NameParameters DescriptionResponse

saveDID(DID, data)

  • DID: DID string

  • data:

    • signature: signature of the signed message (derived by web3.eth.personal.sign method)

    • operation: create, link, unlink, link_key, unlink_key

    • ids: an array of DID strings needed for unlink and unlink_key operation. Unecessary for the create, link and link_public operation.

    • address: a blockchain-specific wallet address needed for the link and create operation, e.g., did:pkh:eip155:1:wallet_address.

    • updated: time of the update

message

Update the DID

NameParameters DescriptionResponse

updateDID(DID, data)

  • DID: DID string

  • data:

    • ids: the DID ids.

    • address: a blockchain-specific wallet address needed for the link and create operation, e.g., did:pkh:eip155:1:wallet_address.

  • updated:updated time

  • message: message to be signed

  • DID: user DID (new one if none existed)

Resolve DID

NameParameters DescriptionResponse

resolveDID(DID)

DID: DID string

N/A

Get DID login information

NameParameters DescriptionResponse

preDIDLogin(DID)

DID: DID string

  • DID: user DID (new one if none existed)

  • message: message to be signed

  • updated: updated time

DID Login

NameParameters DescriptionResponse

DIDLogin(data)

data:

  • type: type of login, default set to m.login.did.identity

  • updated: the updated time returned by preDiDLogin(did)

  • device_id: device id (omit this field for a new device)

  • identifier: login information

    • DID: user DID

    • token: sign the message returned by preDiDLogin(did) withetherum.Sign(accounts.TextHash(message), privateKey) orpersonal_sign from metamask, then perform a base16 encoding.

  • access_token: the access token

  • user_id: user id

  • device_id: device id

Last updated