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

Poseidon Hash #157

Closed
Tracked by #126
rodrigo-pino opened this issue Nov 7, 2023 · 0 comments · Fixed by #437
Closed
Tracked by #126

Poseidon Hash #157

rodrigo-pino opened this issue Nov 7, 2023 · 0 comments · Fixed by #437
Assignees
Labels
enhancement New feature or request vm builtin Related with VM Builtins

Comments

@rodrigo-pino
Copy link
Contributor

rodrigo-pino commented Nov 7, 2023

One of the builtin required by the VM is the Poseidon Hash. It doesn't check when anything is written to it, and only triggers when inferring a value from it.

A Poseidon slot uses 6 cells. The first three are used as inputs (therefore the program should write to it before infering). The last three cells store the result of doing the Poseidon Permutation over the inputs.

The Bitwise and Pedersen Builtins are examples of how to implement the Poseidon Builtin. The general solution flow is:

  1. Read the input values, error accordingly
  2. Perform the Poseidon Hash
  3. Write the three output values

The difficult part of this is executing the math of the Poseidon Hash efficiently

@rodrigo-pino rodrigo-pino added enhancement New feature or request vm builtin Related with VM Builtins labels Nov 7, 2023
@rodrigo-pino rodrigo-pino changed the title Poseidon Poseidon Hash Nov 7, 2023
@ElijahVlasov ElijahVlasov self-assigned this Nov 7, 2023
@MaksymMalicki MaksymMalicki self-assigned this May 8, 2024
@MaksymMalicki MaksymMalicki linked a pull request Jun 3, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request vm builtin Related with VM Builtins
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants