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

feat: Create verifyWithDataAttestation.sol #293

Conversation

ethan-crypto
Copy link
Collaborator

@ethan-crypto ethan-crypto commented Jun 9, 2023

Allows users to read inputs to their EZKL models directly on-chain and attest to them when verifying.

  • Add a new parameter to the **run args**: —on-chain-inputs=true.
  • Require input.json used by EZKL to include a field defining where to read the inputs from on-chain.
  • Define the account address and callData that EZKL will statically call into.
  • The decimals field of the callData determines the number of decimal places in the on chain data to scale by. So for instance if the decimals is set to 3 for a raw on chain input value of 1111 it will get converted to 1.111 floating point value.
  • The data that is returned from these calls will be parsed into uint256 integers. Right now we only support reads into view functions that return elementary data types. This restriction is in place to ensure that all of returned data can be implicitly converted into uint256. If users need to read from view functions that return dynamic types they will need to create an adaptor function that parses

image

alexander-camuto and others added 3 commits June 8, 2023 19:09
for reading on-chain
inputs from .json file and then
setting those as pubInputs to the circuit
@ethan-crypto ethan-crypto marked this pull request as draft June 9, 2023 04:45
@ethan-crypto ethan-crypto changed the title feat: Verify evm with data attestation feat: Create verifyWithDataAttestation.sol Jun 9, 2023
@ethan-crypto ethan-crypto marked this pull request as ready for review June 17, 2023 07:08
src/commands.rs Outdated
@@ -159,6 +162,10 @@ pub struct RunArgs {
/// Flags whether params are public, private, hashed
#[arg(long, default_value = "private")]
pub param_visibility: Visibility,
/// Base used to pack the public-inputs to the circuit. (value > 1) to pack instances as a single int.
/// Useful when verifying on the EVM. Note that this will often break for very long inputs. Use with caution, still experimental.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rm this

src/commands.rs Outdated
@@ -188,6 +195,10 @@ impl Cli {
pub fn from_json(arg_json: &str) -> Result<Self, serde_json::Error> {
serde_json::from_str(arg_json)
}
/// Create an ezkl configuration: if there is an EZKLCONF env variable, parse its value, else read it from the command line.
pub fn create() -> Self {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rm this

@@ -144,22 +144,18 @@ jobs:
run: cargo test --release --verbose tests::mock_public_outputs_ -- --test-threads 32
- name: Mock proving tests (public outputs + batch size == 10)
run: cargo test --release --verbose tests::mock_large_batch_public_outputs_ -- --test-threads 32
- name: Mock proving tests (public and packed outputs)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rm this

@@ -144,22 +144,18 @@ jobs:
run: cargo test --release --verbose tests::mock_public_outputs_ -- --test-threads 32
- name: Mock proving tests (public outputs + batch size == 10)
run: cargo test --release --verbose tests::mock_large_batch_public_outputs_ -- --test-threads 32
- name: Mock proving tests (public and packed outputs)
run: cargo test --release --verbose packed_tests::mock_packed_outputs_ -- --test-threads 32
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rm this

- name: Mock proving tests (public inputs)
run: cargo test --release --verbose tests::mock_public_inputs_ -- --test-threads 32
- name: Mock proving tests (public params)
run: cargo test --release --verbose tests::mock_public_params_ -- --test-threads 32
- name: Mock 'everything' tests (public and packed outputs, public inputs)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rm this

into feat-verify-evm-with-data-attestation
@ethan-crypto ethan-crypto force-pushed the feat-verify-evm-with-data-attestation branch from d74d2ef to 40106eb Compare June 19, 2023 22:07
to serialize for GraphInput struct.
@alexander-camuto alexander-camuto merged commit 7325122 into zkonduit:main Jun 20, 2023
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

Successfully merging this pull request may close these issues.

2 participants