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

Getting started guide #45

Open
4 tasks
That3Percent opened this issue Jan 29, 2021 · 0 comments
Open
4 tasks

Getting started guide #45

That3Percent opened this issue Jan 29, 2021 · 0 comments
Labels
P-high Priority: high T-documentation Type: doc improvements

Comments

@That3Percent
Copy link

Summary

I'd like some quick information on how to put together an end-to-end example using arkworks.

Problem Definition

Taking a look at the examples, I was able to get about this far:

fn prove_sum() {
    let values = vec![0u128, 1, 2, 3];
    let sum: u128 = values.iter().sum();
    let cs = ConstraintSystem::<Fr>::new_ref();
    let sum_i = var(&cs, &sum, Input);
    let mut sum_v = var(&cs, &0, Constant);
    for value in values.iter() {
        sum_v += var(&cs, value, Witness);
    }
    sum_i.enforce_equal(&sum_v).unwrap();
    cs.finalize();
    assert!(cs.is_satisfied().unwrap());
}

This creates a constraint system where the sum of all the witnessed in data is constrained to equal a publicly known sum. Great! But, now what? I also need to also be able to construct the same constraint system without any data in a way that it could verify for some commitment and public inputs that the constraint system is satisfied. I also need to be able to somehow export a commitment using this constraint system for a given set of input data.

Proposal

It would be great to have some documentation on how to solve common problems with arkworks, how the code is generally laid out, and just enough information to let people answer the right questions.


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
Pratyush added a commit that referenced this issue Aug 8, 2021
Co-authored-by: Pratyush Mishra <[email protected]>
Co-authored-by: weikeng <[email protected]>
@Pratyush Pratyush added P-high Priority: high T-documentation Type: doc improvements labels Sep 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P-high Priority: high T-documentation Type: doc improvements
Projects
Development

No branches or pull requests

2 participants