-
Notifications
You must be signed in to change notification settings - Fork 11
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
feat: verifier returns all outputs rather than their hash #57
Conversation
We can export program hash and output hash util functions in the project for people to use (in couple flavors: pedersen, poseidon and keccak for example). Also wondering if raw program byte-code could be returned for sake of symmetry so user could just pass it to util function in his project lmk wdyt? The byte-code is there in raw form we should have a way to extract it raw imo as we do with output. |
#59 provides it for the program hash About the byte-code I'm not sure. |
So after checking it appears that the method to compute the hash of the output (once returned as a vec) already exists in the ecosystem: pedersen: Whatever method I can expose will just be a wrapper over those. Maybe it's not useful to reexpose those in swiftness. |
You are right lets have just logic for extraction of program and output to |
@Okm165 do you want to merge this, or has there been a change in plan? |
@tdelabro i think good idea would be to add example of calculating hash with starknet-rs tools so users before this breaking change are not lost when this changes apply |
I can add an |
That is great solution |
7d40c23
to
f151e66
Compare
@Okm165 I pushed the CLI new arg |
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
The fact that the verifier returns the hash of the output rather than the full outputs prevents a lot of use cases.
Eg. I want to accept a proof in my application if and only if the value written in the inputs is the pubkey that belong to a set I maintain. With only the hash I won't be able to check if this pubkey belong to my set.
This is a breaking change.
People who rely on the old behavior (hash of all outputs) of this lib will have to compute the hash themselves.
Sidenote:
&Felt
instead of aVec
. This would avoid both collecting and cloning the returned values but at the cost of more complexity in the trait.