DID Registration

Every DID is associated with at least one key series. Apart from registering a new DID, every other type of request is associated with a DID address ("did_address") and one of the DID's key series. The client specifies the attribute "operation" according to the name of the request method. The current public key ("current_key") in the series and the SHA-256 hash of the next public key ("next_key_hash") is part of the request message whereas the current private key is used to sign the Base64 encoded request message.

To register for a new DID, a client must specify a new key series when she registers for a new DID address with did_register operation. The client generates the first and second public-private key pairs in the new key series. In the request message, the client then specifies the first public key ("current_key") and the SHA-256 hash of the second public key ("next_key_hash"). The request message is then encoded in Base64 and signed by the first private key.

post
did_register

https://test-network.finema.co/did
Request
Response
Request
Body Parameters
operation
required
string
The method's name that is "did_register".
current_key
required
string
The first public key in the series. It is used to verify the request's signature.
next_key_hash
required
string
The SHA-256 hash of the next public key in the series.
Response
200: OK
The operation name and DID address for the registered DID will be given as the response. The DID address is derived from the current public key ("current_key").
{
"operation": "did_register",
"did_address": "did:idin:9cd19d4cbab9ca1d6f4c6a4b9117fb8904f250b47307cf4f484424f44e0c8370"
}
422: Unprocessable Entity
{
"errors": [
{
"status": 422,
"title": "Invalid Attribute",
"detail": "the server cannot process the request",
}
]
}

Example Message and Request

{
"operation": "did_register",
"current_key": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEeR8NhQeHPT7l1yMyvkZMacPpibjH\n7mp5IRyO2J2kuE97h/fzu1c/7DFsO23qUN6/OezYglMEkoVo5Ob1b6k53A==\n-----END PUBLIC KEY-----",
"next_key_hash": "a18b790a92683ad00d3562de385ca9e07d20a729809c782e72412f57dd847105"
}

The above message can then be encoded in Base64 and signed with ECDSA to obtain the following HTTP request

{
"message": "ewogICAgIm9wZXJhdGlvbiI6ICJkaWRfcmVnaXN0ZXJfcmVzZXR0ZXJzIiwKICAgICJkaWRfYWRkcmVzcyI6ICJkaWQ6aWRpbjo5Y2QxOWQ0Y2JhYjljYTFkNmY0YzZhNGI5MTE3ZmI4OTA0ZjI1MGI0NzMwN2NmNGY0ODQ0MjRmNDRlMGM4MzcwIiwKICAgICJjdXJyZW50X2tleSI6ICItLS0tLUJFR0lOIFBVQkxJQyBLRVktLS0tLVxuTUZrd0V3WUhLb1pJemowQ0FRWUlLb1pJemowREFRY0RRZ0FFZVI4TmhRZUhQVDdsMXlNeXZrWk1hY1BwaWJqSFxuN21wNUlSeU8ySjJrdUU5N2gvZnp1MWMvN0RGc08yM3FVTjYvT2V6WWdsTUVrb1ZvNU9iMWI2azUzQT09XG4tLS0tLUVORCBQVUJMSUMgS0VZLS0tLS0iLAogICAgIm5leHRfa2V5X2hhc2giOiAiYTE4Yjc5MGE5MjY4M2FkMDBkMzU2MmRlMzg1Y2E5ZTA3ZDIwYTcyOTgwOWM3ODJlNzI0MTJmNTdkZDg0NzEwNSIKICAgICJub25jZSI6IDEKfQ==",
"signature": "OTI3MzgyNDgzNTQ3NTU5ODMyNTM1NzYwMDc2MTEwNzYwMTUzMjAzMzQ2NzQ5MDU4NzIwMzM4ODUzNjc4OTE2MTI2NzA2NzQyODgyMDcsIDQ1MjE2NzEwMzM3MjI5NjEzOTc3MjYxMzY2MjUwODYxOTA5MzY2MDU1MDg2Mjk0NzEyMDAwMTU3MjU4ODYxNTQ3ODUzNDc3NTY2ODQw"
}