Skip to main content

How can a verifier see the data of a credential?

N
Written by Nick Reinhart
Updated over a year ago

Sometimes a verifier might want to know a specific field, so they can ask the wallet holder not to hide a specific attribute, but in the end the verifier won’t know anything unless the wallet holder lets them.

When creating a Proof, it can either create a proof that allows to present all the credential fields or it can generate a selective proof (contains only a subset of the fields). Take a look at both examples below:

let proof = await trinsic.credential().createProof(
CreateProofRequest.fromPartial({
documentJson: issueResponse.documentJson,
itemId: insertItemResponse.itemId,
}),
);

let selectiveProof = await trinsic.credential().createProof(
CreateProofRequest.fromPartial({
documentJson: issueResponse.documentJson,
itemId: insertItemResponse.itemId,
revealTemplate: {
templateAttributes: ["firstName", "lastName"],
},
}),
);

You can find more information about proofs here.

Did this answer your question?