Open aljones15 opened 1 month ago
additionally: Whenever this algorithm encodes strings, it MUST use UTF-8 encoding.
If options has a previousProof item that is a string, add the element from allProofs with an id attribute matching previousProof to matchingProofs. If a proof with id equal to previousProof does not exist in allProofs, an error MUST be raised and SHOULD convey an error type of PROOF_GENERATION_ERROR.
If options has a previousProof item that is an array, add each element from allProofs with an id attribute that matches an element of that array. If any element of previousProof array has an id attribute that does not match the id attribute of any element of allProofs, an error MUST be raised and SHOULD convey an error type of PROOF_GENERATION_ERROR.
Start with:
https://w3c.github.io/vc-data-integrity/#proof-chains
has an example.
There is an existing generator that adds a proofId: https://github.com/w3c-ccg/data-integrity-test-suite-assertion/blob/3666beb6e58fc9ec360c4d7b41b5e8741481ae46/vc-generator/generators.js#L174-L177