mattrglobal / node-bbs-signatures

An implementation of BBS+ signatures using rust and typescript for node.js
Apache License 2.0
57 stars 23 forks source link

how to debug verify derived proof? #211

Closed lemoustachiste closed 1 year ago

lemoustachiste commented 1 year ago

Hi,

I have set up a test repo to try out BBS+, when trying to verify a derived proof I am getting the following error:

Error: internal error in Neon module: called `Result::unwrap()` on an `Err` value: \"BBSError { inner: \\n\\n\\n\\nThe proof failed due to a revealed message was supplied that was not signed or a message was revealed that was initially hidden }\"\n

From what I gather, this is coming from the native node build.

The error does not help me much to understand what I am doing wrong (ie: what was revealed that shouldn't have been, etc).

I am basically replicating what's in the example: https://github.com/mattrglobal/jsonld-signatures-bbs/blob/master/sample/ts-node/src/demo_single.ts, so at first it does not look wrong.

How could I debug what's going on?

Thanks

lemoustachiste commented 1 year ago

So what I did is sign and derive documents by gradually removing information. I have figured out what is the problem but I am not sure I understand why, I'm going to open an issue in https://github.com/mattrglobal/jsonld-signatures-bbs

tplooker commented 1 year ago

Hi @lemoustachiste the error you are receiving from this library is as rich as it can be, from a cryptographic perspective a signature or proof verification API in a failure case can only tell you something has failed and often not why because there are many reasons for why and are mostly due to an error upstream (e.g a failure to provide the signature protected information in the form it was signed), I will review your other linked issue as that is where I believe the issue is occurring. I will also close this issue, please reopen if required.