DID
iOS Decentralized Identity APIs
1. Check if an Address has a SendingNetwork DID
Input Parameters:
Name | Type | Description | Required |
---|---|---|---|
address | NSString | wallet address | true |
Output Parameters:
MXDIDListResponse
Name | Type | Description | Required |
---|---|---|---|
array | NSString | list of DIDs | False |
2. Log into a DID or Register an Address
If the returned array is empty, log in using the wallet address; otherwise, use the first element of the array as the 'did' parameter.
Input Parameters:
Name | Type | Description | Required |
---|---|---|---|
| NSString | wallet address | false |
| NSString | user DID | false |
Output Parameters:
Name | Type | Description | Required |
---|---|---|---|
| NSString | user DID (existing or newly created) | true |
| NSString | message to be signed | true |
| NSString | update time | true |
| NSString | random number generated by the DID node | true |
3. Sign the Message Returned
Input Parameters: parameter
Name | Type | Description | Required |
---|---|---|---|
type | NSString | Login type (e.g., | true |
updated | NSString | update time returned by the | true |
identifier | IdentifierModel | login information | true |
device_id | NSString | device id, not needed for a new device | false |
random_server | NSString | returned by postPreLoginDID | true |
IdentifierModel
Type:
Name | Type | Description |
---|---|---|
did | NSString | user DID |
token | NSString | Token used to sign the message returned by |
Output Parameters:
MXDIDLoginResponse
Name | Type | Description | Required |
---|---|---|---|
access_token | NSString | access token | true |
user_id | NSString | user ID | true |
device_id | NSString | device id | true |
The login process and APIs described below are deprecated. Please avoid using them.
(Deprecated) DID login process:
Get DID list. If the list is empty, register a decentralized identity. Otherwise, call
pre_login
in step 4 to log in to an existing DID.Create a DID document with the current wallet address by calling the
DIDCreate
method.Sign the message returned in step 2 and call the
DIDSave
method.Call
pre_login
to get the message to be signed.Sign the message returned in step 4 and use the signature to log in to DID with
postLoginDID
method.
(Deprecated) Get DID list
Parameters:
Name | Type | Description | Required |
---|---|---|---|
| string | Wallet address | true |
Returns:
Name | Type | Description | Required |
---|---|---|---|
| string array | User DID list | true |
(Deprecated) Get DID information
Parameters:
Name | Type | Description | Required |
---|---|---|---|
| string | DID string from the | true |
Returns:
Name | Type | Description | Required |
---|---|---|---|
| Json | controller information | true |
| string | current device's public key | true |
| Json | public key information | true |
controllers
and public_keys
type:
Name | Type | Description |
---|---|---|
| string |
|
| string | wallet address or public key |
| string | public key id |
(Deprecated) Create DID
Parameters:
Name | Type | Description | Required |
---|---|---|---|
| string | wallet address with blockchain information like | true |
Returns:
Name | Type | Description | Required |
---|---|---|---|
| string | user DID (existing or newly created) | true |
| string | message to be signed | true |
| string | update time | true |
(Deprecated) Save DID information
Parameters:
Name | Type | Description | Required |
---|---|---|---|
| string | DID string | true |
Parameters:
Name | Type | Description | Required |
---|---|---|---|
| string | sign the message with web3.eth.personal.sign method | true |
| string | create, link, unlink, link_key, unlink_key | true |
| string array | the DID URL of unlink, unlink_key; unnecessary in create, link, link_publick operation | false |
| string | wallet address (with blockchain-specific prefix, e.g., eip155:1 ) in link, create operation | true |
| string | updated time returned by | true |
Message Prefix
operation | Type | Message |
---|---|---|
| string |
|
| string |
|
| string |
|
| string |
|
| string |
|
(Deprecated) Update DID
Parameters:
Name | Type | Description | Required |
---|---|---|---|
| string | DID string | true |
POST Body
Name | Type | Description | Required |
---|---|---|---|
| string array | Wallet address ID that needs to be unbound | false |
| string | Wallet address that needs to be added. The address needs to be prefixed by blockchain specific strings like | false |
| string | link, unlink, link_key, unlink_key | true |
Returns:
Name | Type | Description | Required |
---|---|---|---|
| string | User DID (existing or newly created) | true |
| string | Message to be signed | true |
| string | Update time | true |
(Deprecated) DID Pre-login
Parameters:
Name | Type | Description | Required |
---|---|---|---|
| string | DID string | true |
Returns:
Name | Type | Description | Required |
---|---|---|---|
| string | User DID (existing or newly created) | true |
| string | Message to be signed | true |
| string | Update time | true |
(Deprecated) Log in to DID
Parameters:
Name | Type | Description | Required |
---|---|---|---|
| string | type of login (the type of the above example is | true |
| string | updated time returned by the | true |
| json | login information | true |
| string | device id, not needed for new device | false |
identifier type:
Name | Type | Description |
---|---|---|
| string | User DID |
| string | Sign the |
Returns:
Name | Type | Description | Required |
---|---|---|---|
| string | access token | true |
| string | user id | true |
| string | device id | true |
Last updated