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-07-06 03:02:45 -04:00
|
|
|
// Assertion represents strongly created credentials (e.g., Passkeys, SSH, GPG, Native Secure Enclaave)
|
|
|
|
|
message Assertion {
|
|
|
|
|
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
|
|
|
|
|
fields: "subject,origin"
|
|
|
|
|
unique: true
|
|
|
|
|
}
|
|
|
|
|
index: {
|
|
|
|
|
id: 2
|
|
|
|
|
fields: "controller,origin"
|
|
|
|
|
unique: true
|
|
|
|
|
}
|
|
|
|
|
index: {
|
|
|
|
|
id: 3
|
|
|
|
|
fields: "controller,credential_label"
|
|
|
|
|
unique: true
|
|
|
|
|
}
|
2024-07-06 03:02:45 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// The unique identifier of the attestation
|
|
|
|
|
string id = 1;
|
|
|
|
|
|
2024-08-31 12:49:44 -04:00
|
|
|
// The controller of the attestation
|
|
|
|
|
string controller = 2;
|
|
|
|
|
|
2024-07-06 03:02:45 -04:00
|
|
|
// Key type (e.g., "passkey", "ssh", "gpg", "native-secure-enclave")
|
2024-08-31 12:49:44 -04:00
|
|
|
PubKey public_key = 3;
|
2024-07-06 03:02:45 -04:00
|
|
|
|
|
|
|
|
// The value of the linked identifier
|
2024-08-31 12:49:44 -04:00
|
|
|
bytes credential_id = 4;
|
2024-07-06 03:02:45 -04:00
|
|
|
|
2024-09-05 01:24:57 -04:00
|
|
|
// The display label of the attestation
|
|
|
|
|
string credential_label = 5;
|
|
|
|
|
|
|
|
|
|
// The origin of the attestation
|
|
|
|
|
string origin = 6;
|
|
|
|
|
|
|
|
|
|
// The subject of the attestation
|
|
|
|
|
string subject = 7;
|
|
|
|
|
|
2024-07-06 03:02:45 -04:00
|
|
|
// Metadata is optional additional information about the assertion
|
2024-09-05 01:24:57 -04:00
|
|
|
Metadata metadata = 8;
|
2024-07-06 03:02:45 -04:00
|
|
|
}
|
|
|
|
|
|
2024-07-05 22:20:13 -04:00
|
|
|
// Attestation represents linked identifiers (e.g., Crypto Accounts, Github, Email, Phone)
|
|
|
|
|
message Attestation {
|
|
|
|
|
option (cosmos.orm.v1.table) = {
|
2024-08-31 16:54:16 -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: "subject,origin"
|
|
|
|
|
unique: true
|
|
|
|
|
}
|
|
|
|
|
index: {
|
|
|
|
|
id: 2
|
|
|
|
|
fields: "controller,origin"
|
|
|
|
|
unique: true
|
|
|
|
|
}
|
2024-07-05 22:20:13 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// The unique identifier of the attestation
|
|
|
|
|
string id = 1;
|
|
|
|
|
|
|
|
|
|
// The type of the linked identifier (e.g., "crypto", "github", "email", "phone")
|
2024-08-31 12:49:44 -04:00
|
|
|
string controller = 2;
|
2024-07-05 22:20:13 -04:00
|
|
|
|
|
|
|
|
// The value of the linked identifier
|
2024-08-31 12:49:44 -04:00
|
|
|
PubKey public_key = 3;
|
2024-07-05 22:20:13 -04:00
|
|
|
|
2024-08-31 16:54:16 -04:00
|
|
|
// The origin of the attestation
|
|
|
|
|
string origin = 4;
|
|
|
|
|
|
|
|
|
|
// The subject of the attestation
|
|
|
|
|
string subject = 5;
|
|
|
|
|
|
2024-07-05 22:20:13 -04:00
|
|
|
// The controller of the attestation
|
2024-08-31 16:54:16 -04:00
|
|
|
Metadata metadata = 6;
|
2024-07-05 22:20:13 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Controller represents a Sonr DWN Vault
|
|
|
|
|
message Controller {
|
|
|
|
|
option (cosmos.orm.v1.table) = {
|
2024-08-31 16:54:16 -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
|
|
|
|
|
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
|
|
|
|
|
repeated string aliases = 3;
|
|
|
|
|
|
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-07-05 22:20:13 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Delegation represents IBC Account Controllers for various chains (e.g., ETH, BTC)
|
|
|
|
|
message Delegation {
|
|
|
|
|
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
|
|
|
|
|
fields: "account_address,chain_id"
|
|
|
|
|
unique: true
|
|
|
|
|
}
|
|
|
|
|
index: {
|
|
|
|
|
id: 2
|
|
|
|
|
fields: "controller,account_label"
|
|
|
|
|
unique: true
|
|
|
|
|
}
|
|
|
|
|
index: {
|
|
|
|
|
id: 3
|
|
|
|
|
fields: "controller,chain_id"
|
|
|
|
|
}
|
2024-07-05 22:20:13 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// The unique identifier of the delegation
|
|
|
|
|
string id = 1;
|
|
|
|
|
|
|
|
|
|
// The Decentralized Identifier of the delegated account
|
2024-08-31 12:49:44 -04:00
|
|
|
string controller = 2;
|
2024-07-05 22:20:13 -04:00
|
|
|
|
2024-08-31 12:49:44 -04:00
|
|
|
// Resolved from module parameters
|
2024-09-05 01:24:57 -04:00
|
|
|
string chain_index = 3;
|
2024-07-05 22:20:13 -04:00
|
|
|
|
|
|
|
|
// The delegation proof or verification method
|
2024-09-05 01:24:57 -04:00
|
|
|
PubKey public_key = 4;
|
|
|
|
|
|
|
|
|
|
// The Account Address
|
|
|
|
|
string account_address = 5;
|
|
|
|
|
|
|
|
|
|
// The Account label
|
|
|
|
|
string account_label = 6;
|
|
|
|
|
|
|
|
|
|
// The Chain ID
|
|
|
|
|
string chain_id = 7;
|
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-08-31 16:54:16 -04:00
|
|
|
id: 5
|
2024-07-05 22:20:13 -04:00
|
|
|
primary_key: {fields: "id"}
|
2024-09-05 01:24:57 -04:00
|
|
|
index: {
|
|
|
|
|
id: 1
|
|
|
|
|
fields: "origin_uri"
|
|
|
|
|
unique: true
|
|
|
|
|
}
|
|
|
|
|
index: {
|
|
|
|
|
id: 2
|
|
|
|
|
fields: "controller,origin_uri"
|
|
|
|
|
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-08-10 15:24:22 -04:00
|
|
|
// The controller DID of the service
|
2024-09-05 01:24:57 -04:00
|
|
|
string controller = 3;
|
2024-08-10 15:24:22 -04:00
|
|
|
|
|
|
|
|
// The domain name of the service
|
|
|
|
|
string origin_uri = 4;
|
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
|
|
// Metadata is optional additional information about the service
|
|
|
|
|
Metadata metadata = 8;
|
2024-07-05 22:20:13 -04:00
|
|
|
}
|