From 0696ef8b94ec846ca6b8645de03858387789746b Mon Sep 17 00:00:00 2001 From: "Prad Nukala (aider)" Date: Sat, 31 Aug 2024 12:21:41 -0400 Subject: [PATCH] feat: Expand KeyType enum and update KeyInfo message in genesis.proto --- proto/did/v1/genesis.proto | 32 +++++++++++++++++++++++++++++++- proto/did/v1/grants.proto | 8 ++++++++ 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/proto/did/v1/genesis.proto b/proto/did/v1/genesis.proto index 9adc7f1a1..0abf17a7a 100644 --- a/proto/did/v1/genesis.proto +++ b/proto/did/v1/genesis.proto @@ -81,11 +81,41 @@ message ChainInfo { } } +import "did/v1/grants.proto"; + // KeyInfo defines information for accepted PubKey types message KeyInfo { - string key_type = 1; // e.g., "secp256k1", "ed25519", "webauthn" + KeyType key_type = 1; string algorithm = 2; // e.g., "ES256", "EdDSA", "ES256K" string curve = 3; // e.g., "P-256", "Ed25519", "secp256k1" bool is_cbor = 4; // true for WebAuthn CBOR-encoded keys, false for others string encoding = 5; // e.g., "hex", "base64", "multibase" + + // Additional fields for specific key types + oneof key_specific_info { + WebauthnInfo webauthn_info = 6; + FidoInfo fido_info = 7; + MPCInfo mpc_info = 8; + ZKInfo zk_info = 9; + } +} + +message WebauthnInfo { + string attestation_type = 1; + string aaguid = 2; +} + +message FidoInfo { + string authenticator_attachment = 1; + repeated string supported_algorithms = 2; +} + +message MPCInfo { + int32 threshold = 1; + int32 total_parties = 2; +} + +message ZKInfo { + string proof_system = 1; + string setup_parameters = 2; } diff --git a/proto/did/v1/grants.proto b/proto/did/v1/grants.proto index 9399e2308..7e7383c53 100644 --- a/proto/did/v1/grants.proto +++ b/proto/did/v1/grants.proto @@ -17,12 +17,20 @@ enum DIDNamespace { enum KeyType { KEY_TYPE_UNSPECIFIED = 0; + // Blockchain key types KEY_TYPE_SECP256K1 = 1; KEY_TYPE_ED25519 = 2; KEY_TYPE_P256 = 3; KEY_TYPE_BLS12381 = 4; KEY_TYPE_X25519 = 5; KEY_TYPE_SCHNORR = 6; + // Webauthn and FIDO key types + KEY_TYPE_WEBAUTHN = 7; + KEY_TYPE_FIDO = 8; + // MPC key type + KEY_TYPE_MPC = 9; + // ZK key type + KEY_TYPE_ZK = 10; } // PermissionScope define the Capabilities Controllers can grant for Services