DID API
Overview
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:
"message"
: The request message that is encoded in the Base64 format."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."next_key_hash"
: The SHA-256 hash of the next public key in PEM format in the key series."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.
The DID registration request is the only request method that does not contain "did_address"
and"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 ("signature"
). If "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.
DID Requests
The table below summarizes all DID-related HTTP requests to the IDIN server.
Last updated