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

use a more specific/restrictive type for userId #186

Open
sripwoud opened this issue Sep 2, 2024 · 1 comment
Open

use a more specific/restrictive type for userId #186

sripwoud opened this issue Sep 2, 2024 · 1 comment

Comments

@sripwoud
Copy link

sripwoud commented Sep 2, 2024

I just encountered a bug when trying for the first time to use the OpenPassportQRcode components.
(Quickly solved thanks to direct support from @remicolin ).

This issue is just to capture/discuss a potential improvement on the typing of the userId component prop.

Remi explained me that it can't actually be any string. but only hexifiable strings, so that it can be used as a signal for the circuit.

It would be nice to have either a runtime check/validation or a better TS type to avoid that devs naively put any string.
Eg the type of UUID?

E.g I had used my username at first. It resulted in a error: reference Error: document is undefined

@remicolin
Copy link
Collaborator

@sripwoud thanks for opening the issue.
UUID and hexifiable strings are indeed the only type supported for now (with hexifiable strings).

I just raised #187 that fix the issue, a new version of the sdk is already available, we still need to push a new version of the app to the store to parse the string userId in the inputs of the circuit correctly.

Please note that max length of the userId for type string is capped by the use of BN254, i wrote more details about it here

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