Skip to main content

Present a Credential

With a valid credential, Claimers can now go to Verifiers to request some service upon providing proof of validity of a certain credential. The process of presenting one or more credentials to a Verifier is called Presentation.

This step, similar to the attestation request, requires that a communication channel exist between the Claimer and the Verifier so that information about the presentation can be shared. To verify the revocation status of the presented credential(s), a Verifier must be able to interact with a KILT full node.

info

KILT supports selective disclosure of claims when creating presentations. This means that given a credential, it is possible for the Claimer to reveal only a subset of its claims, depending on the requirements set by the Verifier. Check the snippet below to see how that is done using the KILT SDK.

The Claimer can generate a presentation starting from a credential, optionally specifying the fields to reveal and a presentation challenge, which is useful to prove freshness of the generated presentation.

import * as Kilt from '@kiltprotocol/sdk-js'

export async function createPresentation(
credential: Kilt.ICredential,
signCallback: Kilt.SignCallback,
selectedAttributes?: string[],
challenge?: string
): Promise<Kilt.ICredentialPresentation> {
// Create a presentation with only the specified fields revealed, if specified.
return Kilt.Credential.createPresentation({
credential,
signCallback,
selectedAttributes,
challenge
})
}