• Helps with producing a derivative proof for selective disclosure of claims in credentialSubject.

    Parameters

    • credentialInput: Omit<KiltCredentialV1, "proof">

      The original verifiable credential.

    • proofInput: KiltAttestationProofV1

      The original proof.

    • disclosedClaims: (keyof CredentialSubject)[]

      An array of claims that are to be revealed. The id of the credentialSubject is always revealed.

    Returns {
        credential: Omit<KiltCredentialV1, "proof">;
        proof: KiltAttestationProofV1;
    }

    A copy of the credential (without proof) where credentialSubject contains only selected claims and a copy of proof containing only salt entries for these.

    Example

    const { proof, credential } = applySelectiveDisclosure(
    originalCredential,
    originalProof,
    ['name', 'address']
    )
    const derivedCredential = { ...credential, proof }