Using the /present-proof-2.0
API endpoints, it is possible to present Verifiable Credentials, signed by a cheqd DID, in a few clicks or lines of code. This process enables secure and trustworthy sharing of verifiable credentials within the ACA-Py framework and cheqd ecosystem.
Use any supported method to create a connection with the Holder. Automated out-of-band protocol is recommended. You can follow the same steps as described in Issue a Verifiable Credential.
After connection is established, the Verifier can send a proof request to the Holder.
The request body will depend on the credential, but here is a sample.
{
"connection_id": "<verifier-to-holder-conn-id>",
"auto_verify": false,
"auto_remove": false,
"comment": "Presentation request from Issuer",
"presentation_request": {
"anoncreds": {
"name": "proof",
"version": "1.0",
"requested_predicates": {
"additionalProp1": {
"name": "score",
"p_value": 40,
"p_type": ">",
"restrictions": [{"cred_def_id": "<cred-def-id>"}]
}
},
"requested_attributes": {},
"non_revoked": {"to": <some-time-in-future>}
}
},
"trace": false
}
Holder can get the stored credentials from own wallet and format a proof to send to the Verifier.
Verifier receives the presentation via the connection, and can use the following API to verify. The response must have verified: true
.
/present-proof-2.0/send-request
Whether to remove the presentation exchange record on completion (overrides --preserve-exchange-records configuration setting)
Verifier choice to auto-verify proof presentation
false
Connection identifier
3fa85f64-5717-4562-b3fc-2c963f66afa6
Whether to trace event (default false)
false
curl -L \
--request POST \
--url '/present-proof-2.0/send-request' \
--header 'Content-Type: application/json' \
--data '{"auto_verify":false,"connection_id":"3fa85f64-5717-4562-b3fc-2c963f66afa6","presentation_request":{"anoncreds":{"name":"Proof request","non_revoked":{"from":1640995199,"to":1640995199},"nonce":"1","requested_attributes":{"ANY_ADDITIONAL_PROPERTY":{"name":"favouriteDrink","names":["age"],"non_revoked":{"from":1640995199,"to":1640995199},"restrictions":[{"ANY_ADDITIONAL_PROPERTY":"did:(method):3:CL:20:tag"}]}},"requested_predicates":{"ANY_ADDITIONAL_PROPERTY":{"name":"index","non_revoked":{"from":1640995199,"to":1640995199},"p_type":">=","p_value":1,"restrictions":[{"ANY_ADDITIONAL_PROPERTY":"did:(method):3:CL:20:tag"}]}},"version":"1.0"},"dif":{"options":{"challenge":"3fa85f64-5717-4562-b3fc-2c963f66afa6","domain":"4jt78h47fh47"},"presentation_definition":{"format":{"di_vc":{},"jwt":{},"jwt_vc":{},"jwt_vp":{},"ldp":{},"ldp_vc":{},"ldp_vp":{}},"id":"3fa85f64-5717-4562-b3fc-2c963f66afa6","input_descriptors":[{"constraints":{"fields":[{"filter":{"enum":[],"maxLength":1234,"minLength":1234,"not":false},"path":[null],"predicate":"required"}],"is_holder":[{"directive":"required","field_id":["3fa85f64-5717-4562-b3fc-2c963f66afa6"]}],"status_active":"required","status_revoked":"required","status_suspended":"required","subject_is_issuer":"required"},"group":[null],"metadata":{},"schema":{"oneof_filter":[[{"uri":"https://www.w3.org/Test1#Test1"},{"uri":"https://www.w3.org/Test2#Test2"}],{"oneof_filter":[[{"uri":"https://www.w3.org/Test1#Test1"}],[{"uri":"https://www.w3.org/Test2#Test2"}]]}]}}],"submission_requirements":["[Circular Reference]"]},"ANY_ADDITIONAL_PROPERTY":"anything"},"indy":{"name":"Proof request","non_revoked":{"from":1640995199,"to":1640995199},"nonce":"1","requested_attributes":{"ANY_ADDITIONAL_PROPERTY":{"name":"favouriteDrink","names":["age"],"non_revoked":{"from":1640995199,"to":1640995199},"restrictions":[{"ANY_ADDITIONAL_PROPERTY":"WgWxqztrNooG92RXvxSTWv:3:CL:20:tag"}]}},"requested_predicates":{"ANY_ADDITIONAL_PROPERTY":{"name":"index","non_revoked":{"from":1640995199,"to":1640995199},"p_type":">=","p_value":1,"restrictions":[{"ANY_ADDITIONAL_PROPERTY":"WgWxqztrNooG92RXvxSTWv:3:CL:20:tag"}]}},"version":"1.0"}},"trace":false}'
{
"auto_present": false,
"auto_remove": false,
"auto_verify": true,
"by_format": {
"pres": {},
"pres_proposal": {},
"pres_request": {}
},
"connection_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"created_at": "2021-12-31T23:59:59Z",
"error_msg": "Invalid structure",
"initiator": "self",
"pres": {
"@id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"@type": "https://didcomm.org/my-family/1.0/my-message-type",
"comment": "text",
"formats": [
{
"attach_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"format": "dif/presentation-exchange/submission@v1.0"
}
],
"presentations~attach": [
{
"@id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"byte_count": 1234,
"data": {
"base64": "ey4uLn0=",
"json": "{\"sample\": \"content\"}",
"jws": {
"header": {
"kid": "did:sov:LjgpST2rjsoxYegQDRm7EL#keys-4"
},
"protected": "ey4uLn0",
"signature": "ey4uLn0",
"signatures": [
{
"header": {
"kid": "did:sov:LjgpST2rjsoxYegQDRm7EL#keys-4"
},
"protected": "ey4uLn0",
"signature": "ey4uLn0"
}
]
},
"links": [
"https://link.to/data"
],
"sha256": "617a48c7c8afe0521efdc03e5bb0ad9e655893e6b4b51f0e794d70fba132aacb"
},
"description": "view from doorway, facing east, with lights off",
"filename": "IMG1092348.png",
"lastmod_time": "2021-12-31T23:59:59Z",
"mime-type": "image/png"
}
]
},
"pres_ex_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"pres_proposal": {
"@id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"@type": "https://didcomm.org/my-family/1.0/my-message-type",
"comment": "text",
"formats": [
{
"attach_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"format": "dif/presentation-exchange/submission@v1.0"
}
],
"proposals~attach": [
{
"@id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"byte_count": 1234,
"data": {
"base64": "ey4uLn0=",
"json": "{\"sample\": \"content\"}",
"jws": {
"header": {
"kid": "did:sov:LjgpST2rjsoxYegQDRm7EL#keys-4"
},
"protected": "ey4uLn0",
"signature": "ey4uLn0",
"signatures": [
{
"header": {
"kid": "did:sov:LjgpST2rjsoxYegQDRm7EL#keys-4"
},
"protected": "ey4uLn0",
"signature": "ey4uLn0"
}
]
},
"links": [
"https://link.to/data"
],
"sha256": "617a48c7c8afe0521efdc03e5bb0ad9e655893e6b4b51f0e794d70fba132aacb"
},
"description": "view from doorway, facing east, with lights off",
"filename": "IMG1092348.png",
"lastmod_time": "2021-12-31T23:59:59Z",
"mime-type": "image/png"
}
]
},
"pres_request": {
"@id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"@type": "https://didcomm.org/my-family/1.0/my-message-type",
"comment": "text",
"formats": [
{
"attach_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"format": "dif/presentation-exchange/submission@v1.0"
}
],
"request_presentations~attach": [
{
"@id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"byte_count": 1234,
"data": {
"base64": "ey4uLn0=",
"json": "{\"sample\": \"content\"}",
"jws": {
"header": {
"kid": "did:sov:LjgpST2rjsoxYegQDRm7EL#keys-4"
},
"protected": "ey4uLn0",
"signature": "ey4uLn0",
"signatures": [
{
"header": {
"kid": "did:sov:LjgpST2rjsoxYegQDRm7EL#keys-4"
},
"protected": "ey4uLn0",
"signature": "ey4uLn0"
}
]
},
"links": [
"https://link.to/data"
],
"sha256": "617a48c7c8afe0521efdc03e5bb0ad9e655893e6b4b51f0e794d70fba132aacb"
},
"description": "view from doorway, facing east, with lights off",
"filename": "IMG1092348.png",
"lastmod_time": "2021-12-31T23:59:59Z",
"mime-type": "image/png"
}
],
"will_confirm": true
},
"role": "prover",
"state": "proposal-sent",
"thread_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"trace": true,
"updated_at": "2021-12-31T23:59:59Z",
"verified": "true",
"verified_msgs": [
"text"
]
}
/present-proof-2.0/records/{pres_ex_id}/send-presentation
Presentation exchange identifier
3fa85f64-5717-4562-b3fc-2c963f66afa6
[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-4[a-fA-F0-9]{3}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}
Presentation specification for anoncreds
Whether to remove the presentation exchange record on completion (overrides --preserve-exchange-records configuration setting)
Optional Presentation specification for DIF, overrides the PresentationExchange record's PresRequest
Presentation specification for indy
Record trace information, based on agent configuration
curl -L \
--request POST \
--url '/present-proof-2.0/records/{pres_ex_id}/send-presentation' \
--header 'Content-Type: application/json' \
--data '{"anoncreds":{"requested_attributes":{"ANY_ADDITIONAL_PROPERTY":{"cred_id":"3fa85f64-5717-4562-b3fc-2c963f66afa6"}},"requested_predicates":{"ANY_ADDITIONAL_PROPERTY":{"cred_id":"3fa85f64-5717-4562-b3fc-2c963f66afa6","timestamp":1640995199}},"self_attested_attributes":{"ANY_ADDITIONAL_PROPERTY":"self_attested_value"},"trace":false},"dif":{"presentation_definition":{"format":{"di_vc":{},"jwt":{},"jwt_vc":{},"jwt_vp":{},"ldp":{},"ldp_vc":{},"ldp_vp":{}},"id":"3fa85f64-5717-4562-b3fc-2c963f66afa6","input_descriptors":[{"constraints":{"fields":[{"filter":{"enum":[],"maxLength":1234,"minLength":1234,"not":false},"path":[null],"predicate":"required"}],"is_holder":[{"directive":"required","field_id":["3fa85f64-5717-4562-b3fc-2c963f66afa6"]}],"status_active":"required","status_revoked":"required","status_suspended":"required","subject_is_issuer":"required"},"group":[null],"metadata":{},"schema":{"oneof_filter":[[{"uri":"https://www.w3.org/Test1#Test1"},{"uri":"https://www.w3.org/Test2#Test2"}],{"oneof_filter":[[{"uri":"https://www.w3.org/Test1#Test1"}],[{"uri":"https://www.w3.org/Test2#Test2"}]]}]}}],"submission_requirements":[{"count":1234,"from_nested":"[Circular Reference]","max":1234,"min":1234,"rule":"all"}]},"record_ids":{"<input descriptor id_1>":["<record id_1>","<record id_2>"],"<input descriptor id_2>":["<record id>"]},"reveal_doc":{"@context":["https://www.w3.org/2018/credentials/v1","https://w3id.org/security/bbs/v1"],"@explicit":true,"@requireAll":true,"credentialSubject":{"@explicit":true,"@requireAll":true,"Observation":[{"effectiveDateTime":{},"@explicit":true,"@requireAll":true}]},"issuanceDate":{},"issuer":{},"type":["VerifiableCredential","LabReport"]}},"indy":{"requested_attributes":{"ANY_ADDITIONAL_PROPERTY":{"cred_id":"3fa85f64-5717-4562-b3fc-2c963f66afa6"}},"requested_predicates":{"ANY_ADDITIONAL_PROPERTY":{"cred_id":"3fa85f64-5717-4562-b3fc-2c963f66afa6","timestamp":1640995199}},"self_attested_attributes":{"ANY_ADDITIONAL_PROPERTY":"self_attested_value"},"trace":false}}'
{
"auto_present": false,
"auto_remove": false,
"auto_verify": true,
"by_format": {
"pres": {},
"pres_proposal": {},
"pres_request": {}
},
"connection_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"created_at": "2021-12-31T23:59:59Z",
"error_msg": "Invalid structure",
"initiator": "self",
"pres": {
"@id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"@type": "https://didcomm.org/my-family/1.0/my-message-type",
"comment": "text",
"formats": [
{
"attach_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"format": "dif/presentation-exchange/submission@v1.0"
}
],
"presentations~attach": [
{
"@id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"byte_count": 1234,
"data": {
"base64": "ey4uLn0=",
"json": "{\"sample\": \"content\"}",
"jws": {
"header": {
"kid": "did:sov:LjgpST2rjsoxYegQDRm7EL#keys-4"
},
"protected": "ey4uLn0",
"signature": "ey4uLn0",
"signatures": [
{
"header": {
"kid": "did:sov:LjgpST2rjsoxYegQDRm7EL#keys-4"
},
"protected": "ey4uLn0",
"signature": "ey4uLn0"
}
]
},
"links": [
"https://link.to/data"
],
"sha256": "617a48c7c8afe0521efdc03e5bb0ad9e655893e6b4b51f0e794d70fba132aacb"
},
"description": "view from doorway, facing east, with lights off",
"filename": "IMG1092348.png",
"lastmod_time": "2021-12-31T23:59:59Z",
"mime-type": "image/png"
}
]
},
"pres_ex_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"pres_proposal": {
"@id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"@type": "https://didcomm.org/my-family/1.0/my-message-type",
"comment": "text",
"formats": [
{
"attach_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"format": "dif/presentation-exchange/submission@v1.0"
}
],
"proposals~attach": [
{
"@id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"byte_count": 1234,
"data": {
"base64": "ey4uLn0=",
"json": "{\"sample\": \"content\"}",
"jws": {
"header": {
"kid": "did:sov:LjgpST2rjsoxYegQDRm7EL#keys-4"
},
"protected": "ey4uLn0",
"signature": "ey4uLn0",
"signatures": [
{
"header": {
"kid": "did:sov:LjgpST2rjsoxYegQDRm7EL#keys-4"
},
"protected": "ey4uLn0",
"signature": "ey4uLn0"
}
]
},
"links": [
"https://link.to/data"
],
"sha256": "617a48c7c8afe0521efdc03e5bb0ad9e655893e6b4b51f0e794d70fba132aacb"
},
"description": "view from doorway, facing east, with lights off",
"filename": "IMG1092348.png",
"lastmod_time": "2021-12-31T23:59:59Z",
"mime-type": "image/png"
}
]
},
"pres_request": {
"@id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"@type": "https://didcomm.org/my-family/1.0/my-message-type",
"comment": "text",
"formats": [
{
"attach_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"format": "dif/presentation-exchange/submission@v1.0"
}
],
"request_presentations~attach": [
{
"@id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"byte_count": 1234,
"data": {
"base64": "ey4uLn0=",
"json": "{\"sample\": \"content\"}",
"jws": {
"header": {
"kid": "did:sov:LjgpST2rjsoxYegQDRm7EL#keys-4"
},
"protected": "ey4uLn0",
"signature": "ey4uLn0",
"signatures": [
{
"header": {
"kid": "did:sov:LjgpST2rjsoxYegQDRm7EL#keys-4"
},
"protected": "ey4uLn0",
"signature": "ey4uLn0"
}
]
},
"links": [
"https://link.to/data"
],
"sha256": "617a48c7c8afe0521efdc03e5bb0ad9e655893e6b4b51f0e794d70fba132aacb"
},
"description": "view from doorway, facing east, with lights off",
"filename": "IMG1092348.png",
"lastmod_time": "2021-12-31T23:59:59Z",
"mime-type": "image/png"
}
],
"will_confirm": true
},
"role": "prover",
"state": "proposal-sent",
"thread_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"trace": true,
"updated_at": "2021-12-31T23:59:59Z",
"verified": "true",
"verified_msgs": [
"text"
]
}
/present-proof-2.0/records/{pres_ex_id}/verify-presentation
Presentation exchange identifier
3fa85f64-5717-4562-b3fc-2c963f66afa6
[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-4[a-fA-F0-9]{3}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}
curl -L \
--request POST \
--url '/present-proof-2.0/records/{pres_ex_id}/verify-presentation'
{
"auto_present": false,
"auto_remove": false,
"auto_verify": true,
"by_format": {
"pres": {},
"pres_proposal": {},
"pres_request": {}
},
"connection_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"created_at": "2021-12-31T23:59:59Z",
"error_msg": "Invalid structure",
"initiator": "self",
"pres": {
"@id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"@type": "https://didcomm.org/my-family/1.0/my-message-type",
"comment": "text",
"formats": [
{
"attach_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"format": "dif/presentation-exchange/submission@v1.0"
}
],
"presentations~attach": [
{
"@id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"byte_count": 1234,
"data": {
"base64": "ey4uLn0=",
"json": "{\"sample\": \"content\"}",
"jws": {
"header": {
"kid": "did:sov:LjgpST2rjsoxYegQDRm7EL#keys-4"
},
"protected": "ey4uLn0",
"signature": "ey4uLn0",
"signatures": [
{
"header": {
"kid": "did:sov:LjgpST2rjsoxYegQDRm7EL#keys-4"
},
"protected": "ey4uLn0",
"signature": "ey4uLn0"
}
]
},
"links": [
"https://link.to/data"
],
"sha256": "617a48c7c8afe0521efdc03e5bb0ad9e655893e6b4b51f0e794d70fba132aacb"
},
"description": "view from doorway, facing east, with lights off",
"filename": "IMG1092348.png",
"lastmod_time": "2021-12-31T23:59:59Z",
"mime-type": "image/png"
}
]
},
"pres_ex_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"pres_proposal": {
"@id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"@type": "https://didcomm.org/my-family/1.0/my-message-type",
"comment": "text",
"formats": [
{
"attach_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"format": "dif/presentation-exchange/submission@v1.0"
}
],
"proposals~attach": [
{
"@id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"byte_count": 1234,
"data": {
"base64": "ey4uLn0=",
"json": "{\"sample\": \"content\"}",
"jws": {
"header": {
"kid": "did:sov:LjgpST2rjsoxYegQDRm7EL#keys-4"
},
"protected": "ey4uLn0",
"signature": "ey4uLn0",
"signatures": [
{
"header": {
"kid": "did:sov:LjgpST2rjsoxYegQDRm7EL#keys-4"
},
"protected": "ey4uLn0",
"signature": "ey4uLn0"
}
]
},
"links": [
"https://link.to/data"
],
"sha256": "617a48c7c8afe0521efdc03e5bb0ad9e655893e6b4b51f0e794d70fba132aacb"
},
"description": "view from doorway, facing east, with lights off",
"filename": "IMG1092348.png",
"lastmod_time": "2021-12-31T23:59:59Z",
"mime-type": "image/png"
}
]
},
"pres_request": {
"@id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"@type": "https://didcomm.org/my-family/1.0/my-message-type",
"comment": "text",
"formats": [
{
"attach_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"format": "dif/presentation-exchange/submission@v1.0"
}
],
"request_presentations~attach": [
{
"@id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"byte_count": 1234,
"data": {
"base64": "ey4uLn0=",
"json": "{\"sample\": \"content\"}",
"jws": {
"header": {
"kid": "did:sov:LjgpST2rjsoxYegQDRm7EL#keys-4"
},
"protected": "ey4uLn0",
"signature": "ey4uLn0",
"signatures": [
{
"header": {
"kid": "did:sov:LjgpST2rjsoxYegQDRm7EL#keys-4"
},
"protected": "ey4uLn0",
"signature": "ey4uLn0"
}
]
},
"links": [
"https://link.to/data"
],
"sha256": "617a48c7c8afe0521efdc03e5bb0ad9e655893e6b4b51f0e794d70fba132aacb"
},
"description": "view from doorway, facing east, with lights off",
"filename": "IMG1092348.png",
"lastmod_time": "2021-12-31T23:59:59Z",
"mime-type": "image/png"
}
],
"will_confirm": true
},
"role": "prover",
"state": "proposal-sent",
"thread_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"trace": true,
"updated_at": "2021-12-31T23:59:59Z",
"verified": "true",
"verified_msgs": [
"text"
]
}