Appearance
did:cheqd
Create
This page explains states and a typical flow of client-managed secret mode with the did:cheqd
method.
States
Possible states:
Requests and Responses
Request 1: Missing verificationMethod
"#key-1"
Supported options
network
: The network on which to create the DID (possible values:testnet
,mainnet
)
bash
curl -H "Authorization: Bearer b082c420-df67-4b06-899c-b7c51d75fba0" \
-X POST "https://api.godiddy.com/0.1.0/universal-registrar/create?method=cheqd" \
-H "Content-Type: application/json" \
-d '{
"options": {
"clientSecretMode": true,
"network": "testnet"
},
"secret": { },
"didDocument": {
"@context": ["https//www.w3.org/ns/did/v1"],
"service": [{
"id": "#didcomm",
"type": "DIDComm",
"serviceEndpoint": "https://test.com/mydidcomm/endpoint"
}]
}
}'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
Response A: action=getVerificationMethod
json
{
"jobId": null,
"didState": {
"state": "action",
"action": "getVerificationMethod",
"verificationMethodTemplate": [{
"id": "#key-1",
"type": "Ed25519VerificationKey2020",
"purpose": [
"authentication"
]
}]
},
"didRegistrationMetadata": { ... },
"didDocumentMetadata": { ... }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Request 2: verificationMethod
"#key-1"
bash
curl -H "Authorization: Bearer b082c420-df67-4b06-899c-b7c51d75fba0" \
-X POST "https://api.godiddy.com/0.1.0/universal-registrar/create?method=cheqd" \
-H "Content-Type: application/json" \
-d '{
"options": {
"clientSecretMode": true,
"network": "testnet"
},
"secret": { },
"didDocument": {
"@context": ["https//www.w3.org/ns/did/v1"],
"verificationMethod": [{
"id": "#key-1",
"type": "Ed25519VerificationKey2020",
"publicKeyMultibase": "<-- multibase encoded -->"
}],
"service": [{
"id": "#didcomm",
"type": "DIDComm",
"serviceEndpoint": "https://test.com/mydidcomm/endpoint"
}]
}
}'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
Response B: action=signPayload
with "signingRequest1"
json
{
"jobId": "00000000-0000-0000-0000-000000000000",
"didState": {
"state": "action",
"action": "signPayload",
"signingRequest": {
"signingRequest1": {
"kid": "#key-1",
"alg": "EdDSA",
"serializedPayload": "<-- base 64 encoded -->"
}
}
},
"didRegistrationMetadata": { ... },
"didDocumentMetadata": { ... }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Request 3: signingResponse
for "signingRequest1"
bash
curl -H "Authorization: Bearer b082c420-df67-4b06-899c-b7c51d75fba0" \
-X POST "https://api.godiddy.com/0.1.0/universal-registrar/create?method=indy" \
-H "Content-Type: application/json" \
-d '{
"jobId": "00000000-0000-0000-0000-000000000000",
"options": {
"clientSecretMode": true
},
"secret": {
"signingResponse": {
"signingRequest1": {
"signature": "<-- base64 encoded -->"
}
}
},
"didDocument": { }
}'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Response C: state=finished
json
{
"jobId": "00000000-0000-0000-0000-000000000000",
"didState": {
"state": "finished",
"did": "did:cheqd:testnet:1234567890123456789012",
"secret": {
"verificationMethod": [
[{
"id": "#key-1"
}, {
"id": "did:cheqd:testnet:1234567890123456789012#key-1",
"controller": "did:cheqd:testnet:1234567890123456789012"
}]
]
}
},
"didRegistrationMetadata": { ... },
"didDocumentMetadata": { ... }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
OpenSSL Commands
For Request 2
See Request 2.
Generate a new DID controller keypair (Ed25519):
bash
openssl genpkey -algorithm ed25519 -outform DER >privkey
openssl pkey -in privkey -pubout -out pubkey -inform DER -outform DER
1
2
2
Convert DID controller public key to Multibase:
bash
echo "z$(echo -n "$(echo -n 'ED01'| basenc -d --base16)$(cat pubkey| tail -c +13)"| base58)"
1
The result can then be used as value of publicKeyBaseMultibase
in Request 2.
For Response B
See Response B.
Extract the value of serializedPayload
from Response B. Then Base64-decode the payload and write to a file:
bash
echo "<-- base64 encoded -->"|base64 -d >payload
1
For Request 3
See Request 3.
Sign the payload with the DID controller private key:
bash
openssl pkeyutl -sign -rawin -in payload -inkey privkey -keyform DER| base64| tr -d '\n' >signature
1
The result can then be used as value of signature
in Request 3.
NOTE
This needs experimental Debian/Ubuntu packages libssl3 3.0.0 and openssl 3.0.0.