didDocument method
Returns a minimal did-document for identityDid
, only with information about the current identity owner
Implementation
Future<String> didDocument(String identityDid) async {
var owner = await identityOwner(identityDid);
Map<String, dynamic> doc = {
'@context': [
"https://www.w3.org/ns/did/v1",
"https://identity.foundation/EcdsaSecp256k1RecoverySignature2020/lds-ecdsa-secp256k1-recovery2020-0.0.jsonld"
],
"id": identityDid,
"verificationMethod": [
{
"id": '$owner#controller',
"type": "EcdsaSecp256k1RecoveryMethod2020",
"controller": owner,
"blockchainAccountId": _didToAddress(owner).hexEip55
}
],
"authentication": ['$owner#controller']
};
return jsonEncode(doc);
}