This is a Universal Registrar driver for did:btcr2 identifiers.
docker compose build
docker compose up
curl -X POST "http://localhost:9080/1.0/create?method=btcr2" \
-H "Content-Type: application/json" \
-d '{
"didDocument": {
"@context": ["https://www.w3.org/TR/did-1.1", "https://btcr2.dev/context/v1"]
},
"options": {
"clientSecretMode": true,
"network": "mutinynet"
},
"secret": { }
}'curl -X POST "http://localhost:9080/1.0/create?method=btcr2" \
-H "Content-Type: application/json" \
-d '{
"didDocument" : {
"@context": ["https://www.w3.org/TR/did-1.1", "https://btcr2.dev/context/v1"],
"verificationMethod" : [ {
"id" : "#initialKey",
"type" : "Multikey",
"publicKeyMultibase" : "zQ3shrogQZQDjQe6boF6Sas9occwW7rZVVLR3qQ85qt7JHXq4"
} ],
"assertionMethod" : [ "#initialKey" ],
"capabilityDelegation" : [ "#initialKey" ],
"capabilityInvocation" : [ "#initialKey" ],
"authentication" : [ "#initialKey" ]
},
"options" : {
"clientSecretMode" : true,
"network" : "mutinynet"
},
"secret" : { }
}'The driver recognizes the following environment variables:
- Specifies how the driver interacts with the Bitcoin blockchain.
- Possible values:
bitcoind: Connects to a bitcoind instance via JSON-RPCbtcd: Connects to a btcd instance via JSON-RPCbitcoinj: Connects to Bitcoin using a local bitcoinj clientblockcypherapi: Connects to BlockCypher's APIesploraelectrsrest: Connects to Esplora/Electrs REST API
- Default value:
bitcoind
- Specifies the JSON-RPC URLs of the Bitcoin connections.
- Specifies the server TLS certificates of the Bitcoin connections.
- Default value: ``
- Specifies genesis hashes associated with the Bitcoin connections.
- Default value: ``
- Specifies a MultiAddress if an IPFS connection to be used as CAS.
- Default value:
/ip4/127.0.0.1/tcp/5001
- Specifies a connect/read timeout in milliseconds for the IPFS connection.
- Default value:
10000
See https://identity.foundation/did-registration/#options.
{
"version": 1,
"network": "mutinynet",
"publishToIpfs": true,
"generateInitialKey": true,
"generateStandardBeacons": false,
"generateAggregateBeacon": "cohort-mutinynet-cas-2"
}
network: The version of thedid:btcr2method.- Default value:
1
- Default value:
version: The name of the network where a DID should be registered. Values depend onbitcoinConnectionsenvironment variable, but are typically:bitcoin,testnet3,signet,mutinynet.- Default value:
bitcoin
- Default value:
publishToIpfs: This boolean option indicates whether the genesis DID document should be published to IPFS. This is only available if an IPFS connection is configured.- Default value:
true
- Default value:
generateInitialKey: This boolean option indicates whether a default initial keypair with ID#initialKeyshould be generated.- Default value:
true
- Default value:
generateStandardBeacons: This boolean option indicates whether standard beacon services of typesSingletonBeacon,CASBeacon,SMTBeaconshould be generated in the genesis document. This option requiresgenerateInitialKey: true.- Default value:
false
- Default value:
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.- Default value:
null
- Default value:
smtNonce: A Base64-encoded nonce to be used for the Update operation.- Default value:
null
- Default value:
{
"didSourceDocument": { ... },
"targetVersionId": 2,
"beaconServiceId": "#initialP2PKH",
"beaconServiceType": "SingletonBeacon",
"publishToIpfs": true
}
didSourceDocument: ThedidSourceDocumentfor the update/deactivate operation.- Default value: none - must be provided
targetVersionId: ThetargetVersionIdfor the update/deactivate operation.- Default value: none - must be provided
beaconServiceId: The URI of the beacon service that should be used for announcing updates.- Default value: none - can optionally be provided
beaconServiceType: The type of the beacon service that should be used for announcing updates.- Default value: none - can optionally be provided
publishToIpfs: This boolean option indicates whether the update should be published to IPFS. This is only available if an IPFS connection is configured.- Default value:
true
- Default value: