Verification fails for `BbsBlsSignatureProof2020` for jsonld-signatures >8.0.0
See original GitHub issueI’m using @mattrglobal/jsonld-signatures-bbs for issuing credentials and creating a zero-knowledge proof for a selectively disclosed credential. However the verify
method of jsonld-signatures
fails when the version of jsonld-signatures
is >8.0.0.
I’ve shared an example code in this gist with the keypair and the used context hardcoded inside the document. To reproduce npm init
a new project, paste the code and install the packages via npm install
. This should install the latest jsonld-signatures
version which at the time of writing is 9.0.2
. Runing the file with node index.js
throws the following error:
{
verified: false,
error: VerificationError: Verification error(s).
at verify (/home/kuzdogan/Desktop/repos/jsonld-bug-test/node_modules/jsonld-signatures/lib/jsonld-signatures.js:125:22)
at async verifySelectiveDisclosedCredential (/home/kuzdogan/Desktop/repos/jsonld-bug-test/index.js:168:20) {
errors: [
Error: Could not verify any proofs; no proofs matched the required suite and purpose.
at ProofSet.verify (/home/kuzdogan/Desktop/repos/jsonld-bug-test/node_modules/jsonld-signatures/lib/ProofSet.js:152:15)
at async verify (/home/kuzdogan/Desktop/repos/jsonld-bug-test/node_modules/jsonld-signatures/lib/jsonld-signatures.js:114:18)
at async verifySelectiveDisclosedCredential (/home/kuzdogan/Desktop/repos/jsonld-bug-test/index.js:168:20)
]
}
}
However when revered to an older version of jsonld-signatures
the document gets successfully verified.
npm install jsonld-signatures@7^
and running node index.js
outputs:
Found cached https://raw.githubusercontent.com/kuzdogan/peer-review-verifiable-credentials-thesis/main/code/PeerReview.json, not requesting
Found cached did:example:489398593#test, not requesting
Found cached did:example:489398593, not requesting
{ verified: true, results: [ { proof: [Object], verified: true } ] }
OS: Ubuntu 20.04.2 LTS node version: 14.17.0 npm version: 7.13.0
Issue Analytics
- State:
- Created 2 years ago
- Comments:6
Top GitHub Comments
I took a look at this today…
The issue is caused by changes in the way suites assume contexts… recently, this package was updated to care less about sec-v2… “sec:”… those changes appear to have had some kind of sad interaction with inheritance model in the mattr library.
All that
suite.matchProof
is trying to do is string equality check really…In our fork of this library, we were able to resolve this issue by just not using it…
This is very hacky… ideally, we would update the suite and account for https://github.com/mattrglobal/jsonld-signatures-bbs/issues/142 which is related.
yes, I think so… IMO the mattr suite should be updated, since it now has several breaking issues with the latest version of jsonld-signatures that assumes new suite methods, such as
ensureContext