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

Make private inputs explicit #13

Closed
Schaeff opened this issue Nov 20, 2017 · 7 comments
Closed

Make private inputs explicit #13

Schaeff opened this issue Nov 20, 2017 · 7 comments

Comments

@Schaeff
Copy link
Member

Schaeff commented Nov 20, 2017

Problem

The way private inputs are treated is different from public ones:

  • Private inputs are implicit, public inputs are explicit:
def main(c):
  c == a * b
  return 1
  • Public inputs are passed as arguments in compute-witness, while private inputs are passed interactively
  • It makes it hard to use compute-witness programatically
  • It gives no way to list private inputs without solving the R1CS

Solution

We think they should be explicit:

def main(c | a,b):
  c == a * b
  return 1

Roadmap

  1. Make it possible to pass private inputs as arguments in compute-witness rather than interactively (the interactive mode should be activated by a flag)
  2. Make it possible to specify explicit private inputs in .code files
  3. Ban implicit private inputs from .code files

Thoughts welcome :)

@JacobEberhardt
Copy link
Member

We'll just leave this here for a bit to collect input!

@nicola
Copy link

nicola commented Nov 21, 2017

I like the idea, it's just that it looks kind of odd syntax.

What if you require main to have two only: (x, w) which are vectors of inputs? (I know this complicates syntax).

@Schaeff
Copy link
Member Author

Schaeff commented Nov 21, 2017

Yes I guess the syntax is up for debate. Vectors are not supported elsewhere so that could be confusing. Other ideas:

  • (a,b)(c,d) unless higher order functions are on the roadmap
  • (private a, public b, private c)
  • other?

Also, I wonder if that should be defined only for main, or all functions. It doesn't sound necessary for other functions, however it could introduce a consistent notion of scope.

@nicola
Copy link

nicola commented Nov 21, 2017

I like (private a, public b, private c), but I also like the experimental syntax

@PeterBorah
Copy link

+1 to some sort of explicit syntax. (a, b, private c, private d) is probably the most obvious/conservative choice, though I am ok with the | notation and the ()() notation as well.

@Schaeff
Copy link
Member Author

Schaeff commented Dec 11, 2017

(a, b, private c, private d) is being implemented in #15

@Schaeff
Copy link
Member Author

Schaeff commented Feb 2, 2018

Merged into develop

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

No branches or pull requests

4 participants