VCMP extrinsic is critical to ensuring the security, privacy, and usability of verifiable credentials. The common VC management extrinsic includes request, issuance, verification, revocation, and management. Below are the Heima VCMP extrinsics and their callers:
request_vc - VC is requested onchain- called by the user
vc_issued - VC is issued - called by the TEE
VCMP event
VCMP events are the different events that occur during the lifecycle of a verifiable credential, such as its creation, issuance, revocation, and update. These events are important for ensuring the integrity and trustworthiness of the VC.
By tracking these events, issuers and credential holders can ensure that their verifiable credentials are up-to-date and accurate. Here are our VCM events:
pub enum Event<T: Config> {
DelegateeAdded {
account: T::AccountId,
},
DelegateeRemoved {
account: T::AccountId,
},
// a VC is requested
VCRequested {
account: T::AccountId,
shard: ShardIdentifier,
assertion: Assertion,
},
// event that should be triggered by TEECallOrigin
// a VC is just issued
// we have `id_graph_hash` field since vc request could create the IDGraph
VCIssued {
identity: Identity,
assertion: Assertion,
id_graph_hash: H256,
req_ext_hash: H256,
},
// Admin account was changed
AdminChanged {
old_admin: Option<T::AccountId>,
new_admin: Option<T::AccountId>,
},
// a Schema is issued
SchemaIssued {
account: T::AccountId,
shard: ShardIdentifier,
index: SchemaIndex,
},
// a Schema is disabled
SchemaDisabled {
account: T::AccountId,
shard: ShardIdentifier,
index: SchemaIndex,
},
// a Schema is activated
SchemaActivated {
account: T::AccountId,
shard: ShardIdentifier,
index: SchemaIndex,
},
// a Schema is revoked
SchemaRevoked {
account: T::AccountId,
shard: ShardIdentifier,
index: SchemaIndex,
},
// event errors caused by processing in TEE
// copied from core_primitives::VCMPError, we use events instead of pallet::errors,
// see https://github.com/litentry/litentry-parachain/issues/1275
RequestVCFailed {
identity: Option<Identity>,
assertion: Assertion,
detail: ErrorDetail,
req_ext_hash: H256,
},
UnclassifiedError {
identity: Option<Identity>,
detail: ErrorDetail,
req_ext_hash: H256,
},
VCIssuedNew {
identity: Identity,
assertion: Assertion,
omni_account: T::AccountId,
req_ext_hash: H256,
},
}
VCMP error event
A VCMP Event can be explained as any unexpected situation or issue that occurs during the process of issuing, managing, and using a VC.
It is crucial to address these errors to ensure the integrity and security of the VC management pallet. This can be achieved through implementing proper error handling mechanisms and protocols and regularly monitoring and updating the system to prevent errors from occurring in the first place. Here are the VC errors:
pub enum Error<T> {
/// a delegatee doesn't exist
DelegateeNotExist,
/// a `request_vc` request from unauthorized user
UnauthorizedUser,
/// the VC already exists
VCAlreadyExists,
/// the ID doesn't exist
VCNotExist,
/// The requester doesn't have the permission (because of subject mismatch)
VCSubjectMismatch,
/// The VC is already disabled
VCAlreadyDisabled,
/// Error when the caller account is not the admin
RequireAdmin,
/// Schema not exists
SchemaNotExists,
/// Schema is already disabled
SchemaAlreadyDisabled,
/// Schema is active
SchemaAlreadyActivated,
SchemaIndexOverFlow,
LengthMismatch,
}