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

Put data in merkle tree in epoch tree leaves #426

Open
vimwitch opened this issue Apr 22, 2023 · 0 comments
Open

Put data in merkle tree in epoch tree leaves #426

vimwitch opened this issue Apr 22, 2023 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@vimwitch
Copy link
Member

Right now we store user data as a hashchain in the epoch tree leaf. Instead we can store the data in a merkle tree, and put the root in the epoch tree leaf. This will reduce the gas cost of attestations. We could call this the data tree.

In the data tree the first leaf should be the epoch key, then the following leaves are the data fields.

For a config of FIELD_COUNT=6 we'll use 3 hashes per attestation (onchain) instead of 5. The number of hashes in ZK stays the same.

@vimwitch vimwitch changed the title Use put data in merkle tree in epoch tree leaves Put data in merkle tree in epoch tree leaves Apr 22, 2023
@vimwitch vimwitch self-assigned this Apr 26, 2023
@vivianjeng vivianjeng added the enhancement New feature or request label May 4, 2023
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