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

Implement less than checks in snark #19

Open
barryWhiteHat opened this issue Apr 4, 2019 · 3 comments
Open

Implement less than checks in snark #19

barryWhiteHat opened this issue Apr 4, 2019 · 3 comments

Comments

@barryWhiteHat
Copy link
Collaborator

In circom <= and <= are not grater than and less than checks they do not create constraints.

Therefore https://github.com/barryWhiteHat/RollupNC/blob/master/tokens_transfer/tokens_transfer.circom#L88 checks are not enforced.

We would need to build a circuit to do the >= check which would work with binary decomposition.

@barryWhiteHat
Copy link
Collaborator Author

@GuthL can you check this is correct?

@vaibhavchellani
Copy link
Collaborator

Any updates on this ? How to enforce > or < constraints ?

@barryWhiteHat
Copy link
Collaborator Author

So there are two ideas to check a > b.

  1. Use binary comparitor
  2. We cant ask the operator to prime a number c such that a + c = b where c != 0 because their is an overflow So we have to ensure that a , b , c < 250 bits that way we cannot overlfow. because a_250_bits + b_250_bits can only be 251 bits in total.

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

2 participants