Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zero Knowledge poof on non numeric data / predicates on non numeric data #1391

Closed
romanzoun opened this issue Sep 3, 2021 · 4 comments
Closed

Comments

@romanzoun
Copy link

Hey

I have a demo, where I issue birthday as date and not the age in the credentials.

I want to make a predicate, that checks if the age is over 18, but based on the date.

Currently the checks worked only on integer data.

What is a good way to implement this?

I have an idea to change the schema, that day, month and year is separate attribute and then send three predicates on that.
like

"requested_predicates":
  [
   "0_birthday_day": {
        "name": "birthday_day",
        "p_type": ">=",
        "p_value": 4, #current day
      },
    "0_birthday_month": {
        "name": "birthday_month",
        "p_type": ">=",
        "p_value": 4, #current month
      },
    "0_birthday_year": {
        "name": "birthday_year",
        "p_type": ">=",
        "p_value": 2021, #current year
      }
  ]

Do you have best practice for predicates on non numeric values? Is it possible?

@ianco
Copy link
Contributor

ianco commented Sep 3, 2021

We have an issue to add this functionality to the demo: #1291

@romanzoun
Copy link
Author

romanzoun commented Sep 3, 2021

ok, and how you want to solve it? I need something for now that I can use :)

I also think about to extend my schema to have birthday-date and another autogenerated field, like "numeric-birthdate", that puts puts the date as Long.

Is it possible to hide some attrubutes from the mobile wallet, for such autogenerated data. like collapsible data for better UX

@ianco
Copy link
Contributor

ianco commented Sep 3, 2021

The solution described in the ticket I linked should work (disclaimer: I haven't tried it yet).

... change the "age" attribute to be "DateOfBirth" and use the "DateInt" recommended format as outlined in this recently merged PR to Aries RFCs: hyperledger/aries-rfcs#687

@romanzoun
Copy link
Author

Thank you very much, I'll try to do so :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants