Appearance
did:ethr
Create
This page explains states and a typical flow of client-managed secret mode with the did:ethr method.
States
Possible states:
Requests and Responses
Request 1: Missing verificationMethod
"#controllerKey"
Supported options:
network
: The Ethereum network on which to create the DID (possible values:mainnet
,goerli
,sepolia
)
bash
curl -H "Authorization: Bearer b082c420-df67-4b06-899c-b7c51d75fba0" \
-X POST "https://api.godiddy.com/0.1.0/universal-registrar/create?method=ethr" \
-H "Content-Type: application/json" \
-d '{
"options": {
"clientSecretMode": true,
"network": "goerli"
},
"secret": { },
"didDocument": { }
}'
1
2
3
4
5
6
7
8
9
10
11
2
3
4
5
6
7
8
9
10
11
Response A: action=getVerificationMethod
json
{
"jobId": null,
"didState": {
"state": "action",
"action": "getVerificationMethod",
"verificationMethodTemplate": [{
"id": "#controllerKey",
"type": "EcdsaSecp256k1VerificationKey2019"
}]
},
"didRegistrationMetadata": { ... },
"didDocumentMetadata": { ... }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
2
3
4
5
6
7
8
9
10
11
12
13
Request 2: verificationMethod
"#controllerKey"
bash
curl -H "Authorization: Bearer b082c420-df67-4b06-899c-b7c51d75fba0" \
-X POST "https://api.godiddy.com/0.1.0/universal-registrar/create?method=ethr" \
-H "Content-Type: application/json" \
-d '{
"options": {
"clientSecretMode": true,
"network": "goerli"
},
"secret": { },
"didDocument": {
"@context": ["https//www.w3.org/ns/did/v1"],
"verificationMethod": [{
"id": "#controllerKey",
"type": "EcdsaSecp256k1VerificationKey2019",
"publicKeyHex": "04d9c24fcc89e6cdd4a20e9a53836d2c5c0ccd19a0ec20e00f2e7796e48daa75bf960d5b9dd51484cf82ef9065abe02abffefa3cc3cbf72e44b374e17aeab091ca"
}]
}
}'
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 B: state=finished
json
{
"jobId": null,
"didState": {
"did": "did:ethr:goerli:0x02d9c24fcc89e6cdd4a20e9a53836d2c5c0ccd19a0ec20e00f2e7796e48daa75bf",
"state": "finished",
"secret": {
"verificationMethod": [
[
{
"id": "#controllerKey",
"type": "EcdsaSecp256k1VerificationKey2019"
},
{
"id": "did:ethr:goerli:0x02d9c24fcc89e6cdd4a20e9a53836d2c5c0ccd19a0ec20e00f2e7796e48daa75bf#controllerKey",
"controller": "did:ethr:goerli:0x02d9c24fcc89e6cdd4a20e9a53836d2c5c0ccd19a0ec20e00f2e7796e48daa75bf",
"purpose": ["authentication", "assertionMethod"]
}
]
]
}
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
OpenSSL Commands
For Request 2
See Request 2.
Generate a new DID controller keypair (secp256k1):
shell
openssl ecparam -genkey -name secp256k1 -outform DER >privkey
openssl ec -conv_form uncompressed -in privkey -pubout -out pubkey -inform DER -outform DER
1
2
2
Convert DID controller public key to hexadecimal:
shell
cat pubkey| tail -c +24| basenc -w0 --base16
1
The result can then be used as value of publicKeyHex
in Request 2.