-
Notifications
You must be signed in to change notification settings - Fork 2
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
Feature: transparency updates #2
Conversation
* Re-factoring verifying key into constants in the Halo2Verifier * Added getVerifyingKey() method, which returns vkey parameters * Added auxiliary askama formatting methods
Hi, This is a very interesting approach. As I was also looking into the same issue, I would like to fully understand your approach. |
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.
This is a good approach compared to using a universal reading contract, as mentioned in summa-dev/summa-solvency#301 (comment).
However, the vk
data should not be duplicated to avoid increasing the contract size. More importantly, it's crucial to prevent malicious actions, such as a user receiving different vk
data through the getVerifyingKey
method than what is stored in the verifyProof
function.
I'll experiment with the formatting as I think there are some rust versioning issues. I managed to run the examples using rust-toolchain "nightly-2023-07-11", which I think I took from the zk-prover repo, who is the one that uses this library internally. I will also try running the zk-prover with my changes. I agree that the value should not be duplicated, and I took care in following that. Allow me to explain. In the single contract approach the key parameters are defined as constants and then referred from the
When the verification key is in a separated contract, there are no new constant definitions
|
Yes, then users would simply get the embedded keys by calling the contract, and check if the digest matches the one from executing the zk-prover. I'm not sure how to convince the user without them having to recompile the circuits. |
Ok, I performed some checks following these steps:
|
It will be handled by the issue assigners at summa-dev/summa-solvency#299. Great job! I verified that it worked perfectly in the V2 implementation as well. I will merge your PR in 5 mins. |
I've been following summa-dev/summa-solvency#299 and figured a good approach would be to first make the verifying key accessible. I modified the contract template to support a new method
getVerifyingKey
(which can optionally take a contract address in the decoupled contracts architecture).After this I envision a simple cli tool (probably JS or wasm for browser compatibility) that calculates the digest using
halo2-solidity-verifier/src/codegen.rs
Line 324 in d339725
Summary of changes: