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

Question about claim indexing with the AgeCredential schema #22

Closed nedgar closed 1 year ago

nedgar commented 1 year ago

The AgeCredential schema stores the birthDay in the first index data slot (index value 3 in the Merkle tree):

    birthDay := big.NewInt(19950704)
    claim, _ := core.NewClaim(kycAgeSchema, core.WithIndexID(holderId), core.WithIndexDataInts(birthDay, nil), core.WithRevocationNonce(revNonce))

But doesn't that allow issuing multiple birthday claims instead of just one, since the two claims would have unique index hashes?

nedgar commented 1 year ago

Would it be better to use a value data slot instead, so only one AgeCredential could be issued? This would still allow making corrections since a new version could still be published.

Chengxuan commented 1 year ago

That's a good point. As the index part contains the schema hash and identity id, it's sufficient to ensure only 1 claim of that schema for a specific user ever exists in the claim tree.

Chengxuan commented 1 year ago

Moved to https://github.com/iden3/tutorial-examples/issues/1