Skip to main content

Proof

When a verifier asks a holder to prove something, the wallet receives a verification request, called a proof request in the SDK. These methods let a cloud wallet look at a proof request, answer it with a presentation of a stored credential, or decline it. They act on one wallet, so create the CloudWallet with that wallet's access token (see Authentication).

Most methods take a protocol: use 'openid' for EU Digital Identity and 'didcomm' for cheqd and Indicio.

Preview proof​

Shows what a proof request asks for, before the wallet answers or declines it.

import { CloudWallet } from '@hovi/cloudwallet-sdk';

const wallet = new CloudWallet({
walletAccessToken: '<WALLET_ACCESS_TOKEN>',
apiBaseUrl: 'https://cloudwallet.hovi.id',
});

const result = await wallet.previewProof({
protocol: 'openid',
proofRequestUri: '<PROOF_REQUEST_URI>',
});

Params​

ParameterTypeDescription
protocolstring (Required)openid or didcomm.
proofRequestUristring (Optional)EU Digital Identity: the proof request URI from the verifier, for example from a QR code.
proofRecordIdstring (Optional)cheqd and Indicio: the ID of the proof request the wallet received.
connectionIdstring (Optional)cheqd and Indicio: the ID of the connection the request came over.

Submit presentation​

Answers a proof request by sharing a stored credential with the verifier.

import { CloudWallet } from '@hovi/cloudwallet-sdk';

const wallet = new CloudWallet({
walletAccessToken: '<WALLET_ACCESS_TOKEN>',
apiBaseUrl: 'https://cloudwallet.hovi.id',
});

const result = await wallet.submitPresentation({
protocol: 'openid',
proofRequestUri: '<PROOF_REQUEST_URI>',
credentialId: '<CREDENTIAL_ID>',
});

Params​

ParameterTypeDescription
protocolstring (Required)openid or didcomm.
proofRequestUristring (Optional)EU Digital Identity: the proof request URI.
proofRecordIdstring (Optional)cheqd and Indicio: the ID of the proof request.
credentialIdstring (Optional)The ID of the stored credential to share.

Get proof request by ID​

Gets one proof request the wallet received.

import { CloudWallet } from '@hovi/cloudwallet-sdk';

const wallet = new CloudWallet({
walletAccessToken: '<WALLET_ACCESS_TOKEN>',
apiBaseUrl: 'https://cloudwallet.hovi.id',
});

const result = await wallet.getProofRequestById({
proofRecordId: '<PROOF_RECORD_ID>',
});

Params​

ParameterTypeDescription
proofRecordIdstring (Required)The ID of the proof request.

Get proof requests​

Lists the proof requests the wallet has received.

import { CloudWallet } from '@hovi/cloudwallet-sdk';

const wallet = new CloudWallet({
walletAccessToken: '<WALLET_ACCESS_TOKEN>',
apiBaseUrl: 'https://cloudwallet.hovi.id',
});

const result = await wallet.getProofRequests();

Decline proof request​

Declines a proof request. Nothing is shared with the verifier.

import { CloudWallet } from '@hovi/cloudwallet-sdk';

const wallet = new CloudWallet({
walletAccessToken: '<WALLET_ACCESS_TOKEN>',
apiBaseUrl: 'https://cloudwallet.hovi.id',
});

const result = await wallet.declineProofRequest({
protocol: 'didcomm',
proofRecordId: '<PROOF_RECORD_ID>',
});

Params​

ParameterTypeDescription
protocolstring (Required)openid or didcomm.
proofRecordIdstring (Required)The ID of the proof request to decline.