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

ENH: nativelib commit_one function #29

Open
thomas-quadratic opened this issue Sep 22, 2023 · 2 comments
Open

ENH: nativelib commit_one function #29

thomas-quadratic opened this issue Sep 22, 2023 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@thomas-quadratic
Copy link
Member

Implement a function commit_one that computes the hash of a single value at given index, the rest of the values being null.
The signature of the function should be (value: jbyteArray, index: jint) -> hash: jbyteArray

Rationale: when dealing with extensions, we have to commit to a single value. Currently, this would be done by left padding with zeroes up to the index of the value and committing all those values. Similarly to the rust-verkle library, we can implement a much more efficient way of committing to a single value by using a single scalar_multiply operation.

@thomas-quadratic thomas-quadratic added the enhancement New feature or request label Sep 22, 2023
@dragan2234
Copy link
Collaborator

@thomas-quadratic When do we commit to only one value? in the branch nodes? In the "extension and suffix nodes" the way I see it we always commit to 4 values (1,stem,C1,C2,0,0,0,0...) and in the C1 and C2 we commit to 128 values each.

@dragan2234
Copy link
Collaborator

Ah I see, even in leafNodes we need to have this option

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants