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

Add index field to Proof struct #42

Open
psivesely opened this issue Jun 15, 2018 · 0 comments
Open

Add index field to Proof struct #42

psivesely opened this issue Jun 15, 2018 · 0 comments

Comments

@psivesely
Copy link
Contributor

Since for some use cases (see #36 and https://github.com/poanetwork/hbbft) knowing the index of a leaf inclusion proof is useful, it might be useful to add an index field to the Proof struct, instead of doing a separate expensive computation to find it. It should be very little additional computation to determine the index as well when already traversing a tree to create an inclusion proof.

When receiving a Proof over the wire from a 3rd party, you should not trust the index is correct, even if the Proof validates. Changing validate to check the index matches in addition to its current purpose, however, should be possible with little overhead.

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

1 participant