Comment on page
Client SDKs Documentation
In Web3, VCs are digital equivalents of real-world documents, like passports or degrees. Issued by trusted entities and cryptographically signed, they allow users to prove their identity, identity statements, or qualifications securely and privately. Stored in a user's digital wallet, these credentials can be shared and verified by others, ensuring authenticity and integrity. The process of authentication involves three primary roles: the issuer (who issues and signs the credential), the holder (the user who possesses the credential), and the verifier (who checks the credential's authenticity).
Standardized data models, like those from the World Wide Web Consortium (W3C), ensure broad compatibility and interoperability across different systems.
Our Protocol contains a growing list of distinct assertions. Each assertion defines the subject of the verifiable credential, the kind of information being stated, and its corresponding value.
You can find the available assertions by exploring the
vcManagement.requestVc()method using the Polkadot.js App
Exploring the vcManagement.requestVc extrinsic. An arrow points to the assertion parameter.
assertionparameter lists the available Assertion IDs and the parameters needed to request a verifiable credential depends on the type of assertion.
A credential definition is a unique combination that results from Litentry Assertion with a fixed set of parameters.
For instance, within the IdentityHub, we refer to the Verifiable Credentials produced by Assertion
A4as "LIT Holding Time". Here, the number
10is used as a parameter. This parameter indicates the threshold of LIT tokens held by the user. Consequently, for the IdentityHub, if a Verifiable Credential is produced by Assertion
10as its parameter, it won't be recognized as a "LIT Holding Time" VC, irrespective of its stated claim.
@litentry/profilesalso exposes this list, along with all their metadata.
Clients are free to create their credential definitions based on the parameters that best suit their interests.
A score provides a numerical value representing one or multiple Verifiable Credentials.
When we have a Verifiable Credential and its corresponding Credential Definition, which establishes the rules for its claims, we can then convert that claim into a numerical score.
Using the "LIT Holding Time" Credential Definition as an example:
- 1.We utilize the definition to verify if a Verifiable Credential belongs to the "LIT Holding Time" type.
- 2.If confirmed, the Verifiable Credential is deemed as successfully claimed.
- 3.Scores are then designated based on the VC's findings. For instance, holding the token for 0 to 1 year might yield 5 points, 1 to 2 years might get 10 points, and so on.
For boolean-based assertions, like those from the Assertion
oneblock, points are allocated if the outcome of the claim is positive or truthful.
Within the IdentityHub, you'll see how these Scores and Verifiable Credentials interact.
For the developer community, the
@litentry/profilespackage not only houses all the scoring functions found in the IdentityHub but also provides tools to craft your own.
We use Profiles to refer to the ensemble of characteristics deemed valuable by a specific project. It is through these Profiles that users can understand the value that their web3 identity has to a particular project.
A Profile is made up of:
- A Score to achieve, as well as, the score each Verifiable Credential could claim.
- The list of Credential Definitions that compose the Score.
You can find all the available Profiles in the IdentityHub.
For developers, the
@litentry/profilespackage contains all the Profiles featured in the IdentityHub along with its metadata such as name, icon, platform, etc.
Here is a summary of how the concepts above interact together:
- The Litentry Protocol issues Verifiable Credentials (VCs) based on available Assertions.
- The resulting VCs are stored by users and they can be claimed based on the Credential Definition constraints dictated by the IdentityHub (although any client can define their own).
- The resulting VCs are downloadable by users via identity-hub (see below screenshot), and then these downloaded VCs can be uploaded to any 3rd party as a user deems fit. This may be to claim some reward by providing certain types of VCs.
- Claimed Verifiable Credentials are assigned a Score based on the Project’s Profile rules.
- Each Project’s Profile grants rewards based on the user-claimed Verifiable Credentials and their score.
In this package you can find helpers to process and validate Litentry Verifiable Credentials. Including:
parseVcmethod to parse VC JSON into a Verifiable Credential object.
validateVcmethod to validate a given VC JSON by interacting with the Litentry parachain and TEE.
In this package you can find the logic, helpers and metadata featured in IdentityHub for everything related Profiles and Scores. Including:
- 1.Evaluate any score used in the IdentityHub.
- 2.Create your own score.
- 3.Claim a Litentry Verifiable Credential
@litentry/vc-sdkdoes not include tools for generating VCs. As of now, it only offers tools to parse or validate pre-existing VCs. The only out-of-the-box solution to generate VCs via the Litentry protocol is the IdentityHub.