Skip to main content

Create proof schema

A proof schema defines the attributes a verifier requests from a credentials holder. In essence, it is the collection of items of information to be requested.

Proof schemas are built from attributes defined in credential schemas. Each item of information to be requested must first be part of a credential schema in the system. Proof schemas are not restricted to pulling attributes from a single credential schema or from credential schemas using a particular credential format; a single proof schema can be composed of any number of attributes from any number of credential schemas within the organization.

Restrictions on proof schema creation are noted below.

Proof schema restrictions

A holder's presentation must be signed by the same key that signed the credential being shared. This means the holder cannot submit two credentials signed with different keys in the same presentation; holder presentations of more than one credential only work if the holder's key is the same in all credentials.

As a result, when creating proof schemas it is not possible to combine hardware- and software-based credentials. For proof requests with multiple credentials, all credentials must have the same walletStorageType. See the wallet storage type guide.

Function

createProofSchema(
request: CreateProofSchemaRequest
): Promise<ProofSchema["id"]>

Parameters

export interface CreateProofSchemaRequest {
name: string;
organisationId: string;
expireDuration: number;
proofInputSchemas: ProofInputSchemaRequest[];
}
export interface ProofInputSchemaRequest {
credentialSchemaId: string;
validityConstraint?: number;
claimSchemas: ProofSchemaClaimRequest[];
}
export interface ProofSchemaClaimRequest {
id: string,
required: boolean,
}

Fields

  • name - Must be unique in the organization.

  • organisationId - Specify the organization.

  • expireDuration - Defines the length of storage of received proofs, in seconds. After the defined duration, the received proof and its data are deleted from the system. If 0, the proofs received when using this proof schema will not be deleted.

  • proofInputSchemas - The collection of attributes, from one or more credentials, being requested.

    • credentialSchemaId - ID of the credential schema from which the claimSchemas object is assembled.

    • validityConstraint - For credentials with LVVC revocation method: defines the maximum age at which an LVVC will be validated. If the time since the LVVC was issued exceeds the validityConstraint, the credential will not be validated.

    • claimSchemas - Defines the set of attributes being requested when making proof requests using this schema. See the claimSchemas object guide for more information.

      • id - The UUID of the attribute being requested, from the claims object.

      • required - Whether the attribute is required in the proof request.

Return value

The proofSchemaId is returned.