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.
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
- React Native
- iOS
- Android
createProofSchema(
request: CreateProofSchemaRequest
): Promise<ProofSchema["id"]>
func createProofSchema(request: CreateProofSchemaRequestDto) throws -> String
fun `createProofSchema`(`request`: CreateProofSchemaRequestDto): kotlin.String
Parameters
- React Native
- iOS
- Android
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,
}
public struct CreateProofSchemaRequestDto {
public var name: String
public var organisationId: String
public var expireDuration: UInt32
public var proofInputSchemas: [ProofInputSchemaRequestDto]
}
public struct ProofInputSchemaRequestDto {
public var credentialSchemaId: String
public var validityConstraint: Int64?
public var claimSchemas: [CreateProofSchemaClaimRequestDto]
}
public struct CreateProofSchemaClaimRequestDto {
public var id: String
public var required: Bool
}
data class CreateProofSchemaRequestDto (
var `name`: kotlin.String,
var `organisationId`: kotlin.String,
var `expireDuration`: kotlin.UInt,
var `proofInputSchemas`: List<ProofInputSchemaRequestDto>
)
data class ProofInputSchemaRequestDto (
var `credentialSchemaId`: kotlin.String,
var `validityConstraint`: kotlin.Long?,
var `claimSchemas`: List<CreateProofSchemaClaimRequestDto>
)
data class CreateProofSchemaClaimRequestDto (
var `id`: kotlin.String,
var `required`: kotlin.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 theclaimSchemas
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 thevalidityConstraint
, 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 theclaims
object. -
required
- Whether the attribute is required in the proof request.
-
-
Return value
The proofSchemaId
is returned.