sonr/proto/did/v1/state.proto
2024-08-31 12:49:44 -04:00

143 lines
3.2 KiB
Protocol Buffer

syntax = "proto3";
package did.v1;
option go_package = "github.com/onsonr/hway/x/did/types";
import "cosmos/orm/v1/orm.proto";
import "did/v1/genesis.proto";
import "did/v1/models.proto";
// Aliases represents the `alsoKnownAs` property associated with a DID Controller
message Aliases {
option (cosmos.orm.v1.table) = {
id: 1
primary_key: {fields: "id"}
index: { id: 1, fields: "subject", unique: true }
};
// The unique identifier of the alias
string id = 1;
// Origin is the Alias provider
string origin = 2;
// Subject is the user defined alias
string subject = 3;
// Controller of the alias
string controller = 4;
// Expiration of the alias
uint64 expiration = 5;
}
// Assertion represents strongly created credentials (e.g., Passkeys, SSH, GPG, Native Secure Enclaave)
message Assertion {
option (cosmos.orm.v1.table) = {
id: 2
primary_key: {fields: "id"}
};
// The unique identifier of the attestation
string id = 1;
// The controller of the attestation
string controller = 2;
// Key type (e.g., "passkey", "ssh", "gpg", "native-secure-enclave")
PubKey public_key = 3;
// The value of the linked identifier
bytes credential_id = 4;
// Metadata is optional additional information about the assertion
Metadata metadata = 5;
}
// Attestation represents linked identifiers (e.g., Crypto Accounts, Github, Email, Phone)
message Attestation {
option (cosmos.orm.v1.table) = {
id: 3
primary_key: {fields: "id"}
};
// The unique identifier of the attestation
string id = 1;
// The type of the linked identifier (e.g., "crypto", "github", "email", "phone")
string controller = 2;
// The value of the linked identifier
PubKey public_key = 3;
// The controller of the attestation
Metadata metadata = 4;
}
// Controller represents a Sonr DWN Vault
message Controller {
option (cosmos.orm.v1.table) = {
id: 4
primary_key: {fields: "id"}
};
// The unique identifier of the controller
string id = 1;
// The DID of the controller
string address = 2;
// PubKey is the verification method
PubKey public_key = 4;
// The vault address or identifier
string vault_cid = 5;
}
// Delegation represents IBC Account Controllers for various chains (e.g., ETH, BTC)
message Delegation {
option (cosmos.orm.v1.table) = {
id: 5
primary_key: {fields: "id"}
};
// The unique identifier of the delegation
string id = 1;
// The Decentralized Identifier of the delegated account
string controller = 2;
// Resolved from module parameters
string chain_info_id = 3;
// The delegation proof or verification method
PubKey public_key = 4;
}
// Service represents a service in a DID Document
message Service {
option (cosmos.orm.v1.table) = {
id: 6
primary_key: {fields: "id"}
};
// The ID of the service
string id = 1;
// The type of the service
string service_type = 2;
// The controller DID of the service
string controller_did = 3;
// The domain name of the service
string origin_uri = 4;
// The service endpoint
map<string, string> service_endpoints = 5;
// Scopes is the Authorization Grants of the service
Permissions permissions = 6;
}