Appearance
did:btcr2 Create
This page explains states and a typical flow of client-managed secret mode with the did:btcr2 method.
States
🚧 Under Construction
Requests and Responses
Request 1: Missing verificationMethod "#initialKey"
Supported options:
network: The Bitcoin network on which to create the DID (possible values:bitcoin,testnet3,signet,mutinynet).publishToIpfs: This boolean option indicates whether the genesis DID document should be published to IPFS. This is only available of an IPFS connection is configured.generateInitialKey: This boolean option indicates whether a default initial keypair with ID#initialKeyshould be generated.generateStandardBeacons: This boolean option indicates whether standard beacon services of typesSingletonBeacon,CASBeacon,SMTBeaconshould be generated in the genesis document. This option requiresgenerateInitialKey: true.generateAggregateBeacon: This string option indicates whether an aggregate beacon service for an aggregation cohort should be generated in the genesis document. The value of this option is the name of the aggregation cohort. This option requiresgenerateInitialKey: true.
bash
curl -X POST "https://api.godiddy.com/1.0.0/universal-registrar/create?method=btcr2" \
-H "Authorization: Bearer b082c420-df67-4b06-899c-b7c51d75fba0" \
-H "Content-Type: application/json" \
-d '{
"options": {
"clientSecretMode" : true,
"network" : "mutinynet",
"generateInitialKey" : true
},
"secret": { },
"didDocument": { }
}'1
2
3
4
5
6
7
8
9
10
11
12
2
3
4
5
6
7
8
9
10
11
12
Response A: action=getVerificationMethod
json
{
"jobId": null,
"didState": {
"state": "action",
"action": "getVerificationMethod",
"verificationMethodTemplate" : [ {
"id" : "#initialKey",
"type" : "Multikey",
"purpose" : [ "authentication", "assertionMethod", "capabilityInvocation", "capabilityDelegation" ],
"publicKeyJwk" : { "crv" : "secp256k1", "kty" : "EC" }
} ]
},
"didRegistrationMetadata": { ... },
"didDocumentMetadata": { ... }
}1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Request 2: verificationMethod "#initialKey"
bash
curl -X POST "https://api.godiddy.com/1.0.0/universal-registrar/create?method=btcr2" \
-H "Authorization: Bearer b082c420-df67-4b06-899c-b7c51d75fba0" \
-H "Content-Type: application/json" \
-d '{
"options": {
"clientSecretMode" : true,
"network" : "mutinynet",
"generateInitialKey" : true
},
"secret": { },
"didDocument": {
"@context" : "https://www.w3.org/ns/did/v1.1",
"verificationMethod" : [ {
"type" : "Multikey",
"id" : "#initialKey",
"publicKeyMultibase" : "zQ3shfZbaDJq3RVyH2pjaLSnTU1oeigrrGWeCGUZCF3R4A4T4"
} ],
"authentication" : [ "#initialKey" ],
"assertionMethod" : [ "#initialKey" ],
"capabilityInvocation" : [ "#initialKey" ],
"capabilityDelegation" : [ "#initialKey" ]
}
}'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: state=finished
json
{
"jobId": null,
"didState": {
"did": "did:btcr2:k1q5psmvljwps2h27fyg3y0zl65m3gq3p8p83mdm2rcrar9g2l3fus26cwdyc82",
"state": "finished",
"secret": {
"verificationMethod": [ [
{
"id": "#initialKey",
"type": "Multikey",
"purpose": [ "authentication", "assertionMethod", "capabilityInvocation", "capabilityDelegation" ],
"publicKeyJwk": { "crv": "secp256k1", "kty": "EC" }
},
{
"id": "did:btcr2:k1q5psmvljwps2h27fyg3y0zl65m3gq3p8p83mdm2rcrar9g2l3fus26cwdyc82#initialKey",
"controller": "did:btcr2:k1q5psmvljwps2h27fyg3y0zl65m3gq3p8p83mdm2rcrar9g2l3fus26cwdyc82"
}
] ]
}
}
}1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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 DER1
2
2
Convert DID controller public key to Multibase:
bash
echo "z$(echo -n "$(echo -n 'E701'| basenc -d --base16)$(cat pubkey| tail -c +13)"| base58)"1
The result can then be used as value of publicKeyMultibase in Request 2.