Available Validation Modes
Validation modes are configured inserver.yaml under verifier.validationMode:
verifier:
none
No content validation is performed. The verifier accepts any credential structure after cryptographic verification.verifier:
- Development and testing environments
- When you have external validation mechanisms
- Backwards compatibility scenarios
combined
Performs both JSON-LD validation and schema validation together. This is the most comprehensive validation mode.verifier:
Recommended: This mode provides the strongest guarantees about credential structure and semantics.
- JSON-LD context resolution and processing
- Schema compliance
- Credential structure integrity
- Semantic consistency
jsonLd
Uses the JSON-LD parser for validation. Ensures that the credential is valid JSON-LD and can be processed correctly.verifier:
- Context documents are resolvable
- JSON-LD syntax is correct
- Terms are properly defined in contexts
- RDF graph can be constructed
baseContext
Validates that only fields and values defined in the base context are present. No extra fields are allowed outside ofcredentialSubject.
verifier:
- All root-level fields exist in the base context
- No unexpected properties at the root level
- Standard VC Data Model compliance
credentialSubjectcan contain custom fields
Configuration Example
Complete verifier configuration with validation mode:verifier:
Default Behavior
If no validation mode is configured, VCVerifier defaults to
none for backwards compatibility. However, you should explicitly configure a validation mode for production deployments.Implementation Details
Validation modes are implemented in theTrustBlocValidator using the Trustbloc VC-GO library:
Source reference: verifier/jwt_verifier.go:89-106
Choosing the Right Mode
| Mode | Security | Flexibility | Performance | Recommended For |
|---|---|---|---|---|
| none | Low | High | Fast | Testing only |
| jsonLd | Medium | High | Medium | JSON-LD ecosystems |
| baseContext | High | Low | Fast | Strict compliance |
| combined | Highest | Medium | Slower | Production systems |