2024-07-05 22:20:13 -04:00
|
|
|
syntax = "proto3";
|
|
|
|
|
|
|
|
|
|
package did.v1;
|
2024-08-31 16:54:16 -04:00
|
|
|
|
2024-07-05 22:20:13 -04:00
|
|
|
import "cosmos/orm/v1/orm.proto";
|
|
|
|
|
import "did/v1/genesis.proto";
|
2024-08-31 12:49:44 -04:00
|
|
|
import "did/v1/models.proto";
|
2024-07-05 22:20:13 -04:00
|
|
|
|
2024-09-05 01:24:57 -04:00
|
|
|
option go_package = "github.com/onsonr/sonr/x/did/types";
|
|
|
|
|
|
2024-09-11 15:10:54 -04:00
|
|
|
// Account represents a wallet account associated with a DID Controller
|
|
|
|
|
message Account {
|
2024-07-06 03:02:45 -04:00
|
|
|
option (cosmos.orm.v1.table) = {
|
2024-09-05 01:24:57 -04:00
|
|
|
id: 1
|
2024-07-06 03:02:45 -04:00
|
|
|
primary_key: {fields: "id"}
|
2024-09-05 01:24:57 -04:00
|
|
|
index: {
|
|
|
|
|
id: 1
|
2024-09-11 15:10:54 -04:00
|
|
|
fields: "controller,label"
|
2024-09-05 01:24:57 -04:00
|
|
|
unique: true
|
|
|
|
|
}
|
|
|
|
|
index: {
|
|
|
|
|
id: 2
|
2024-09-11 15:10:54 -04:00
|
|
|
fields: "controller,address"
|
2024-09-05 01:24:57 -04:00
|
|
|
unique: true
|
|
|
|
|
}
|
|
|
|
|
index: {
|
|
|
|
|
id: 3
|
2024-09-11 15:10:54 -04:00
|
|
|
fields: "controller,chain_code,index"
|
2024-09-05 01:24:57 -04:00
|
|
|
unique: true
|
|
|
|
|
}
|
2024-09-14 14:46:09 -04:00
|
|
|
index: {
|
2024-09-14 14:59:10 -04:00
|
|
|
id: 4
|
|
|
|
|
fields: "namespace,address"
|
2024-09-14 14:46:09 -04:00
|
|
|
unique: true
|
|
|
|
|
}
|
|
|
|
|
};
|
2024-07-23 14:18:15 -04:00
|
|
|
|
|
|
|
|
// The unique identifier of the alias
|
|
|
|
|
string id = 1;
|
|
|
|
|
|
|
|
|
|
// Origin is the Alias provider
|
2024-09-14 14:59:10 -04:00
|
|
|
string address = 2;
|
2024-07-23 14:18:15 -04:00
|
|
|
|
2024-08-10 18:27:11 -04:00
|
|
|
// Subject is the user defined alias
|
2024-09-14 14:59:10 -04:00
|
|
|
string label = 3;
|
2024-07-23 14:18:15 -04:00
|
|
|
|
|
|
|
|
// Controller of the alias
|
|
|
|
|
string controller = 4;
|
|
|
|
|
|
2024-09-14 14:59:10 -04:00
|
|
|
string namespace = 5;
|
2024-07-06 03:02:45 -04:00
|
|
|
|
2024-09-11 15:10:54 -04:00
|
|
|
uint32 chain_code = 6;
|
2024-08-31 16:54:16 -04:00
|
|
|
|
2024-09-11 15:10:54 -04:00
|
|
|
uint32 index = 7;
|
2024-07-05 22:20:13 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Controller represents a Sonr DWN Vault
|
|
|
|
|
message Controller {
|
|
|
|
|
option (cosmos.orm.v1.table) = {
|
2024-09-11 15:10:54 -04:00
|
|
|
id: 2
|
2024-07-05 22:20:13 -04:00
|
|
|
primary_key: {fields: "id"}
|
2024-09-05 01:24:57 -04:00
|
|
|
index: {
|
|
|
|
|
id: 1
|
|
|
|
|
fields: "address"
|
|
|
|
|
unique: true
|
|
|
|
|
}
|
|
|
|
|
index: {
|
|
|
|
|
id: 2
|
|
|
|
|
fields: "vault_cid"
|
|
|
|
|
unique: true
|
|
|
|
|
}
|
2024-07-05 22:20:13 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// The unique identifier of the controller
|
|
|
|
|
string id = 1;
|
|
|
|
|
|
|
|
|
|
// The DID of the controller
|
2024-08-31 12:49:44 -04:00
|
|
|
string address = 2;
|
2024-07-05 22:20:13 -04:00
|
|
|
|
2024-09-05 01:24:57 -04:00
|
|
|
// Aliases of the controller
|
2024-09-11 15:10:54 -04:00
|
|
|
repeated Alias aliases = 3;
|
2024-09-05 01:24:57 -04:00
|
|
|
|
2024-08-31 12:49:44 -04:00
|
|
|
// PubKey is the verification method
|
2024-09-05 01:24:57 -04:00
|
|
|
PubKey public_key = 4;
|
2024-07-05 22:20:13 -04:00
|
|
|
|
|
|
|
|
// The vault address or identifier
|
2024-08-31 12:49:44 -04:00
|
|
|
string vault_cid = 5;
|
2024-09-11 15:10:54 -04:00
|
|
|
|
|
|
|
|
// The Authentications of the controller
|
|
|
|
|
repeated Credential authentication = 6;
|
2024-07-05 22:20:13 -04:00
|
|
|
}
|
|
|
|
|
|
2024-09-11 15:10:54 -04:00
|
|
|
// Proof represents a verifiable credential
|
|
|
|
|
message Proof {
|
2024-07-05 22:20:13 -04:00
|
|
|
option (cosmos.orm.v1.table) = {
|
2024-08-31 16:54:16 -04:00
|
|
|
id: 4
|
2024-07-05 22:20:13 -04:00
|
|
|
primary_key: {fields: "id"}
|
2024-09-05 01:24:57 -04:00
|
|
|
index: {
|
|
|
|
|
id: 1
|
2024-09-11 15:10:54 -04:00
|
|
|
fields: "controller,issuer,property"
|
2024-09-05 01:24:57 -04:00
|
|
|
unique: true
|
|
|
|
|
}
|
2024-07-05 22:20:13 -04:00
|
|
|
};
|
|
|
|
|
|
2024-09-11 15:10:54 -04:00
|
|
|
// The unique identifier of the proof
|
2024-07-05 22:20:13 -04:00
|
|
|
string id = 1;
|
|
|
|
|
|
2024-09-11 15:10:54 -04:00
|
|
|
// The controller of the proof
|
2024-08-31 12:49:44 -04:00
|
|
|
string controller = 2;
|
2024-07-05 22:20:13 -04:00
|
|
|
|
2024-09-11 15:10:54 -04:00
|
|
|
// The value of the linked identifier
|
|
|
|
|
string issuer = 3;
|
2024-09-05 01:24:57 -04:00
|
|
|
|
2024-09-11 15:10:54 -04:00
|
|
|
// The property of the proof
|
|
|
|
|
string property = 4;
|
2024-09-05 01:24:57 -04:00
|
|
|
|
2024-09-11 15:10:54 -04:00
|
|
|
// The accumulator of the proof
|
|
|
|
|
bytes accumulator = 5;
|
2024-09-05 01:24:57 -04:00
|
|
|
|
2024-09-11 15:10:54 -04:00
|
|
|
// The secret key of the proof
|
|
|
|
|
bytes key = 6;
|
2024-07-05 22:20:13 -04:00
|
|
|
}
|
|
|
|
|
|
2024-09-05 01:24:57 -04:00
|
|
|
// ServiceRecord represents a decentralized service in a DID Document
|
|
|
|
|
message ServiceRecord {
|
2024-07-05 22:20:13 -04:00
|
|
|
option (cosmos.orm.v1.table) = {
|
2024-09-11 15:10:54 -04:00
|
|
|
id: 3
|
2024-07-05 22:20:13 -04:00
|
|
|
primary_key: {fields: "id"}
|
2024-09-05 01:24:57 -04:00
|
|
|
index: {
|
|
|
|
|
id: 1
|
2024-09-11 15:10:54 -04:00
|
|
|
fields: "origin"
|
2024-09-05 01:24:57 -04:00
|
|
|
unique: true
|
|
|
|
|
}
|
|
|
|
|
index: {
|
|
|
|
|
id: 2
|
2024-09-11 15:10:54 -04:00
|
|
|
fields: "authority,origin"
|
2024-09-05 01:24:57 -04:00
|
|
|
unique: true
|
|
|
|
|
}
|
2024-07-05 22:20:13 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// The ID of the service
|
|
|
|
|
string id = 1;
|
|
|
|
|
|
|
|
|
|
// The type of the service
|
|
|
|
|
string service_type = 2;
|
|
|
|
|
|
2024-09-11 15:10:54 -04:00
|
|
|
// The authority DID of the service
|
|
|
|
|
string authority = 3;
|
2024-08-10 15:24:22 -04:00
|
|
|
|
|
|
|
|
// The domain name of the service
|
2024-09-11 15:10:54 -04:00
|
|
|
string origin = 4;
|
2024-08-10 15:24:22 -04:00
|
|
|
|
2024-09-05 01:24:57 -04:00
|
|
|
// The description of the service
|
|
|
|
|
string description = 5;
|
|
|
|
|
|
2024-07-05 22:20:13 -04:00
|
|
|
// The service endpoint
|
2024-09-05 01:24:57 -04:00
|
|
|
map<string, string> service_endpoints = 6;
|
2024-07-05 22:20:13 -04:00
|
|
|
|
2024-08-10 15:24:22 -04:00
|
|
|
// Scopes is the Authorization Grants of the service
|
2024-09-05 01:24:57 -04:00
|
|
|
Permissions permissions = 7;
|
2024-09-11 15:10:54 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Verification reprsents a method of verifying membership in a DID
|
|
|
|
|
message VerificationMethod {
|
|
|
|
|
option (cosmos.orm.v1.table) = {
|
|
|
|
|
id: 5
|
|
|
|
|
primary_key: {fields: "id"}
|
|
|
|
|
index: {
|
|
|
|
|
id: 1
|
|
|
|
|
fields: "controller,method,issuer,subject"
|
|
|
|
|
unique: true
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// The unique identifier of the verification
|
|
|
|
|
string id = 1;
|
|
|
|
|
|
|
|
|
|
// The controller of the verification
|
|
|
|
|
string controller = 2;
|
|
|
|
|
|
|
|
|
|
// The DIDNamespace of the verification
|
|
|
|
|
DIDNamespace method = 3;
|
|
|
|
|
|
|
|
|
|
// The value of the linked identifier
|
|
|
|
|
string issuer = 4;
|
|
|
|
|
|
|
|
|
|
// The subject of the verification
|
|
|
|
|
string subject = 5;
|
2024-09-05 01:24:57 -04:00
|
|
|
|
2024-09-11 15:10:54 -04:00
|
|
|
// The public key of the verification
|
|
|
|
|
PubKey public_key = 6;
|
2024-08-10 18:27:11 -04:00
|
|
|
// The controller DID of the service
|
2024-07-05 22:20:13 -04:00
|
|
|
}
|