Skip to content
This repository has been archived by the owner on Feb 13, 2024. It is now read-only.

Add possibility to add images/files as attributes in credentials #820

Open
schlagtim opened this issue Aug 29, 2022 · 2 comments
Open

Add possibility to add images/files as attributes in credentials #820

schlagtim opened this issue Aug 29, 2022 · 2 comments

Comments

@schlagtim
Copy link
Contributor

As a user I would like to sign external files such as images, document files with the BPA and present them to other agents.
E.g. passport credential with image of holder

It might be sufficient to add only image file functionality first.

Suggestion:
Encode files in base64 string + MIME-type which can be used in an attribute.
This feature should be optionally turned on/off due to security reasons.

Backend needs to check byte-stream for file magical numbers (https://gist.github.com/leommoore/f9e57ba2aa4bf197ebc5).

  • Limit upload size
  • Handle MIME-type
  • Encode/decode

Frontend needs file upload (perhaps with image preview) for credential request and issue and preview in proof responses.

  • Image preview/upload component
  • File upload
  • File limits (file size, image size, MIME-type)
@swcurran
Copy link

Side question that came up at a meeting just before I read this...

Do you know of what the attribute size limits are in AnonCreds? If I base64 an image to be stored in a credential, how big can the base64 be before I hit a limit in handling the verifiable credential?

@schlagtim
Copy link
Contributor Author

So far we did not find reliable documentation on this question, in the old chat logs of the hyperledger rocketchat we found a hint that it is capped at 300KB because of Indy - however we did not find that to be true anymore. We could not find information yet if there are AnonCreds limitations.
Tests with ACA-Py have shown that credentials can be up to 16MB in size with issuance and proofs apparently still working. However, at that size behavior of ACA-Py (or perhaps the ledger) became less reliable - I needed several attempts to issue a credential of this size as well as sending the presentation until it went through. At lower sizes e.g. 1MB or 3MB there was no issue.

We want to base our credential size limits on the limits of ACA-Py. I noticed that there is a hardcoded maximum admin client upload limit of 16MB (--admin-client-max-request-size - it would be helpful to add that info in the start --help command) which is already way more than we plan to send. The ACA-Py default is currently set to 1MB for both max request size to admin as well as inbound requests - so this is the baseline or less. As we almost always interact with other ACA-Pys so far it makes sense to adapt to these defaults.
1MB should also be plenty to add one or more small images or perhaps even PDF documents to a credential.

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

No branches or pull requests

2 participants