kaleido-io / kaleido-iden3-samples

Sample code for using the iden3 protocol to issue verifiable claims
Apache License 2.0
6 stars 4 forks source link

Proof generation with false condition fails with Assert Failed #21

Open nedgar opened 1 year ago

nedgar commented 1 year ago

In identity/internal/claim.go, I changed the birthday to not satisfy the challenge of being prior to 2000-01-01: birthDay := big.NewInt(20050704), then went through the normal flow of:

For the last step, generating the proof (in holder/wallet with command node index.js --holder AliceWonder --qrcode ~/Downloads/challenge-qr.png), it fails with:

...
After adding signal 0 of timestamp
Assert Failed.
Error in template CredentialAtomicQuerySig_350 line: 216

It's expected that the proof cannot be satisfied, but this is an unexpected error message which suggests a programming error. Is there any way to distinguish between the proof not being satisfied vs. "the inputs are bad" to provide a clearer error message?

nedgar commented 1 year ago

After adding signal 0 of timestamp

That's with the line console.log(`After adding signal ${i} of ${k}`) uncommented in holder/wallet/snark/witness_calculator.js.

nedgar commented 1 year ago

As a check, I repeated the flow with birthDay := big.NewInt(19991231) and it worked OK.