The vLEI Verifier is a service that verifies vLEI credentials. It implements a robust verification system that handles cryptographic verification, authorization, and state management.
The verification process in the /presentations endpoint follows these steps:
-
Request Validation
- Accepts CESR format
- Requires a witness URL (mandatory in production)
- Validates content type as
application/json+cesr
-
Credential Processing
parsing.Parser().parse(ims=ims, kvy=self.hby.kvy, tvy=self.tvy, vry=self.vry)
- Parses the incoming CESR message
- Verifies cryptographic signatures
- Validates credential structure
-
State Management
- Credentials can be in states:
CRED_CRYPT_INVALID: Cryptographic verification failedCRED_CRYPT_VALID: Cryptographic verification passedAUTH_PENDING: Awaiting authorizationAUTH_SUCCESS: Fully authorizedAUTH_REVOKED: Credential has been revokedAUTH_FAIL: Credential unauthorized
- Credentials can be in states:
-
Witness Integration
- Witness URL is stored with credential state
- Used for revocation checks
- Mandatory in production environment
The authorization system implements a multi-layer verification process:
-
Credential Filters
def cred_filters(self, creder) -> tuple[bool, str]:
- Validates credential schema
- Checks credential type
- Verifies issuer authorization
-
Chain Filters
def chain_filters(self, creder) -> tuple[bool, str]:
- Validates credential chain
- Verifies issuer hierarchy
- Checks credential dependencies
-
Edge Filters
def edge_filters(self, cred_type: str, edge, valid_edges: dict):
- Validates credential edges
- Verifies relationships between credentials
-
Attribute Filters
def attr_filters(self, cred, valid_attrs: dict):
- Validates credential attributes
- Verifies attribute values
- Checks attribute constraints
The state management system provides persistent storage and state tracking:
-
Credential States
@dataclass class CredProcessState: said: Optional[str] = None aid: Optional[str] = None state: Optional[str] = None info: Optional[str] = None role: Optional[str] = None witness_url: Optional[str] = None date: str = field(default_factory=lambda: datetime.datetime.now(datetime.UTC).isoformat())
- Tracks credential processing state
- Stores verification metadata
- Maintains witness URL information
-
State History
@dataclass class StateHistory: aid: Optional[str] = None last_update: float = field(default_factory=lambda: time.time()) state_history: List[CredProcessState | AidProcessState] = field(default_factory=lambda: [])
- Maintains historical state changes
- Tracks credential lifecycle
- Supports audit trails
-
Database Management
class VerifierBaser(dbing.LMDBer):
- Provides persistent storage
- Manages credential states
- Handles state transitions
-
Production Requirements
- Witness URL is mandatory
- All cryptographic verifications must pass
- Authorization must be complete
-
State Transitions
- States are immutable
- History is preserved
- Transitions are logged
-
Error Handling
- Invalid credentials are rejected
- Failed verifications are logged
- State changes are tracked
The verification process starts in the PresentationResourceEndpoint.on_put method:
File: src/verifier/core/verifying.py
Class: PresentationResourceEndpoint
Method: on_put
Lines: ~280-400
The key steps are:
- Parse the CESR message using KERI's parser
- Check if the credential was found and valid
- Update the credential state in the database
- Store the witness URL for future revocation checks
The authorization process is handled by the Authorizer class:
File: src/verifier/core/authorizing.py
Class: Authorizer
Method: processPresentations
Lines: ~70-150
The authorization process:
- Iterates through credentials in the database
- Applies credential filters to validate schema and type
- Applies chain filters to validate issuer hierarchy
- Updates credential state based on filter results
State management is handled by the VerifierBaser class:
File: src/verifier/core/basing.py
Class: VerifierBaser
Lines: ~169-220
State transitions are managed through:
- Pinning new states to the database
- Updating state history
- Tracking state changes over time
The revocation checking process is handled by the CredentialRevocationChecker class:
File: src/verifier/core/observing.py
Class: CredentialRevocationChecker
Method: _check_revocations
Lines: ~35-63
The revocation checking process:
- Iterates through credentials in the database
- Checks with the witness for credential status
- Processes revocation information
- Updates credential state if revoked