-
Notifications
You must be signed in to change notification settings - Fork 12
/
did.proto
107 lines (86 loc) · 3.98 KB
/
did.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
syntax = "proto3";
package allinbits.cosmoscash.did;
option go_package = "github.com/allinbits/cosmos-cash/v3/x/did/types";
import "gogoproto/gogo.proto";
import "google/protobuf/timestamp.proto";
/*
This represents a minimal self-managed did document
definition: https://w3c.github.io/did-core/
*/
// DidDocument represents a dencentralised identifer.
message DidDocument {
option (gogoproto.equal) = true;
option (gogoproto.goproto_getters) = false;
// @context is spec for did document.
repeated string context = 1 [(gogoproto.jsontag) = "@context,omitempty"];
// id represents the id for the did document.
string id = 2;
// A DID controller is an entity that is authorized to make changes to a DID document.
// cfr. https://www.w3.org/TR/did-core/#did-controller
repeated string controller = 3;
// A DID document can express verification methods,
// such as cryptographic public keys, which can be used
// to authenticate or authorize interactions with the DID subject or associated parties.
// https://www.w3.org/TR/did-core/#verification-methods
repeated VerificationMethod verificationMethod = 4;
// Services are used in DID documents to express ways of communicating
// with the DID subject or associated entities.
// https://www.w3.org/TR/did-core/#services
repeated Service service = 5;
// NOTE: below this line there are the relationships
// Authentication represents public key associated with the did document.
// cfr. https://www.w3.org/TR/did-core/#authentication
repeated string authentication = 6;
// Used to specify how the DID subject is expected to express claims,
// such as for the purposes of issuing a Verifiable Credential.
// cfr. https://www.w3.org/TR/did-core/#assertion
repeated string assertionMethod = 7;
// used to specify how an entity can generate encryption material
// in order to transmit confidential information intended for the DID subject.
// https://www.w3.org/TR/did-core/#key-agreement
repeated string keyAgreement = 8;
// Used to specify a verification method that might be used by the DID subject
// to invoke a cryptographic capability, such as the authorization
// to update the DID Document.
// https://www.w3.org/TR/did-core/#capability-invocation
repeated string capabilityInvocation = 9;
// Used to specify a mechanism that might be used by the DID subject
// to delegate a cryptographic capability to another party.
// https://www.w3.org/TR/did-core/#capability-delegation
repeated string capabilityDelegation = 10;
}
// A DID document can express verification methods,
// such as cryptographic public keys, which can be used
// to authenticate or authorize interactions
// with the DID subject or associated parties.
// https://www.w3.org/TR/did-core/#verification-methods
message VerificationMethod {
option (gogoproto.equal) = true;
option (gogoproto.goproto_getters) = false;
string id = 1;
string type = 2;
string controller = 3;
oneof verificationMaterial {
string blockchainAccountID = 4;
string publicKeyHex = 5;
string publicKeyMultibase = 6;
}
}
// Service defines how to find data associated with a identifer
message Service {
option (gogoproto.equal) = true;
option (gogoproto.goproto_getters) = false;
string id = 1;
string type = 2;
string serviceEndpoint = 3;
}
// DidMetadata defines metadata associated to a did document such as
// the status of the DID document
message DidMetadata {
option (gogoproto.equal) = true;
option (gogoproto.goproto_getters) = false;
string versionId = 1;
google.protobuf.Timestamp created = 2 [(gogoproto.stdtime) = true];
google.protobuf.Timestamp updated = 3 [(gogoproto.stdtime) = true];
bool deactivated = 4;
}