-
Notifications
You must be signed in to change notification settings - Fork 83
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
[FIX] Loosen "version" restriction on PresentationRequestPayload #1212
Conversation
Note that i encountered this bug when sending a proof request from acapy to vcx with version of "1" |
I've asked for some clarification on this in the #anoncreds Discord channel, as I suspect that you're right, but I feel like the spec is vague in what the actual difference is between these two fields. My only other question would be -- would we want to align completely with what is in AnonCreds-rs, as we want to migrate to using that in the future anyways? The answer can also be that that's a problem for later us 😉 😅 |
@JamesKEbert thanks for seeking clarity on it. Yea i suspect the |
yea i think it's a problem for later. I'll need to revise, but i believe the vcx guys created the It also seemed 'cleaner' to have public functions within the aries-vcx repo return types that were owned by the aries-vcx repo (as opposed to returning types from anoncreds-rs). If we were to fully lean into anoncreds-rs, then we could potentially remove the thin |
for reference, the PR description of anoncreds_types somewhat covers the motivation: #1116 |
Makes sense to me 🫡 Thanks for the context, quite helpful 👍 I lean towards getting the types crate contributed upstream or removed entirely, as the maintenance costs of making sure the layer stays inline with the upstream can be brutal when it is not co-located with the code it's typing or wrapping (in my experience at least, although anoncreds-rs isn't changing nearly as frequently as my past experiences). I could definitely see an argument being brought to the anoncred's maintainers--but I'd like to get a little bit of a better handle on Aries VCX before a conversation is broached on that topic there IMO. |
Followup question--might be a dumb one. You mentioned:
Aren't we already going to be consuming anoncreds-rs, so it wouldn't really matter whether the types are separate or not given that we're already including anoncreds-rs? I could see it helping if we were keeping credx around long-term, but we're not (unless there's needs there I don't know about) |
Signed-off-by: George Mulhearn <gmulhearn@anonyome.com>
Yea good question. IMO, it depends on how modular you see the components of this aries-vcx repo. Aries-vcx over the past months/year has gone thru an effort to modularize components into their own crates. And then crates such as Aside; sorry if i'm repeating stuff you already know, but i'll lay it down for context sake.. The "core" components of the
Each of these components also have compile flags (rust feature flags) on them. particularly the flags are for the different implementation variants. So you can choose for each component whether you want to compile For instance, i'm currently consuming the aries_vcx_anoncreds & aries_vcx_wallet crates with no features/implementations included. This is because i implemented BaseWallet & BaseAnonCreds myself (i did this before aries-vcx had implementations for askar wallet and anoncreds-rs anoncreds, i may consider migrating to use the aries-vcx version eventually). When you compile with one of these feature flags, it will avoid the particular dependencies being pulled into your rust build. e.g. consuming the aries_vcx_wallet with only the askar feature flag will avoid bringing in the legacy indy dependency. An example i like to think about for why someone might want another example: maybe they are building a solution in the browser, and certain crates (anoncreds-rs, indyvdr, askar) will not work/compile in the browser. this user would want to exclude all these dependencies when compiling aries_vcx, and they'd implement the traits themselves using whatever they can in the browser context. With all that context rambling out the way: internally in the aries-vcx repo, we are using our
So if we switch from our
With all that being said, IMO the dream solution might be if anoncreds-rs repo had a seperate lightweight crate dedicated to the pure types, which they consume within anoncreds "core", and we can use to replace our anoncreds_types crate. |
This is definitely something we should discuss in the next call, i can probably keep rambling for awhile |
Some really awesome thoughts! I can definitely agree on the value behind the traits/interfaces to allow for various implementations/flexibility.(We did a similar exercise in Credo/AFJ) What I hadn't thought of was why someone who wants to use AnonCreds wouldn't want to just use anoncreds-rs straight up? And I feel like your browser use case is a compelling argument there that I hadn't thought of.
It's really good rambling! So definitely agree this would be a great discussion for the next call. 👌 |
And context is quite appreciated! Especially in a project that is as big as this one is and with as much history as it has. |
I have not heard a response back on Discord, but I think we should move forward as this approach is matched in both Credo and ACA-Py: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Currently our
anoncreds_types
crate (which mostly mirrors anoncreds-rs), has an additional restriction on the presentation request payload: it requires that the inner "version" field is either "1.0" or "2.0".However, the real anoncreds-rs types do not require this. They allow any string: https://github.com/hyperledger/anoncreds-rs/blob/main/src/data_types/pres_request.rs#L18.
The anoncreds spec also seems to imply that the version field is whatever the verifier wants it to be: https://hyperledger.github.io/anoncreds-spec/#create-presentation-request .
I think perhaps we were confusing this field
version
with the other fieldver
. which does seem to be required as "1.0" or "2.0": we have correctly implemented that though.I've kept a default of "1.0" in the builder for backwards compatibility