VC Registration

A credential issuer can register a new VC with vc_register operation. In the request message, the credential issuer must specify the current public key ("current_key") in a valid key series and the SHA-256 hash of the next public key ("next_key_hash"). The request message is then encoded in Base64 and signed by the current private key. Once the VC is registered, the server will respond with the VC's unique CID.

Once the credential issuer obtains a CID from the IDIN server, the issuer can then generate and send a VC with that CID to the credential holder.

The private key that is used to sign a vc_register request must be the same key that is used to sign the VC. This ensures the VC can be verified with "current_key" that is recorded in the IDIN blockchain.

vc_register

POST https://test-network.finema.co/vc

Request Body

Name
Type
Description

operation

string

The method's name that is "vc_register".

did_address

string

The DID address.

current_key

string

The current public key in the series. It is used to verify the request's signature.

next_key_hash

string

The SHA-256 hash of the next public key in the series.

nonce

number

The request nonce.

{
  "operation": "vc_register",
  "did_address": "did:idin:afb7ba88c76edbda55c344b70ae0cf0556d770ec256820d7185000de395391b5",
  "cid": "c118304cfcc011eaaca30242c0a83005"
}

Example Message and Request

{
    "current_key": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEt0akFcQq6zIZqzWWqGcMf1LHEsmM\njyroeekIUmVdFy315ldxcn2fPzPqyjJVolJRvoRaVoZZZjZCBzy4yASxqw==\n-----END PUBLIC KEY-----",
    "next_key_hash": "518b7e9e4fca365dff7b6f6d4509bbe2990037a88d7633ef0faaadeba35123ed",
    "operation": "vc_register",
    "did_address": "did:idin:afb7ba88c76edbda55c344b70ae0cf0556d770ec256820d7185000de395391b5",
    "nonce": 5
}

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

{
    "message": "eyJjdXJyZW50X2tleSI6ICItLS0tLUJFR0lOIFBVQkxJQyBLRVktLS0tLVxuTUZrd0V3WUhLb1pJemowQ0FRWUlLb1pJemowREFRY0RRZ0FFdDBha0ZjUXE2eklacXpXV3FHY01mMUxIRXNtTVxuanlyb2Vla0lVbVZkRnkzMTVsZHhjbjJmUHpQcXlqSlZvbEpSdm9SYVZvWlpaalpDQnp5NHlBU3hxdz09XG4tLS0tLUVORCBQVUJMSUMgS0VZLS0tLS0iLCAibmV4dF9rZXlfaGFzaCI6ICI1MThiN2U5ZTRmY2EzNjVkZmY3YjZmNmQ0NTA5YmJlMjk5MDAzN2E4OGQ3NjMzZWYwZmFhYWRlYmEzNTEyM2VkIiwgIm9wZXJhdGlvbiI6ICJ2Y19yZWdpc3RlciIsICJkaWRfYWRkcmVzcyI6ICJkaWQ6aWRpbjphZmI3YmE4OGM3NmVkYmRhNTVjMzQ0YjcwYWUwY2YwNTU2ZDc3MGVjMjU2ODIwZDcxODUwMDBkZTM5NTM5MWI1IiwgIm5vbmNlIjogNX0=",
    "signature": "MEUCIFSbmMEUcyjSYwq4QOXWZewn+xS/Jih04DRGKwNKlkQnAiEAuH3Es1opQ3LTTYbwyTJylskbaZOl7vSAF9RFp2Qn3TI="
}

Last updated