w3c-ccg / vc-examples

WORK ITEM: Verifiable Credentials Examples
https://w3c-ccg.github.io/vc-examples/
Other
34 stars 15 forks source link

Factom VC - Invalid RDF in ForestTransportGuide #91

Closed rolsonquadras closed 3 years ago

rolsonquadras commented 4 years ago

The VC contains ForestTransportGuide type which is not included in any of the contexts. Hence the TrustBloc verifier fails with invalid signature due to invalid RDF.

https://github.com/w3c-ccg/vc-examples/blob/5d61b1447ed7d29f3c23f845f4c194c28e5f6dbb/plugfest-2020/vendors/factom/verifiable_credentials/ForestTransportGuide.json#L9

JSON Playground normalization result has - <http://example.com/credentials/123> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <https://json-ld.org/playground/ForestTransportGuide> .

srmalley-sphereon commented 4 years ago

We've created a new context version for the Forest Transport Guide that I believe solves this issue. Can you try the request using the context change?

https://github.com/w3c-ccg/vc-examples/pull/94

rolsonquadras commented 4 years ago

The new VC failed against TrustBloc verifier due to invalid signature (the RDF looked fine).

On further investigation, I see that the VC is failing against Factom Verifier as well.

curl --location --request POST 'https://vc.api.factom.sphereon.com/services/verify/credentials' \ --header 'Content-Type: application/json' \ --data-raw '{ "verifiableCredential": { "@context": [ "https://www.w3.org/2018/credentials/v1", "https://sphereon-opensource.github.io/factom-vc-contexts/ftg/forest-transport-guide-v3.jsonld" ], "id": "http://example.com/credentials/123", "type": [ "VerifiableCredential", "ForestTransportGuide" ], "issuer": "did:factom:5d0dd58757119dd437c70d92b44fbf86627ee275f0f2146c3d99e441da342d9f", "issuanceDate": "2020-03-10T04:24:12.164Z", "credentialSubject": { "issueDate": "2017-01-22T00:00:00", "expirationDate": "2017-02-05T00:00:00", "regionalForestAuthority": "Forest Authority Loreto", "countryOfOrigin": "Peru", "resourceOrigin": "Concesión", "resourceNumber": "16-LOR/C-J-011-04", "fullHolderName": "CONSORCIO MADERERO S.A.C. 20450878244", "resolutionNumber": "028-2014-GRL-CGR-PRMRFFS-DER-SDPU", "department": "Loreto", "province": "Requena", "district": "Emilio san martin", "forestManagementPlan": "PO", "gtfOwner": "CONSORCIO MADERERO S.A.C.", "gtfRUCNumber": "20450878244", "gtfAddress": "Trabajo, Carreteria, Unspecified, MANANTAY, 5.80", "gtfDepartment": "Ucayali", "gtfProvince": "Coronel portillo", "gtfDistrict": "Manantay", "addressee": "R.P.T.F. No. 002-2015-GRU, CONSORCIO MADERERO S.A.C. 20450878244", "addresseeRUCNumber": "20450878244", "addresseeAddress": "Trabajo, Carreteria, Unspecified, MANANTAY, 5.80", "addresseeDepartment": "Ucayali", "addresseeProvince": "Coronel portillo", "addresseeDistrict": "Manantay", "carrierNumber": "003-2742", "carrierTransportationType": "Fluvial", "carrierVehicle": "Chatas", "carrierDriver": "ADRIANO QUISTAN", "carrierIdentityDocumentType": "DNI", "carrierIdentityDocumentNumber": "00014128", "carrierDriversLicenseNumber": "DI-17320-02-PAF", "productDetailsLogListNumber": "25", "productDetailsRelatedGTFNumber": "", "productDetailsScientificNameGenus": "Copaifera", "productDetailsScientificNameSpecies": "Reticulata", "productDetailsCommonName": "Copaiba, Copaiba blanca", "productDetailsType": "Troza", "packagingMethodDescription": "Log", "packagingMethodQuantity": "25,00", "productDetailsUnitOfMeasurement": "m3", "productDetailsTotal": "99,4738" }, "proof": { "type": "Ed25519Signature2018", "created": "2020-05-07T08:28:36Z", "jws": "eyJhbGciOiJFZERTQSIsImI2NCI6ZmFsc2UsImNyaXQiOlsiYjY0Il19..QuECLqCz_tJrFtWxNIK8HQFm2X-D0JHZU9roVwRb1Ch57DCOkJVKeUevQm8t1769ZcHxIW7CFeBz2bHkn07dBA", "proofPurpose": "assertionMethod", "verificationMethod": "did:factom:5d0dd58757119dd437c70d92b44fbf86627ee275f0f2146c3d99e441da342d9f#key-0" } }, "options": { "checks": [ "proof" ] } }' {"message":"Invalid signature."}

OR13 commented 3 years ago

Please move any further discussion here if needed https://github.com/w3c-ccg/vc-http-api