Repository: hyperledger/aries-cloudagent-python

Issue:
Wrong claim format designation in presentation submission
When issuing a presentation of a W3C verifiable credential, the `"format"` property in the _Input Descriptor Mapping Object_ of the presentation submission is currently being set to `"ldp_vp"`. It must be set to `"ldp_vc"` instead, as it refers to the format of the enclosed credential. (See https://identity.foundation/presentation-exchange/spec/v1.0.0/#presentation-submission)

The parts that need to be changed to produce correct presentation submissions are here:
https://github.com/hyperledger/aries-cloudagent-python/blob/4240fa9b192ea4cdb4026211ea4bec694aec5506/aries_cloudagent/protocols/present_proof/dif/pres_exch_handler.py#L1357-L1361

and here (maybe just remove the default entirely?):
https://github.com/hyperledger/aries-cloudagent-python/blob/4240fa9b192ea4cdb4026211ea4bec694aec5506/aries_cloudagent/protocols/present_proof/dif/pres_exch.py#L835-L840

However, verification logic might also need some adaptations when this parameter is changed, I haven't looked into that yet.


Discussion:

Resolving patch:
diff --git a/aries_cloudagent/protocols/present_proof/dif/pres_exch.py b/aries_cloudagent/protocols/present_proof/dif/pres_exch.py
--- a/aries_cloudagent/protocols/present_proof/dif/pres_exch.py
+++ b/aries_cloudagent/protocols/present_proof/dif/pres_exch.py
@@ -837,7 +837,7 @@ class Meta:
     fmt = fields.Str(
         description="Format",
         required=False,
-        default="ldp_vp",
+        default="ldp_vc",
         data_key="format",
     )
     path = fields.Str(
diff --git a/aries_cloudagent/protocols/present_proof/dif/pres_exch_handler.py b/aries_cloudagent/protocols/present_proof/dif/pres_exch_handler.py
--- a/aries_cloudagent/protocols/present_proof/dif/pres_exch_handler.py
+++ b/aries_cloudagent/protocols/present_proof/dif/pres_exch_handler.py
@@ -1377,7 +1377,7 @@ async def merge(
                     if f"{cred_id}-{cred_id}" not in dict_of_descriptors:
                         descriptor_map = InputDescriptorMapping(
                             id=desc_id,
-                            fmt="ldp_vp",
+                            fmt="ldp_vc",
                             path=(f"$.verifiableCredential[{dict_of_creds[cred_id]}]"),
                         )
                         descriptors.append(descriptor_map)


Test patch:
diff --git a/aries_cloudagent/protocols/present_proof/dif/tests/test_pres_exch.py b/aries_cloudagent/protocols/present_proof/dif/tests/test_pres_exch.py
--- a/aries_cloudagent/protocols/present_proof/dif/tests/test_pres_exch.py
+++ b/aries_cloudagent/protocols/present_proof/dif/tests/test_pres_exch.py
@@ -363,7 +363,7 @@ def test_verifiable_presentation_wrapper(self):
                 "descriptor_map": [
                     {
                         "id": "citizenship_input_1",
-                        "format": "ldp_vp",
+                        "format": "ldp_vc",
                         "path": "$.verifiableCredential[0]",
                     }
                 ],
diff --git a/aries_cloudagent/protocols/present_proof/v2_0/formats/dif/tests/test_handler.py b/aries_cloudagent/protocols/present_proof/v2_0/formats/dif/tests/test_handler.py
--- a/aries_cloudagent/protocols/present_proof/v2_0/formats/dif/tests/test_handler.py
+++ b/aries_cloudagent/protocols/present_proof/v2_0/formats/dif/tests/test_handler.py
@@ -268,7 +268,7 @@
         "descriptor_map": [
             {
                 "id": "citizenship_input_1",
-                "format": "ldp_vp",
+                "format": "ldp_vc",
                 "path": "$.verifiableCredential[0]",
             }
         ],