refactor: remove unused code related to whitelisted assets

This commit is contained in:
Prad Nukala
2024-09-27 20:58:05 -04:00
parent 88a3d9da1c
commit 92ff87cc2c
57 changed files with 25331 additions and 15090 deletions
-55
View File
@@ -19,7 +19,6 @@ message Params {
option (gogoproto.goproto_stringer) = false;
// Whitelisted Assets
repeated AssetInfo whitelisted_assets = 1;
// Whitelisted Key Types
map<string, KeyInfo> allowed_public_keys = 2;
@@ -31,38 +30,6 @@ message Params {
repeated string attestation_formats = 4;
}
// 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
string asset_type = 4;
// The name of the asset
string name = 5;
// The icon url
string icon_url = 6;
}
// Document defines a DID document
message Document {
string id = 1;
string controller = 2; // The DID of the controller
repeated string authentication = 3;
repeated string assertion_method = 4;
repeated string capability_delegation = 5;
repeated string capability_invocation = 6;
repeated string service = 7;
}
// KeyInfo defines information for accepted PubKey types
message KeyInfo {
string role = 1;
@@ -70,26 +37,4 @@ message KeyInfo {
string encoding = 3; // e.g., "hex", "base64", "multibase"
string curve = 4; // e.g., "P256", "P384", "P521", "X25519", "X448",
// "Ed25519", "Ed448", "secp256k1"
string type = 5; // e.g., "Octet", "Elliptic", "RSA", "Symmetric", "HMAC"
}
// PubKey defines a public key for a did
message PubKey {
string role = 1;
string algorithm = 2;
string encoding = 3;
string curve = 4;
string key_type = 5;
bytes raw = 6;
JWK jwk = 7;
// JWK represents a JSON Web Key
message JWK {
string kty = 1; // Key Type
string crv = 2; // Curve (for EC and OKP keys)
string x = 3; // X coordinate (for EC and OKP keys)
string y = 4; // Y coordinate (for EC keys)
string n = 5; // Modulus (for RSA keys)
string e = 6; // Exponent (for RSA keys)
}
}
+11
View File
@@ -38,3 +38,14 @@ message QueryResolveResponse {
// document is the DID document
Document document = 1;
}
// Document defines a DID document
message Document {
string id = 1;
string controller = 2; // The DID of the controller
repeated string authentication = 3;
repeated string assertion_method = 4;
repeated string capability_delegation = 5;
repeated string capability_invocation = 6;
repeated string service = 7;
}
+38 -12
View File
@@ -3,30 +3,31 @@ syntax = "proto3";
package did.v1;
import "cosmos/orm/v1/orm.proto";
import "did/v1/genesis.proto";
option go_package = "github.com/onsonr/sonr/x/did/types";
// Alias represents a DID alias
message Alias {
message Authentication {
option (cosmos.orm.v1.table) = {
id: 1
primary_key: {fields: "id"}
primary_key: {fields: "did"}
index: {
id: 1
fields: "subject,origin"
fields: "controller,subject"
unique: true
}
};
// The unique identifier of the alias
string id = 1;
// The unique identifier of the authentication
string did = 1;
// The alias of the DID
string subject = 2;
// The authentication of the DID
string controller = 2;
// Origin of the alias
string origin = 3;
// Origin of the authentication
string subject = 3;
// PubKey is the verification method
PubKey public_key = 4;
}
// Controller represents a Sonr DWN Vault
@@ -75,7 +76,7 @@ message Controller {
string btc_address = 5;
// PubKey is the verification method
bytes public_key = 6;
PubKey public_key = 6;
// Val Keyshare
string ks_val = 7;
@@ -128,3 +129,28 @@ message Verification {
// CapabilityInvocation)
string verification_type = 7;
}
// PubKey defines a public key for a did
message PubKey {
string role = 1;
string key_type = 2;
RawKey raw_key = 3;
JSONWebKey jwk = 4;
}
// JWK represents a JSON Web Key
message JSONWebKey {
string kty = 1; // Key Type
string crv = 2; // Curve (for EC and OKP keys)
string x = 3; // X coordinate (for EC and OKP keys)
string y = 4; // Y coordinate (for EC keys)
string n = 5; // Modulus (for RSA keys)
string e = 6; // Exponent (for RSA keys)
}
message RawKey {
string algorithm = 1;
string encoding = 2;
string curve = 3;
bytes key = 4;
}
-50
View File
@@ -13,10 +13,6 @@ option go_package = "github.com/onsonr/sonr/x/did/types";
service Msg {
option (cosmos.msg.v1.service) = true;
// AuthorizeService asserts the given controller is the owner of the given
// address.
rpc AuthorizeService(MsgAuthorizeService) returns (MsgAuthorizeServiceResponse);
// ExecuteTx executes a transaction on the Sonr Blockchain. It leverages
// Macaroon for verification.
rpc ExecuteTx(MsgExecuteTx) returns (MsgExecuteTxResponse);
@@ -25,10 +21,6 @@ service Msg {
// set, address, cid, publicKey, and user-defined alias.
rpc RegisterController(MsgRegisterController) returns (MsgRegisterControllerResponse);
// RegisterService initializes a Service with a given permission scope and
// URI. The domain must have a valid TXT record containing the public key.
rpc RegisterService(MsgRegisterService) returns (MsgRegisterServiceResponse);
// UpdateParams defines a governance operation for updating the parameters.
rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse);
}
@@ -85,48 +77,6 @@ message MsgExecuteTxResponse {
string tx_hash = 2;
}
// MsgAuthorizeService is the message type for the AuthorizeService RPC.
message MsgAuthorizeService {
option (cosmos.msg.v1.signer) = "controller";
// Controller is the address of the controller to authenticate.
string controller = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
// Origin is the origin of the request in wildcard form.
string origin = 2;
// Permissions is the scope of the service.
map<string, string> permissions = 3;
// token is the macron token to authenticate the operation.
string token = 4;
}
// MsgAuthorizeServiceResponse is the response type for the AuthorizeService
// RPC.
message MsgAuthorizeServiceResponse {
bool success = 1;
string token = 2;
}
// MsgRegisterService is the message type for the RegisterService RPC.
message MsgRegisterService {
option (cosmos.msg.v1.signer) = "controller";
// authority is the address of the governance account.
string controller = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
// origin is the origin of the request in wildcard form. Requires valid TXT
// record in DNS.
Service service = 2;
}
// MsgRegisterServiceResponse is the response type for the RegisterService RPC.
message MsgRegisterServiceResponse {
bool success = 1;
string did = 2;
}
// MsgUpdateParams is the Msg/UpdateParams request type.
//
// Since: cosmos-sdk 0.47