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

binary constrain merkle tree paths #20

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

binary constrain merkle tree paths #20

barryWhiteHat opened this issue Apr 7, 2019 · 3 comments

Comments

@barryWhiteHat
Copy link
Collaborator

We need to binary constain the merkle tree path as binary. This is because we use multiplicaions and additions to do merkle tree lookups https://github.com/barryWhiteHat/RollupNC/blob/master/tokens_transfer/tokens_transfer.circom#L47

and we don't want an attacker to be able to pass non binary values to mess with the path in the tree.

@vaibhavchellani
Copy link
Collaborator

We can totally add a constraint like a*(a-1) === 0; to check the binary check. But do we really need it?
The constraint here probably wont match if the inputs are non-binary I think.

@barryWhiteHat
Copy link
Collaborator Author

I think there are some attacks where we can play with the merkle path. It seems like pretty difficult to exploit but from a defence in depth argument i think we shoudl include the chcek.

@therealyingtong
Copy link
Collaborator

or a*a == a. should we add this in now?

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

3 participants