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

Create a commitment mapper SHA256 -> Poseidon for the validators #160

Open
Tracked by #159
Dimo99 opened this issue Jun 19, 2023 · 0 comments
Open
Tracked by #159

Create a commitment mapper SHA256 -> Poseidon for the validators #160

Dimo99 opened this issue Jun 19, 2023 · 0 comments

Comments

@Dimo99
Copy link
Collaborator

Dimo99 commented Jun 19, 2023

The main issue we are encountering is that the SHA-256 hash function, which we currently use for our Merkle proofs in the Ethereum consensus specification trees, is not zk-friendly.

We propose to create a commitment mapping from the validators' root (a SHA-256 Merkle tree comprising all validators) to a Poseidon root of validators. This process would involve generating a proof that a given SHA-256 Merkle tree of validators matches a corresponding Poseidon Merkle tree of validators. Given the sheer number of validators, this tree will be formed using recursive proofs. Since only a small fraction of validators changes per epoch, we can economically update and reuse the proofs. The Poseidon hash function, being more zk-friendly, could then be used to validate that a specific validator belongs to the tree in a more cost-effective manner.

Steps:

  • We will begin by creating the leaves level with a hashtree root of a single validator.
  • Then, the second level will aggregate their hashes and the proofs of the leaves, producing one SHA256 hashtree root and one Poseidon hashtree root.
  • Eventually, we will provide proof that the SHA256 root corresponds to the Poseidon root.

Plonky2 seems like the suitable proving system for this as recursion there is very cheap and we have verifiers for circom implemented.

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