Skip to content
This repository has been archived by the owner on Oct 28, 2024. It is now read-only.

is there poseidon solidity contract? #164

Open
yanyanho opened this issue Aug 25, 2020 · 2 comments
Open

is there poseidon solidity contract? #164

yanyanho opened this issue Aug 25, 2020 · 2 comments

Comments

@yanyanho
Copy link

No description provided.

@yanyanho
Copy link
Author

I find that :
inputs = [3, 0]
python_result = poseidon(inputs)
print(python_result)

the result is 254bit? is it a bug?

@HarryR
Copy link
Owner

HarryR commented Aug 30, 2020

Hi.

the code to generate Poseidon EVM contract is at: https://github.com/HarryR/ethsnarks/blob/master/ethsnarks/poseidon/contract.py - it emits raw EVM bytecode rather than Solidity, but could be modified to emit Solidity with mostly inline assembly like the MiMC contract generator does.

The Poseidon hash inputs and outputs are in the zkSNARK scalar field, so not 256bit integers, or the altbn curve field, but the order of the curve (L, which is a ~254 bit prime).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants