The DID API provides a collection of HTTP request methods that underpin IDIN blockchain's functionality. The DID API includes HTTP methods for registration of a Decentralized Identifier (DID), key series management and resetter management. HTTP requests to the IDIN server must be in the JSON format with the following two attributes:
"signature": The signature of the Base64-encoded request message. The encoded message is signed by a private key.
There are several types of requests, such as registering a new DID address and adding a new key series to a DID. The request messages are also in the JSON format with a number of attributes depending on the request types. With the exception of registering a new DID, all request messages contain the following five attributes:
"operation": The request method's name that tells the server to execute the right operation.
"did_address": The DID address of which a key series is used to sign and verify the request.
"current_key": The public key in the PEM format for verifying the request's signature. It is the current public key in the key series and is the public key pair of the private key that signs the request.
"nonce": The request nonce that is bound to the given DID address. It starts at one and then increases by one for every request, and as a result it counts to the total number of requests that the DID has made.
The code snippet below shows an example request message for revoking the current set of resetters.
"current_key": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEu7ZonDYYEnCTvPA9H8eM9JxaQGHB\nMzLgxUMo58SXoJKIzt93kQK/bhwdPnFaEfQhiLB5VkOFgn2qKgScdIcXVw==\n-----END PUBLIC KEY-----",
The DID registration request is the only request method that does not contain
"nonce"since these two attributes must be bound to a DID.
When the server receives a HTTP request from a client, the server first decodes the request message (
"message"), check whether all attributes are valid and then uses the verifying public key (
"current_key") to verify the request's signature (
"did_address"is in the request message, the server will also check whether the
"current_key"is a valid current public key in any of the DID's key series.
The table below summarizes all DID-related HTTP requests to the IDIN server.
Register a new DID address.
Add a new key series to a DID.
Revoke a key series from a DID.
Register a new set of resetters for a DID.
Revoke the current set of resetters of a DID.
Approve a resetter request.
Get the current nonce of a DID.