Squash merge develop into master

This commit is contained in:
Prad Nukala
2024-09-14 14:27:45 -04:00
parent a929e61d01
commit 05bda3d1b2
227 changed files with 56902 additions and 10178 deletions
+204 -4
View File
@@ -1,8 +1,10 @@
syntax = "proto3";
package did.v1;
import "gogoproto/gogo.proto";
import "amino/amino.proto";
import "gogoproto/gogo.proto";
option go_package = "github.com/onsonr/sonr/x/did/types";
import "did/v1/types.proto";
option go_package = "github.com/onsonr/hway/x/did/types";
@@ -11,6 +13,17 @@ option go_package = "github.com/onsonr/hway/x/did/types";
message GenesisState {
// Params defines all the parameters of the module.
Params params = 1 [(gogoproto.nullable) = false];
// GlobalIntegrity defines a zkp integrity proof for the entire DID namespace
GlobalIntegrity global_integrity = 2;
}
// GlobalIntegrity defines a zkp integrity proof for the entire DID namespace
message GlobalIntegrity {
string controller = 1;
string seed = 2;
bytes accumulator = 3;
uint64 count = 4;
}
// Params defines the set of module parameters.
@@ -19,11 +32,198 @@ message Params {
option (gogoproto.equal) = true;
option (gogoproto.goproto_stringer) = false;
// Whitelisted Assets
// Whitelisted Assets
repeated AssetInfo whitelisted_assets = 1;
// Whitelisted Blockchains
repeated ChainInfo whitelisted_chains = 2;
// Whitelisted Key Types
map<string, KeyInfo> allowed_public_keys = 2;
// IpfsActive is a flag to enable/disable ipfs
bool ipfs_active = 3;
// Localhost Registration Enabled
bool localhost_registration_enabled = 4;
// ConveyancePreference defines the conveyance preference
string conveyance_preference = 5;
// AttestationFormats defines the attestation formats
repeated string attestation_formats = 6;
}
// AssetInfo defines the asset info
message AssetInfo {
// The coin type index for bip44 path
int64 index = 1;
// The hrp for bech32 address
string hrp = 2;
// The coin symbol
string symbol = 3;
// The coin name
AssetType asset_type = 4;
// The name of the asset
string name = 5;
// The icon url
string icon_url = 6;
}
// KeyInfo defines information for accepted PubKey types
message KeyInfo {
KeyRole role = 1;
KeyAlgorithm algorithm = 2; // e.g., "ES256", "EdDSA", "ES256K"
KeyEncoding encoding = 3; // e.g., "hex", "base64", "multibase"
KeyCurve curve = 4; // e.g., "P256", "P384", "P521", "X25519", "X448", "Ed25519", "Ed448", "secp256k1"
KeyType type = 5; // e.g., "Octet", "Elliptic", "RSA", "Symmetric", "HMAC"
}
// ValidatorInfo defines information for accepted Validator nodes
message ValidatorInfo {
string moniker = 1;
repeated Endpoint grpc_endpoints = 2;
repeated Endpoint rest_endpoints = 3;
ExplorerInfo explorer = 4;
FeeInfo fee_info = 5;
IBCChannel ibc_channel = 6;
// Endpoint defines an endpoint
message Endpoint {
string url = 1;
bool is_primary = 2;
}
// ExplorerInfo defines the explorer info
message ExplorerInfo {
string name = 1;
string url = 2;
}
// FeeInfo defines a fee info
message FeeInfo {
string base_denom = 1;
repeated string fee_rates = 2;
int32 init_gas_limit = 3;
bool is_simulable = 4;
double gas_multiply = 5;
}
// IBCChannel defines the IBC channel info
message IBCChannel {
string id = 1;
string port = 2;
}
}
//
// [Constant Enumerations]
//
// AssetType defines the type of asset: native, wrapped, staking, pool, or unspecified
enum AssetType {
ASSET_TYPE_UNSPECIFIED = 0;
ASSET_TYPE_NATIVE = 1;
ASSET_TYPE_WRAPPED = 2;
ASSET_TYPE_STAKING = 3;
ASSET_TYPE_POOL = 4;
ASSET_TYPE_IBC = 5;
ASSET_TYPE_CW20 = 6;
}
// DIDNamespace define the different namespaces of DID
enum DIDNamespace {
DID_NAMESPACE_UNSPECIFIED = 0;
DID_NAMESPACE_IPFS = 1;
DID_NAMESPACE_SONR = 2;
DID_NAMESPACE_BITCOIN = 3;
DID_NAMESPACE_ETHEREUM = 4;
DID_NAMESPACE_IBC = 5;
DID_NAMESPACE_WEBAUTHN = 6;
DID_NAMESPACE_DWN = 7;
DID_NAMESPACE_SERVICE = 8;
}
// KeyAlgorithm defines the key algorithm
enum KeyAlgorithm {
KEY_ALGORITHM_UNSPECIFIED = 0;
KEY_ALGORITHM_ES256 = 1;
KEY_ALGORITHM_ES384 = 2;
KEY_ALGORITHM_ES512 = 3;
KEY_ALGORITHM_EDDSA = 4;
KEY_ALGORITHM_ES256K = 5;
KEY_ALGORITHM_ECDSA = 6; // Fixed typo from EDCSA to ECDSA
}
// KeyCurve defines the key curve
enum KeyCurve {
KEY_CURVE_UNSPECIFIED = 0;
KEY_CURVE_P256 = 1; // NIST P-256
KEY_CURVE_P384 = 2;
KEY_CURVE_P521 = 3;
KEY_CURVE_X25519 = 4;
KEY_CURVE_X448 = 5;
KEY_CURVE_ED25519 = 6;
KEY_CURVE_ED448 = 7;
KEY_CURVE_SECP256K1 = 8;
KEY_CURVE_BLS12381 = 9;
KEY_CURVE_KECCAK256 = 10;
}
// KeyEncoding defines the key encoding
enum KeyEncoding {
KEY_ENCODING_UNSPECIFIED = 0;
KEY_ENCODING_RAW = 1;
KEY_ENCODING_HEX = 2;
KEY_ENCODING_MULTIBASE = 3;
}
// KeyRole defines the kind of key
enum KeyRole {
KEY_ROLE_UNSPECIFIED = 0;
KEY_ROLE_AUTHENTICATION = 1; // Passkeys and FIDO
KEY_ROLE_ASSERTION = 2; // Zk Identifiers
KEY_ROLE_DELEGATION = 3; // ETH,BTC,IBC addresses
KEY_ROLE_INVOCATION = 4; // DWN Controllers
}
// KeyType defines the key type
enum KeyType {
KEY_TYPE_UNSPECIFIED = 0;
KEY_TYPE_OCTET = 1;
KEY_TYPE_ELLIPTIC = 2;
KEY_TYPE_RSA = 3;
KEY_TYPE_SYMMETRIC = 4;
KEY_TYPE_HMAC = 5;
KEY_TYPE_MPC = 6;
KEY_TYPE_ZK = 7;
KEY_TYPE_WEBAUTHN = 8;
KEY_TYPE_BIP32 = 9;
}
enum KeyshareRole {
KEYSHARE_ROLE_UNSPECIFIED = 0;
KEYSHARE_ROLE_USER = 1;
KEYSHARE_ROLE_VALIDATOR = 2;
}
// PermissionScope define the Capabilities Controllers can grant for Services
enum PermissionScope {
PERMISSION_SCOPE_UNSPECIFIED = 0;
PERMISSION_SCOPE_BASIC_INFO = 1;
PERMISSION_SCOPE_PERMISSIONS_READ = 2;
PERMISSION_SCOPE_PERMISSIONS_WRITE = 3;
PERMISSION_SCOPE_TRANSACTIONS_READ = 4;
PERMISSION_SCOPE_TRANSACTIONS_WRITE = 5;
PERMISSION_SCOPE_WALLETS_READ = 6;
PERMISSION_SCOPE_WALLETS_CREATE = 7;
PERMISSION_SCOPE_WALLETS_SUBSCRIBE = 8;
PERMISSION_SCOPE_WALLETS_UPDATE = 9;
PERMISSION_SCOPE_TRANSACTIONS_VERIFY = 10;
PERMISSION_SCOPE_TRANSACTIONS_BROADCAST = 11;
PERMISSION_SCOPE_ADMIN_USER = 12;
PERMISSION_SCOPE_ADMIN_VALIDATOR = 13;
}