User-defined types (UDTs)
User-defined types (UDTs) are a core component of the Truvity SDK, enabling developers to define the structure and semantics of Verifiable Credentials (VCs) in a strongly typed and idiomatic way for their chosen programming language.
What is a UDT?
A user-defined type (UDT) is a custom data model that represents a claims within a credential. UDTs allow for flexibility in defining the structure of credential claims, ensuring that each credential follows a specific schema.
As a developer, you use UDTs as the source of truth for creating schemas, which are then used by the Truvity platform to ensure the integrity, verifiability, and interoperability of the verifiable credentials you issue.
Benefits of UDTs
UDTs enable enhanced type safety and ensure that errors related to data types are caught during the credential lifecycle, including creation, updating, issuance, and validation. These types are particularly useful when credentials need to be tailored for different use cases such as personal identification, birth certificates, or other types of documents.
Using UDTs simplifies development and ensures that:
- Credential claims are well-structured.
- Schema validation is enforced.
- Credentials can be linked or nested, improving interoperability.